game-min.js 466 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197
  1. var egret;
  2. (function(c) {
  3. var d = function() {
  4. function c() {
  5. this._hashCode = c.hashCount++
  6. }
  7. Object.defineProperty(c.prototype, "hashCode", {
  8. get: function() {
  9. return this._hashCode
  10. },
  11. enumerable: !0,
  12. configurable: !0
  13. });
  14. c.hashCount = 1;
  15. return c
  16. }();
  17. c.HashObject = d;
  18. d.prototype.__class__ = "egret.HashObject"
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends || function(c, d) {
  21. function f() {
  22. this.constructor = c
  23. }
  24. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  25. f.prototype = d.prototype;
  26. c.prototype = new f
  27. };
  28. (function(c) {
  29. var d = function(c) {
  30. function b(a) {
  31. void 0 === a && (a = 300);
  32. c.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > a && (a = 1);
  36. this.autoDisposeTime = a;
  37. this.frameCount = 0
  38. }
  39. __extends(b, c);
  40. b.prototype._checkFrame = function() {
  41. this.frameCount--;
  42. 0 >= this.frameCount && this.dispose()
  43. };
  44. Object.defineProperty(b.prototype, "length", {
  45. get: function() {
  46. return this._length
  47. },
  48. enumerable: !0,
  49. configurable: !0
  50. });
  51. b.prototype.push = function(a) {
  52. var e = this.objectPool; - 1 == e.indexOf(a) && (e.push(a), this._length++, 0 == this.frameCount && (this.frameCount =
  53. this.autoDisposeTime, b._callBackList.push(this)))
  54. };
  55. b.prototype.pop = function() {
  56. if (0 == this._length) return null;
  57. this._length--;
  58. return this.objectPool.pop()
  59. };
  60. b.prototype.dispose = function() {
  61. 0 < this._length && (this.objectPool = [], this._length = 0);
  62. this.frameCount = 0;
  63. var a = b._callBackList,
  64. e = a.indexOf(this); - 1 != e && a.splice(e, 1)
  65. };
  66. b._callBackList = [];
  67. return b
  68. }(c.HashObject);
  69. c.Recycler = d;
  70. d.prototype.__class__ = "egret.Recycler"
  71. })(egret || (egret = {}));
  72. (function(c) {
  73. c.__START_TIME;
  74. c.getTimer = function() {
  75. return Date.now() - c.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(c) {
  79. c.__callLaterFunctionList = [];
  80. c.__callLaterThisList = [];
  81. c.__callLaterArgsList = [];
  82. c.callLater = function(d, f) {
  83. for (var b = [], a = 2; a < arguments.length; a++) b[a - 2] = arguments[a];
  84. c.__callLaterFunctionList.push(d);
  85. c.__callLaterThisList.push(f);
  86. c.__callLaterArgsList.push(b)
  87. };
  88. c.__callAsyncFunctionList = [];
  89. c.__callAsyncThisList = [];
  90. c.__callAsyncArgsList = [];
  91. c.__callAsync = function(d, f) {
  92. for (var b = [], a = 2; a < arguments.length; a++) b[a - 2] = arguments[a];
  93. c.__callAsyncFunctionList.push(d);
  94. c.__callAsyncThisList.push(f);
  95. c.__callAsyncArgsList.push(b)
  96. }
  97. })(egret || (egret = {}));
  98. var egret_dom;
  99. (function(c) {
  100. function d() {
  101. for (var c = document.createElement("div").style, b = ["t", "webkitT", "msT", "MozT", "OT"], a = 0; a < b.length; a++)
  102. if (b[a] + "ransform" in c) return b[a];
  103. return b[0]
  104. }
  105. c.header = "";
  106. c.getHeader = d;
  107. c.getTrans = function(f) {
  108. "" == c.header && (c.header = d());
  109. return c.header + f.substring(1, f.length)
  110. }
  111. })(egret_dom || (egret_dom = {}));
  112. __extends = this.__extends || function(c, d) {
  113. function f() {
  114. this.constructor = c
  115. }
  116. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  117. f.prototype = d.prototype;
  118. c.prototype = new f
  119. };
  120. (function(c) {
  121. var d = function(d) {
  122. function b(a, e, b) {
  123. void 0 === e && (e = !1);
  124. void 0 === b && (b = !1);
  125. d.call(this);
  126. this._eventPhase = 2;
  127. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  128. this.isNew = !0;
  129. this._type = a;
  130. this._bubbles = e;
  131. this._cancelable = b
  132. }
  133. __extends(b, d);
  134. Object.defineProperty(b.prototype, "type", {
  135. get: function() {
  136. return this._type
  137. },
  138. enumerable: !0,
  139. configurable: !0
  140. });
  141. Object.defineProperty(b.prototype, "bubbles", {
  142. get: function() {
  143. return this._bubbles
  144. },
  145. enumerable: !0,
  146. configurable: !0
  147. });
  148. Object.defineProperty(b.prototype, "cancelable", {
  149. get: function() {
  150. return this._cancelable
  151. },
  152. enumerable: !0,
  153. configurable: !0
  154. });
  155. Object.defineProperty(b.prototype, "eventPhase", {
  156. get: function() {
  157. return this._eventPhase
  158. },
  159. enumerable: !0,
  160. configurable: !0
  161. });
  162. Object.defineProperty(b.prototype, "currentTarget", {
  163. get: function() {
  164. return this._currentTarget
  165. },
  166. enumerable: !0,
  167. configurable: !0
  168. });
  169. Object.defineProperty(b.prototype, "target", {
  170. get: function() {
  171. return this._target
  172. },
  173. enumerable: !0,
  174. configurable: !0
  175. });
  176. b.prototype.isDefaultPrevented =
  177. function() {
  178. return this._isDefaultPrevented
  179. };
  180. b.prototype.preventDefault = function() {
  181. this._cancelable && (this._isDefaultPrevented = !0)
  182. };
  183. b.prototype.stopPropagation = function() {
  184. this._bubbles && (this._isPropagationStopped = !0)
  185. };
  186. b.prototype.stopImmediatePropagation = function() {
  187. this._bubbles && (this._isPropagationImmediateStopped = !0)
  188. };
  189. b.prototype._reset = function() {
  190. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  191. null, this._eventPhase = 2)
  192. };
  193. b._dispatchByTarget = function(a, e, b, d, f, g) {
  194. void 0 === f && (f = !1);
  195. void 0 === g && (g = !1);
  196. var h = a.eventRecycler;
  197. h || (h = a.eventRecycler = new c.Recycler);
  198. var m = h.pop();
  199. m ? m._type = b : m = new a(b);
  200. m._bubbles = f;
  201. m._cancelable = g;
  202. if (d)
  203. for (var k in d) m[k] = d[k], null !== m[k] && (d[k] = null);
  204. a = e.dispatchEvent(m);
  205. h.push(m);
  206. return a
  207. };
  208. b._getPropertyData = function(a) {
  209. var e = a._props;
  210. e || (e = a._props = {});
  211. return e
  212. };
  213. b.dispatchEvent = function(a, e, l, c) {
  214. void 0 === l && (l = !1);
  215. var d = b._getPropertyData(b);
  216. c && (d.data = c);
  217. b._dispatchByTarget(b,
  218. a, e, d, l)
  219. };
  220. b.ADDED_TO_STAGE = "addedToStage";
  221. b.REMOVED_FROM_STAGE = "removedFromStage";
  222. b.ADDED = "added";
  223. b.REMOVED = "removed";
  224. b.COMPLETE = "complete";
  225. b.ENTER_FRAME = "enterFrame";
  226. b.RENDER = "render";
  227. b.FINISH_RENDER = "finishRender";
  228. b.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  229. b.LEAVE_STAGE = "leaveStage";
  230. b.RESIZE = "resize";
  231. b.CHANGE = "change";
  232. b.ACTIVATE = "activate";
  233. b.DEACTIVATE = "deactivate";
  234. b.CLOSE = "close";
  235. b.CONNECT = "connect";
  236. return b
  237. }(c.HashObject);
  238. c.Event = d;
  239. d.prototype.__class__ = "egret.Event"
  240. })(egret || (egret = {}));
  241. __extends = this.__extends || function(c, d) {
  242. function f() {
  243. this.constructor = c
  244. }
  245. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  246. f.prototype = d.prototype;
  247. c.prototype = new f
  248. };
  249. (function(c) {
  250. var d = function(c) {
  251. function b(a, e, b) {
  252. void 0 === e && (e = !1);
  253. void 0 === b && (b = !1);
  254. c.call(this, a, e, b);
  255. this._status = 0
  256. }
  257. __extends(b, c);
  258. Object.defineProperty(b.prototype, "status", {
  259. get: function() {
  260. return this._status
  261. },
  262. enumerable: !0,
  263. configurable: !0
  264. });
  265. b.dispatchHTTPStatusEvent = function(a, e) {
  266. null == b.httpStatusEvent && (b.httpStatusEvent = new b(b.HTTP_STATUS));
  267. b.httpStatusEvent._status = e;
  268. a.dispatchEvent(b.httpStatusEvent)
  269. };
  270. b.HTTP_STATUS = "httpStatus";
  271. b.httpStatusEvent = null;
  272. return b
  273. }(c.Event);
  274. c.HTTPStatusEvent =
  275. d;
  276. d.prototype.__class__ = "egret.HTTPStatusEvent"
  277. })(egret || (egret = {}));
  278. __extends = this.__extends || function(c, d) {
  279. function f() {
  280. this.constructor = c
  281. }
  282. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  283. f.prototype = d.prototype;
  284. c.prototype = new f
  285. };
  286. (function(c) {
  287. var d = function(d) {
  288. function b(a, e, b) {
  289. void 0 === e && (e = !1);
  290. void 0 === b && (b = !1);
  291. d.call(this, a, e, b)
  292. }
  293. __extends(b, d);
  294. b.dispatchIOErrorEvent = function(a) {
  295. c.Event._dispatchByTarget(b, a, b.IO_ERROR)
  296. };
  297. b.IO_ERROR = "ioError";
  298. return b
  299. }(c.Event);
  300. c.IOErrorEvent = d;
  301. d.prototype.__class__ = "egret.IOErrorEvent"
  302. })(egret || (egret = {}));
  303. __extends = this.__extends || function(c, d) {
  304. function f() {
  305. this.constructor = c
  306. }
  307. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  308. f.prototype = d.prototype;
  309. c.prototype = new f
  310. };
  311. (function(c) {
  312. var d = function(d) {
  313. function b(a, e, b, c, n, g, h, m, k, p) {
  314. void 0 === e && (e = !0);
  315. void 0 === b && (b = !0);
  316. void 0 === c && (c = 0);
  317. void 0 === n && (n = 0);
  318. void 0 === g && (g = 0);
  319. void 0 === h && (h = !1);
  320. void 0 === m && (m = !1);
  321. void 0 === p && (p = !1);
  322. d.call(this, a, e, b);
  323. this._stageY = this._stageX = 0;
  324. this.touchPointID = c;
  325. this._stageX = n;
  326. this._stageY = g;
  327. this.ctrlKey = h;
  328. this.altKey = m;
  329. this.touchDown = p
  330. }
  331. __extends(b, d);
  332. Object.defineProperty(b.prototype, "stageX", {
  333. get: function() {
  334. return this._stageX
  335. },
  336. enumerable: !0,
  337. configurable: !0
  338. });
  339. Object.defineProperty(b.prototype,
  340. "stageY", {
  341. get: function() {
  342. return this._stageY
  343. },
  344. enumerable: !0,
  345. configurable: !0
  346. });
  347. Object.defineProperty(b.prototype, "localX", {
  348. get: function() {
  349. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
  350. },
  351. enumerable: !0,
  352. configurable: !0
  353. });
  354. Object.defineProperty(b.prototype, "localY", {
  355. get: function() {
  356. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
  357. },
  358. enumerable: !0,
  359. configurable: !0
  360. });
  361. b.dispatchTouchEvent = function(a, e, l, d, f, g, h, m, k) {
  362. void 0 === l && (l = 0);
  363. void 0 === d && (d = 0);
  364. void 0 === f && (f = 0);
  365. void 0 === g && (g = !1);
  366. void 0 === h && (h = !1);
  367. void 0 === m && (m = !1);
  368. void 0 === k && (k = !1);
  369. var p = c.Event._getPropertyData(b);
  370. p.touchPointID = l;
  371. p._stageX = d;
  372. p._stageY = f;
  373. p.ctrlKey = g;
  374. p.altKey = h;
  375. p.shiftKey = m;
  376. p.touchDown = k;
  377. c.Event._dispatchByTarget(b, a, e, p, !0, !0)
  378. };
  379. b.TOUCH_TAP = "touchTap";
  380. b.TOUCH_MOVE = "touchMove";
  381. b.TOUCH_BEGIN = "touchBegin";
  382. b.TOUCH_END = "touchEnd";
  383. b.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  384. b.TOUCH_ROLL_OUT = "touchRollOut";
  385. b.TOUCH_ROLL_OVER = "touchRollOver";
  386. b.TOUCH_OUT =
  387. "touchOut";
  388. b.TOUCH_OVER = "touchOver";
  389. return b
  390. }(c.Event);
  391. c.TouchEvent = d;
  392. d.prototype.__class__ = "egret.TouchEvent"
  393. })(egret || (egret = {}));
  394. __extends = this.__extends || function(c, d) {
  395. function f() {
  396. this.constructor = c
  397. }
  398. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  399. f.prototype = d.prototype;
  400. c.prototype = new f
  401. };
  402. (function(c) {
  403. var d = function(d) {
  404. function b(a, e, b) {
  405. void 0 === e && (e = !1);
  406. void 0 === b && (b = !1);
  407. d.call(this, a, e, b)
  408. }
  409. __extends(b, d);
  410. b.dispatchTimerEvent = function(a, e) {
  411. c.Event._dispatchByTarget(b, a, e)
  412. };
  413. b.TIMER = "timer";
  414. b.TIMER_COMPLETE = "timerComplete";
  415. return b
  416. }(c.Event);
  417. c.TimerEvent = d;
  418. d.prototype.__class__ = "egret.TimerEvent"
  419. })(egret || (egret = {}));
  420. __extends = this.__extends || function(c, d) {
  421. function f() {
  422. this.constructor = c
  423. }
  424. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  425. f.prototype = d.prototype;
  426. c.prototype = new f
  427. };
  428. (function(c) {
  429. var d = function(d) {
  430. function b(a, e, b, c, n) {
  431. void 0 === e && (e = !1);
  432. void 0 === b && (b = !1);
  433. void 0 === c && (c = 0);
  434. void 0 === n && (n = 0);
  435. d.call(this, a, e, b);
  436. this.bytesLoaded = c;
  437. this.bytesTotal = n
  438. }
  439. __extends(b, d);
  440. b.dispatchProgressEvent = function(a, e, l, d) {
  441. void 0 === l && (l = 0);
  442. void 0 === d && (d = 0);
  443. c.Event._dispatchByTarget(b, a, e, {
  444. bytesLoaded: l,
  445. bytesTotal: d
  446. })
  447. };
  448. b.PROGRESS = "progress";
  449. b.SOCKET_DATA = "socketData";
  450. return b
  451. }(c.Event);
  452. c.ProgressEvent = d;
  453. d.prototype.__class__ = "egret.ProgressEvent"
  454. })(egret || (egret = {}));
  455. (function(c) {
  456. var d = function() {
  457. function c() {}
  458. c.CAPTURING_PHASE = 1;
  459. c.AT_TARGET = 2;
  460. c.BUBBLING_PHASE = 3;
  461. return c
  462. }();
  463. c.EventPhase = d;
  464. d.prototype.__class__ = "egret.EventPhase"
  465. })(egret || (egret = {}));
  466. __extends = this.__extends || function(c, d) {
  467. function f() {
  468. this.constructor = c
  469. }
  470. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  471. f.prototype = d.prototype;
  472. c.prototype = new f
  473. };
  474. (function(c) {
  475. var d = function(d) {
  476. function b(a) {
  477. void 0 === a && (a = null);
  478. d.call(this);
  479. this._eventTarget = a ? a : this
  480. }
  481. __extends(b, d);
  482. b.prototype.addEventListener = function(a, e, b, d, f) {
  483. void 0 === d && (d = !1);
  484. void 0 === f && (f = 0);
  485. "undefined" === typeof d && (d = !1);
  486. "undefined" === typeof f && (f = 0);
  487. e || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  488. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  489. var g = d[a];
  490. g || (g = d[a] = []);
  491. this._insertEventBin(g, e, b, f)
  492. };
  493. b.prototype._insertEventBin = function(a, e, b, c, d) {
  494. void 0 === d && (d = void 0);
  495. for (var f = -1, h = a.length, m = 0; m < h; m++) {
  496. var k = a[m];
  497. if (k.listener === e && k.thisObject === b && k.display === d) return !1; - 1 == f && k.priority < c && (f = m)
  498. }
  499. e = {
  500. listener: e,
  501. thisObject: b,
  502. priority: c
  503. };
  504. d && (e.display = d); - 1 != f ? a.splice(f, 0, e) : a.push(e);
  505. return !0
  506. };
  507. b.prototype.removeEventListener = function(a, e, b, c) {
  508. void 0 === c && (c = !1);
  509. if (c = c ? this._captureEventsMap : this._eventsMap) {
  510. var d = c[a];
  511. d && (this._removeEventBin(d,
  512. e, b), 0 == d.length && delete c[a])
  513. }
  514. };
  515. b.prototype._removeEventBin = function(a, e, b, c) {
  516. void 0 === c && (c = void 0);
  517. for (var d = a.length, f = 0; f < d; f++) {
  518. var h = a[f];
  519. if (h.listener === e && h.thisObject === b && h.display === c) return a.splice(f, 1), !0
  520. }
  521. return !1
  522. };
  523. b.prototype.hasEventListener = function(a) {
  524. return this._eventsMap && this._eventsMap[a] || this._captureEventsMap && this._captureEventsMap[a]
  525. };
  526. b.prototype.willTrigger = function(a) {
  527. return this.hasEventListener(a)
  528. };
  529. b.prototype.dispatchEvent = function(a) {
  530. a._reset();
  531. a._target = this._eventTarget;
  532. a._currentTarget = this._eventTarget;
  533. return this._notifyListener(a)
  534. };
  535. b.prototype._notifyListener = function(a) {
  536. var e = 1 == a._eventPhase ? this._captureEventsMap : this._eventsMap;
  537. if (!e) return !0;
  538. e = e[a._type];
  539. if (!e) return !0;
  540. var b = e.length;
  541. if (0 == b) return !0;
  542. for (var e = e.concat(), c = 0; c < b; c++) {
  543. var d = e[c];
  544. d.listener.call(d.thisObject, a);
  545. if (a._isPropagationImmediateStopped) break
  546. }
  547. return !a._isDefaultPrevented
  548. };
  549. b.prototype.dispatchEventWith = function(a, e, b) {
  550. void 0 === e && (e = !1);
  551. c.Event.dispatchEvent(this, a, e, b)
  552. };
  553. return b
  554. }(c.HashObject);
  555. c.EventDispatcher = d;
  556. d.prototype.__class__ = "egret.EventDispatcher"
  557. })(egret || (egret = {}));
  558. __extends = this.__extends || function(c, d) {
  559. function f() {
  560. this.constructor = c
  561. }
  562. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  563. f.prototype = d.prototype;
  564. c.prototype = new f
  565. };
  566. (function(c) {
  567. var d = function(d) {
  568. function b() {
  569. d.call(this);
  570. this.reuseEvent = new c.Event("")
  571. }
  572. __extends(b, d);
  573. b.prototype.run = function() {
  574. c.Ticker.getInstance().run();
  575. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  576. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  577. this.touchContext.run()
  578. };
  579. b.prototype.renderLoop = function(a) {
  580. if (0 < c.__callLaterFunctionList.length) {
  581. var e = c.__callLaterFunctionList;
  582. c.__callLaterFunctionList = [];
  583. var l = c.__callLaterThisList;
  584. c.__callLaterThisList = [];
  585. var d = c.__callLaterArgsList;
  586. c.__callLaterArgsList = []
  587. }
  588. a = this.stage;
  589. var f = b.cachedEvent;
  590. f._type = c.Event.RENDER;
  591. this.dispatchEvent(f);
  592. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  593. e && this.doCallLaterList(e, l, d);
  594. 0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
  595. e = this.rendererContext;
  596. e.onRenderStart();
  597. e.clearScreen();
  598. a._updateTransform();
  599. f._type = c.Event.FINISH_UPDATE_TRANSFORM;
  600. this.dispatchEvent(f);
  601. a._draw(e);
  602. f._type = c.Event.FINISH_RENDER;
  603. this.dispatchEvent(f);
  604. e.onRenderFinish()
  605. };
  606. b.prototype.broadcastEnterFrame = function(a) {
  607. a = this.reuseEvent;
  608. a._type = c.Event.ENTER_FRAME;
  609. this.dispatchEvent(a);
  610. for (var e = c.DisplayObject._enterFrameCallBackList.concat(), b = e.length, d = 0; d < b; d++) {
  611. var f = e[d];
  612. a._target = f.display;
  613. a._currentTarget = f.display;
  614. f.listener.call(f.thisObject, a)
  615. }
  616. e = c.Recycler._callBackList;
  617. for (d = e.length - 1; 0 <= d; d--) e[d]._checkFrame()
  618. };
  619. b.prototype.broadcastRender = function() {
  620. var a = this.reuseEvent;
  621. a._type = c.Event.RENDER;
  622. for (var e = c.DisplayObject._renderCallBackList.concat(),
  623. b = e.length, d = 0; d < b; d++) {
  624. var f = e[d],
  625. g = f.display;
  626. a._target = g;
  627. a._currentTarget = g;
  628. f.listener.call(f.thisObject, a)
  629. }
  630. };
  631. b.prototype.doCallLaterList = function(a, e, b) {
  632. for (var c = a.length, d = 0; d < c; d++) {
  633. var f = a[d];
  634. null != f && f.apply(e[d], b[d])
  635. }
  636. };
  637. b.prototype.doCallAsyncList = function() {
  638. var a = c.__callAsyncFunctionList.concat(),
  639. e = c.__callAsyncThisList.concat(),
  640. b = c.__callAsyncArgsList.concat();
  641. c.__callAsyncFunctionList.length = 0;
  642. c.__callAsyncThisList.length = 0;
  643. for (var d = c.__callAsyncArgsList.length = 0; d < a.length; d++) {
  644. var f =
  645. a[d];
  646. null != f && f.apply(e[d], b[d])
  647. }
  648. };
  649. b.DEVICE_PC = "web";
  650. b.DEVICE_MOBILE = "native";
  651. b.RUNTIME_HTML5 = "runtime_html5";
  652. b.RUNTIME_NATIVE = "runtime_native";
  653. b.cachedEvent = new c.Event("");
  654. return b
  655. }(c.EventDispatcher);
  656. c.MainContext = d;
  657. d.prototype.__class__ = "egret.MainContext"
  658. })(egret || (egret = {}));
  659. var testDeviceType = function() {
  660. if (!this.navigator) return !0;
  661. var c = navigator.userAgent.toLowerCase();
  662. return -1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  663. },
  664. testRuntimeType = function() {
  665. return this.navigator ? !0 : !1
  666. };
  667. egret.MainContext.instance = new egret.MainContext;
  668. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  669. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  670. delete testDeviceType;
  671. delete testRuntimeType;
  672. (function(c) {
  673. var d = function() {
  674. function d() {
  675. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  676. this._maxDeltaTime = 500;
  677. this._totalDeltaTime = 0
  678. }
  679. d.getInstance = function() {
  680. null == d.instance && (d.instance = new d);
  681. return d.instance
  682. };
  683. d.prototype.run = function() {
  684. c.Ticker.getInstance().register(this.update, this);
  685. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, c.MainContext.instance.stage.addChild(this._txt));
  686. var b = c.MainContext.instance;
  687. b.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  688. b.addEventListener(c.Event.RENDER, this.onStartRender, this);
  689. b.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  690. b.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  691. };
  692. d.prototype.onEnterFrame = function(b) {
  693. this._lastTime = c.getTimer()
  694. };
  695. d.prototype.onStartRender = function(b) {
  696. b = c.getTimer();
  697. this._logicPerformanceCost = b - this._lastTime;
  698. this._lastTime = b
  699. };
  700. d.prototype.onFinishUpdateTransform =
  701. function(b) {
  702. b = c.getTimer();
  703. this._updateTransformPerformanceCost = b - this._lastTime;
  704. this._lastTime = b
  705. };
  706. d.prototype.onFinishRender = function(b) {
  707. b = c.getTimer();
  708. this._renderPerformanceCost = b - this._lastTime;
  709. this._lastTime = b
  710. };
  711. d.prototype.update = function(b) {
  712. this._tick++;
  713. this._totalDeltaTime += b;
  714. if (this._totalDeltaTime >= this._maxDeltaTime) {
  715. b = (this._preDrawCount - 1).toString();
  716. var a = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  717. "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  718. this._txt.text = "draw:" + b + "\ncost:" + a + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  719. this._tick = this._totalDeltaTime = 0
  720. }
  721. this._preDrawCount = 0
  722. };
  723. d.prototype.onDrawImage = function() {
  724. this._preDrawCount++
  725. };
  726. return d
  727. }();
  728. c.Profiler = d;
  729. d.prototype.__class__ = "egret.Profiler"
  730. })(egret || (egret = {}));
  731. __extends = this.__extends || function(c, d) {
  732. function f() {
  733. this.constructor = c
  734. }
  735. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  736. f.prototype = d.prototype;
  737. c.prototype = new f
  738. };
  739. (function(c) {
  740. var d = function(d) {
  741. function b() {
  742. d.apply(this, arguments);
  743. this._timeScale = 1;
  744. this._paused = !1;
  745. this.callBackList = []
  746. }
  747. __extends(b, d);
  748. b.prototype.run = function() {
  749. c.__START_TIME = (new Date).getTime();
  750. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  751. };
  752. b.prototype.update = function(a) {
  753. var e = this.callBackList.concat(),
  754. b = e.length;
  755. a *= this._timeScale;
  756. a *= this._timeScale;
  757. for (var c = 0; c < b; c++) {
  758. var d = e[c];
  759. d.listener.call(d.thisObject, a)
  760. }
  761. };
  762. b.prototype.register = function(a, e, b) {
  763. void 0 === b &&
  764. (b = 0);
  765. this._insertEventBin(this.callBackList, a, e, b)
  766. };
  767. b.prototype.unregister = function(a, e) {
  768. this._removeEventBin(this.callBackList, a, e)
  769. };
  770. b.prototype.setTimeout = function(a, e, b) {
  771. for (var d = [], f = 3; f < arguments.length; f++) d[f - 3] = arguments[f];
  772. c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  773. c.setTimeout.apply(null, [a, e, b].concat(d))
  774. };
  775. b.prototype.setTimeScale = function(a) {
  776. this._timeScale = a
  777. };
  778. b.prototype.getTimeScale = function() {
  779. return this._timeScale
  780. };
  781. b.prototype.pause = function() {
  782. this._paused = !0
  783. };
  784. b.prototype.resume = function() {
  785. this._paused = !1
  786. };
  787. b.getInstance = function() {
  788. null == b.instance && (b.instance = new b);
  789. return b.instance
  790. };
  791. return b
  792. }(c.EventDispatcher);
  793. c.Ticker = d;
  794. d.prototype.__class__ = "egret.Ticker"
  795. })(egret || (egret = {}));
  796. (function(c) {
  797. var d = function() {
  798. function c() {}
  799. c.LEFT = "left";
  800. c.RIGHT = "right";
  801. c.CENTER = "center";
  802. c.JUSTIFY = "justify";
  803. c.CONTENT_JUSTIFY = "contentJustify";
  804. return c
  805. }();
  806. c.HorizontalAlign = d;
  807. d.prototype.__class__ = "egret.HorizontalAlign"
  808. })(egret || (egret = {}));
  809. (function(c) {
  810. var d = function() {
  811. function c() {}
  812. c.TOP = "top";
  813. c.BOTTOM = "bottom";
  814. c.MIDDLE = "middle";
  815. c.JUSTIFY = "justify";
  816. c.CONTENT_JUSTIFY = "contentJustify";
  817. return c
  818. }();
  819. c.VerticalAlign = d;
  820. d.prototype.__class__ = "egret.VerticalAlign"
  821. })(egret || (egret = {}));
  822. __extends = this.__extends || function(c, d) {
  823. function f() {
  824. this.constructor = c
  825. }
  826. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  827. f.prototype = d.prototype;
  828. c.prototype = new f
  829. };
  830. (function(c) {
  831. var d = function(d) {
  832. function b(a, e) {
  833. void 0 === e && (e = 0);
  834. d.call(this);
  835. this._currentCount = 0;
  836. this.delay = a;
  837. this.repeatCount = e
  838. }
  839. __extends(b, d);
  840. b.prototype.currentCount = function() {
  841. return this._currentCount
  842. };
  843. Object.defineProperty(b.prototype, "running", {
  844. get: function() {
  845. return this._running
  846. },
  847. enumerable: !0,
  848. configurable: !0
  849. });
  850. b.prototype.reset = function() {
  851. this.stop();
  852. this._currentCount = 0
  853. };
  854. b.prototype.start = function() {
  855. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
  856. 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  857. };
  858. b.prototype.stop = function() {
  859. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  860. };
  861. b.prototype.onEnterFrame = function(a) {
  862. a = c.getTimer();
  863. 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)))
  864. };
  865. return b
  866. }(c.EventDispatcher);
  867. c.Timer = d;
  868. d.prototype.__class__ = "egret.Timer"
  869. })(egret || (egret = {}));
  870. (function(c) {
  871. function d(c) {
  872. c = c.prototype ? c.prototype : c.__proto__;
  873. if (c.hasOwnProperty("__class__")) return c.__class__;
  874. var b = c.constructor.toString(),
  875. a = b.indexOf("("),
  876. b = b.substring(9, a);
  877. Object.defineProperty(c, "__class__", {
  878. value: b,
  879. enumerable: !1,
  880. writable: !0
  881. });
  882. return b
  883. }
  884. c.getQualifiedClassName = d;
  885. c.getQualifiedSuperclassName = function(c) {
  886. c = c.prototype ? c.prototype : c.__proto__;
  887. if (c.hasOwnProperty("__superclass__")) return c.__superclass__;
  888. var b = Object.getPrototypeOf(c);
  889. if (null == b) return null;
  890. b = d(b.constructor);
  891. if (!b) return null;
  892. Object.defineProperty(c, "__superclass__", {
  893. value: b,
  894. enumerable: !1,
  895. writable: !0
  896. });
  897. return b
  898. }
  899. })(egret || (egret = {}));
  900. (function(c) {
  901. var d = {};
  902. c.getDefinitionByName = function(c) {
  903. if (!c) return null;
  904. var b = d[c];
  905. if (b) return b;
  906. for (var a = c.split("."), e = a.length, b = __global, l = 0; l < e; l++)
  907. if (b = b[a[l]], !b) return null;
  908. return d[c] = b
  909. }
  910. })(egret || (egret = {}));
  911. var __global = __global || this;
  912. (function(c) {
  913. function d(a) {
  914. for (var e in f) {
  915. var b = f[e];
  916. b.delay -= a;
  917. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete f[e])
  918. }
  919. }
  920. var f = {},
  921. b = 0;
  922. c.setTimeout = function(a, e, l) {
  923. for (var q = [], n = 3; n < arguments.length; n++) q[n - 3] = arguments[n];
  924. q = {
  925. listener: a,
  926. thisObject: e,
  927. delay: l,
  928. params: q
  929. };
  930. 0 == b && c.Ticker.getInstance().register(d, null);
  931. b++;
  932. f[b] = q;
  933. return b
  934. };
  935. c.clearTimeout = function(a) {
  936. delete f[a]
  937. }
  938. })(egret || (egret = {}));
  939. (function(c) {
  940. c.hasDefinition = function(d) {
  941. return c.getDefinitionByName(d) ? !0 : !1
  942. }
  943. })(egret || (egret = {}));
  944. (function(c) {
  945. c.toColorString = function(c) {
  946. if (isNaN(c) || 0 > c) c = 0;
  947. 16777215 < c && (c = 16777215);
  948. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  949. return "#" + c
  950. }
  951. })(egret || (egret = {}));
  952. __extends = this.__extends || function(c, d) {
  953. function f() {
  954. this.constructor = c
  955. }
  956. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  957. f.prototype = d.prototype;
  958. c.prototype = new f
  959. };
  960. (function(c) {
  961. var d = function(d) {
  962. function b(a, e, b, c, n, g) {
  963. void 0 === a && (a = 1);
  964. void 0 === e && (e = 0);
  965. void 0 === b && (b = 0);
  966. void 0 === c && (c = 1);
  967. void 0 === n && (n = 0);
  968. void 0 === g && (g = 0);
  969. d.call(this);
  970. this.a = a;
  971. this.b = e;
  972. this.c = b;
  973. this.d = c;
  974. this.tx = n;
  975. this.ty = g
  976. }
  977. __extends(b, d);
  978. b.prototype.prepend = function(a, e, b, c, d, f) {
  979. var h = this.tx;
  980. if (1 != a || 0 != e || 0 != b || 1 != c) {
  981. var m = this.a,
  982. k = this.c;
  983. this.a = m * a + this.b * b;
  984. this.b = m * e + this.b * c;
  985. this.c = k * a + this.d * b;
  986. this.d = k * e + this.d * c
  987. }
  988. this.tx = h * a + this.ty * b + d;
  989. this.ty = h * e + this.ty * c + f;
  990. return this
  991. };
  992. b.prototype.append =
  993. function(a, e, b, c, d, f) {
  994. var h = this.a,
  995. m = this.b,
  996. k = this.c,
  997. p = this.d;
  998. if (1 != a || 0 != e || 0 != b || 1 != c) this.a = a * h + e * k, this.b = a * m + e * p, this.c = b * h + c * k, this.d = b * m + c * p;
  999. this.tx = d * h + f * k + this.tx;
  1000. this.ty = d * m + f * p + this.ty;
  1001. return this
  1002. };
  1003. b.prototype.prependTransform = function(a, e, l, c, d, f, h, m, k) {
  1004. if (d % 360) {
  1005. var p = d * b.DEG_TO_RAD;
  1006. d = Math.cos(p);
  1007. p = Math.sin(p)
  1008. } else d = 1, p = 0;
  1009. if (m || k) this.tx -= m, this.ty -= k;
  1010. f || h ? (f *= b.DEG_TO_RAD, h *= b.DEG_TO_RAD, this.prepend(d * l, p * l, -p * c, d * c, 0, 0), this.prepend(Math.cos(h), Math.sin(h), -Math.sin(f), Math.cos(f),
  1011. a, e)) : this.prepend(d * l, p * l, -p * c, d * c, a, e);
  1012. return this
  1013. };
  1014. b.prototype.appendTransform = function(a, e, l, c, d, f, h, m, k) {
  1015. if (d % 360) {
  1016. var p = d * b.DEG_TO_RAD;
  1017. d = Math.cos(p);
  1018. p = Math.sin(p)
  1019. } else d = 1, p = 0;
  1020. f || h ? (f *= b.DEG_TO_RAD, h *= b.DEG_TO_RAD, this.append(Math.cos(h), Math.sin(h), -Math.sin(f), Math.cos(f), a, e), this.append(d * l, p * l, -p * c, d * c, 0, 0)) : this.append(d * l, p * l, -p * c, d * c, a, e);
  1021. if (m || k) this.tx -= m * this.a + k * this.c, this.ty -= m * this.b + k * this.d;
  1022. return this
  1023. };
  1024. b.prototype.rotate = function(a) {
  1025. var e = Math.cos(a);
  1026. a = Math.sin(a);
  1027. var b = this.a,
  1028. c = this.c,
  1029. d = this.tx;
  1030. this.a = b * e - this.b * a;
  1031. this.b = b * a + this.b * e;
  1032. this.c = c * e - this.d * a;
  1033. this.d = c * a + this.d * e;
  1034. this.tx = d * e - this.ty * a;
  1035. this.ty = d * a + this.ty * e;
  1036. return this
  1037. };
  1038. b.prototype.skew = function(a, e) {
  1039. a *= b.DEG_TO_RAD;
  1040. e *= b.DEG_TO_RAD;
  1041. this.append(Math.cos(e), Math.sin(e), -Math.sin(a), Math.cos(a), 0, 0);
  1042. return this
  1043. };
  1044. b.prototype.scale = function(a, e) {
  1045. this.a *= a;
  1046. this.d *= e;
  1047. this.c *= a;
  1048. this.b *= e;
  1049. this.tx *= a;
  1050. this.ty *= e;
  1051. return this
  1052. };
  1053. b.prototype.translate = function(a, e) {
  1054. this.tx += a;
  1055. this.ty += e;
  1056. return this
  1057. };
  1058. b.prototype.identity = function() {
  1059. this.a =
  1060. this.d = 1;
  1061. this.b = this.c = this.tx = this.ty = 0;
  1062. return this
  1063. };
  1064. b.prototype.identityMatrix = function(a) {
  1065. this.a = a.a;
  1066. this.b = a.b;
  1067. this.c = a.c;
  1068. this.d = a.d;
  1069. this.tx = a.tx;
  1070. this.ty = a.ty;
  1071. return this
  1072. };
  1073. b.prototype.invert = function() {
  1074. var a = this.a,
  1075. e = this.b,
  1076. b = this.c,
  1077. c = this.d,
  1078. d = this.tx,
  1079. f = a * c - e * b;
  1080. this.a = c / f;
  1081. this.b = -e / f;
  1082. this.c = -b / f;
  1083. this.d = a / f;
  1084. this.tx = (b * this.ty - c * d) / f;
  1085. this.ty = -(a * this.ty - e * d) / f;
  1086. return this
  1087. };
  1088. b.transformCoords = function(a, e, b) {
  1089. var d = c.Point.identity;
  1090. d.x = a.a * e + a.c * b + a.tx;
  1091. d.y = a.d * b + a.b * e + a.ty;
  1092. return d
  1093. };
  1094. b.prototype.toArray =
  1095. function(a) {
  1096. this.array || (this.array = new Float32Array(9));
  1097. 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);
  1098. this.array[8] = 1;
  1099. return this.array
  1100. };
  1101. b.identity = new b;
  1102. b.DEG_TO_RAD = Math.PI / 180;
  1103. return b
  1104. }(c.HashObject);
  1105. c.Matrix = d;
  1106. d.prototype.__class__ =
  1107. "egret.Matrix"
  1108. })(egret || (egret = {}));
  1109. __extends = this.__extends || function(c, d) {
  1110. function f() {
  1111. this.constructor = c
  1112. }
  1113. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1114. f.prototype = d.prototype;
  1115. c.prototype = new f
  1116. };
  1117. (function(c) {
  1118. var d = function(c) {
  1119. function b(a, e) {
  1120. void 0 === a && (a = 0);
  1121. void 0 === e && (e = 0);
  1122. c.call(this);
  1123. this.x = a;
  1124. this.y = e
  1125. }
  1126. __extends(b, c);
  1127. b.prototype.clone = function() {
  1128. return new b(this.x, this.y)
  1129. };
  1130. b.prototype.equals = function(a) {
  1131. return this.x == a.x && this.y == a.y
  1132. };
  1133. b.distance = function(a, e) {
  1134. return Math.sqrt((a.x - e.x) * (a.x - e.x) + (a.y - e.y) * (a.y - e.y))
  1135. };
  1136. b.identity = new b(0, 0);
  1137. return b
  1138. }(c.HashObject);
  1139. c.Point = d;
  1140. d.prototype.__class__ = "egret.Point"
  1141. })(egret || (egret = {}));
  1142. __extends = this.__extends || function(c, d) {
  1143. function f() {
  1144. this.constructor = c
  1145. }
  1146. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1147. f.prototype = d.prototype;
  1148. c.prototype = new f
  1149. };
  1150. (function(c) {
  1151. var d = function(c) {
  1152. function b(a, e, b, d) {
  1153. void 0 === a && (a = 0);
  1154. void 0 === e && (e = 0);
  1155. void 0 === b && (b = 0);
  1156. void 0 === d && (d = 0);
  1157. c.call(this);
  1158. this.x = a;
  1159. this.y = e;
  1160. this.width = b;
  1161. this.height = d
  1162. }
  1163. __extends(b, c);
  1164. Object.defineProperty(b.prototype, "right", {
  1165. get: function() {
  1166. return this.x + this.width
  1167. },
  1168. set: function(a) {
  1169. this.width = a - this.x
  1170. },
  1171. enumerable: !0,
  1172. configurable: !0
  1173. });
  1174. Object.defineProperty(b.prototype, "bottom", {
  1175. get: function() {
  1176. return this.y + this.height
  1177. },
  1178. set: function(a) {
  1179. this.height = a - this.y
  1180. },
  1181. enumerable: !0,
  1182. configurable: !0
  1183. });
  1184. b.prototype.initialize = function(a, e, b, c) {
  1185. this.x = a;
  1186. this.y = e;
  1187. this.width = b;
  1188. this.height = c;
  1189. return this
  1190. };
  1191. b.prototype.contains = function(a, e) {
  1192. return this.x <= a && this.x + this.width >= a && this.y <= e && this.y + this.height >= e
  1193. };
  1194. b.prototype.intersects = function(a) {
  1195. var e = a.right,
  1196. b = a.bottom,
  1197. c = this.right,
  1198. d = this.bottom;
  1199. return this.contains(a.x, a.y) || this.contains(a.x, b) || this.contains(e, a.y) || this.contains(e, b) || a.contains(this.x, this.y) || a.contains(this.x, d) || a.contains(c, this.y) || a.contains(c, d) ? !0 : !1
  1200. };
  1201. b.prototype.clone =
  1202. function() {
  1203. return new b(this.x, this.y, this.width, this.height)
  1204. };
  1205. b.prototype.containsPoint = function(a) {
  1206. return this.x < a.x && this.x + this.width > a.x && this.y < a.y && this.y + this.height > a.y ? !0 : !1
  1207. };
  1208. b.identity = new b(0, 0, 0, 0);
  1209. return b
  1210. }(c.HashObject);
  1211. c.Rectangle = d;
  1212. d.prototype.__class__ = "egret.Rectangle"
  1213. })(egret || (egret = {}));
  1214. (function(c) {
  1215. var d = function() {
  1216. function d() {}
  1217. d.fatal = function(b, a) {
  1218. void 0 === a && (a = null);
  1219. c.Logger.traceToConsole("Fatal", b, a);
  1220. throw Error(c.Logger.getTraceCode("Fatal", b, a));
  1221. };
  1222. d.info = function(b, a) {
  1223. void 0 === a && (a = null);
  1224. c.Logger.traceToConsole("Info", b, a)
  1225. };
  1226. d.warning = function(b, a) {
  1227. void 0 === a && (a = null);
  1228. c.Logger.traceToConsole("Warning", b, a)
  1229. };
  1230. d.traceToConsole = function(b, a, e) {
  1231. console.log(c.Logger.getTraceCode(b, a, e))
  1232. };
  1233. d.getTraceCode = function(b, a, e) {
  1234. return "[" + b + "]" + a + ":" + (null == e ? "" : e)
  1235. };
  1236. return d
  1237. }();
  1238. c.Logger =
  1239. d;
  1240. d.prototype.__class__ = "egret.Logger"
  1241. })(egret || (egret = {}));
  1242. __extends = this.__extends || function(c, d) {
  1243. function f() {
  1244. this.constructor = c
  1245. }
  1246. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1247. f.prototype = d.prototype;
  1248. c.prototype = new f
  1249. };
  1250. (function(c) {
  1251. var d = function(d) {
  1252. function b() {
  1253. d.call(this);
  1254. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1255. this._xmlDict = {};
  1256. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1257. }
  1258. __extends(b, d);
  1259. b.getInstance = function() {
  1260. b._instance || (b._instance = new b);
  1261. return b._instance
  1262. };
  1263. b.prototype.parserXML = function(a) {
  1264. for (var e = 0;
  1265. "\n" == a.charAt(e) || "\t" == a.charAt(e) || "\r" == a.charAt(e) || " " == a.charAt(e);) e++;
  1266. 0 != e && (a = a.substring(e, a.length));
  1267. this._isSupportDOMParser ?
  1268. e = this._parser.parseFromString(a, "text/xml") : (e = new ActiveXObject("Microsoft.XMLDOM"), e.async = "false", e.loadXML(a));
  1269. null == e && c.Logger.info("xml not found!");
  1270. return e
  1271. };
  1272. b._instance = null;
  1273. return b
  1274. }(c.HashObject);
  1275. c.SAXParser = d;
  1276. d.prototype.__class__ = "egret.SAXParser"
  1277. })(egret || (egret = {}));
  1278. __extends = this.__extends || function(c, d) {
  1279. function f() {
  1280. this.constructor = c
  1281. }
  1282. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1283. f.prototype = d.prototype;
  1284. c.prototype = new f
  1285. };
  1286. (function(c) {
  1287. var d = function(a) {
  1288. function e() {
  1289. a.call(this);
  1290. this._designHeight = this._designWidth = 0;
  1291. this._scaleY = this._scaleX = 1;
  1292. this._stageHeight = this._stageWidth = this._offSetY = 0
  1293. }
  1294. __extends(e, a);
  1295. e.getInstance = function() {
  1296. null == e.instance && (b.initialize(), e.instance = new e);
  1297. return e.instance
  1298. };
  1299. e.prototype.setDesignSize = function(a, e, b) {
  1300. this._designWidth = a;
  1301. this._designHeight = e;
  1302. b && (c.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1303. this._setResolutionPolicy(b))
  1304. };
  1305. e.prototype._setResolutionPolicy = function(a) {
  1306. this._resolutionPolicy = a;
  1307. a.init(this);
  1308. a._apply(this, this._designWidth, this._designHeight)
  1309. };
  1310. e.prototype.getScaleX = function() {
  1311. return this._scaleX
  1312. };
  1313. e.prototype.getScaleY = function() {
  1314. return this._scaleY
  1315. };
  1316. e.prototype.getOffSetY = function() {
  1317. return this._offSetY
  1318. };
  1319. e.canvas_name = "egretCanvas";
  1320. e.canvas_div_name = "gameDiv";
  1321. return e
  1322. }(c.HashObject);
  1323. c.StageDelegate = d;
  1324. d.prototype.__class__ = "egret.StageDelegate";
  1325. var f = function() {
  1326. function a(e,
  1327. b) {
  1328. this._containerStrategy = e;
  1329. this._contentStrategy = b
  1330. }
  1331. a.prototype.init = function(a) {
  1332. this._containerStrategy.init(a);
  1333. this._contentStrategy.init(a)
  1334. };
  1335. a.prototype._apply = function(a, e, b) {
  1336. this._containerStrategy._apply(a, e, b);
  1337. this._contentStrategy._apply(a, e, b)
  1338. };
  1339. return a
  1340. }();
  1341. c.ResolutionPolicy = f;
  1342. f.prototype.__class__ = "egret.ResolutionPolicy";
  1343. var b = function() {
  1344. function e() {}
  1345. e.initialize = function() {
  1346. e.EQUAL_TO_FRAME = new a
  1347. };
  1348. e.prototype.init = function(a) {};
  1349. e.prototype._apply = function(a, e, b) {};
  1350. e.prototype._setupContainer =
  1351. function() {
  1352. var a = document.body,
  1353. e;
  1354. a && (e = a.style) && (e.paddingTop = e.paddingTop || "0px", e.paddingRight = e.paddingRight || "0px", e.paddingBottom = e.paddingBottom || "0px", e.paddingLeft = e.paddingLeft || "0px", e.borderTop = e.borderTop || "0px", e.borderRight = e.borderRight || "0px", e.borderBottom = e.borderBottom || "0px", e.borderLeft = e.borderLeft || "0px", e.marginTop = e.marginTop || "0px", e.marginRight = e.marginRight || "0px", e.marginBottom = e.marginBottom || "0px", e.marginLeft = e.marginLeft || "0px")
  1355. };
  1356. return e
  1357. }();
  1358. c.ContainerStrategy = b;
  1359. b.prototype.__class__ = "egret.ContainerStrategy";
  1360. var a = function(a) {
  1361. function e() {
  1362. a.apply(this, arguments)
  1363. }
  1364. __extends(e, a);
  1365. e.prototype._apply = function(a) {
  1366. this._setupContainer()
  1367. };
  1368. return e
  1369. }(b);
  1370. c.EqualToFrame = a;
  1371. a.prototype.__class__ = "egret.EqualToFrame";
  1372. f = function() {
  1373. function a() {}
  1374. a.prototype.init = function(a) {};
  1375. a.prototype._apply = function(a, e, b) {};
  1376. a.prototype.setEgretSize = function(a, e, b, l, f, k) {
  1377. void 0 === k && (k = 0);
  1378. c.StageDelegate.getInstance()._stageWidth = Math.round(a);
  1379. c.StageDelegate.getInstance()._stageHeight =
  1380. Math.round(e);
  1381. a = document.getElementById(d.canvas_div_name);
  1382. a.style.width = b + "px";
  1383. a.style.height = l + "px";
  1384. a.style.top = k + "px"
  1385. };
  1386. a.prototype._getClientWidth = function() {
  1387. return document.documentElement.clientWidth
  1388. };
  1389. a.prototype._getClientHeight = function() {
  1390. return document.documentElement.clientHeight
  1391. };
  1392. return a
  1393. }();
  1394. c.ContentStrategy = f;
  1395. f.prototype.__class__ = "egret.ContentStrategy";
  1396. var e = function(a) {
  1397. function e(b) {
  1398. void 0 === b && (b = 0);
  1399. a.call(this);
  1400. this.minWidth = b
  1401. }
  1402. __extends(e, a);
  1403. e.prototype._apply = function(a, e, b) {
  1404. e =
  1405. this._getClientWidth();
  1406. var l = this._getClientHeight(),
  1407. c = l / b,
  1408. d = e / c,
  1409. f = 1;
  1410. 0 != this.minWidth && (f = Math.min(1, d / this.minWidth));
  1411. this.setEgretSize(d / f, b, e, l * f);
  1412. a._scaleX = c * f;
  1413. a._scaleY = c * f
  1414. };
  1415. return e
  1416. }(f);
  1417. c.FixedHeight = e;
  1418. e.prototype.__class__ = "egret.FixedHeight";
  1419. e = function(a) {
  1420. function e(b) {
  1421. void 0 === b && (b = 0);
  1422. a.call(this);
  1423. this.minHeight = b
  1424. }
  1425. __extends(e, a);
  1426. e.prototype._apply = function(a, e, b) {
  1427. b = this._getClientWidth();
  1428. var l = this._getClientHeight(),
  1429. c = b / e,
  1430. d = l / c,
  1431. f = 1;
  1432. 0 != this.minHeight && (f = Math.min(1, d / this.minHeight));
  1433. this.setEgretSize(e,
  1434. d / f, b * f, l, b * (1 - f) / 2);
  1435. a._scaleX = c * f;
  1436. a._scaleY = c * f
  1437. };
  1438. return e
  1439. }(f);
  1440. c.FixedWidth = e;
  1441. e.prototype.__class__ = "egret.FixedWidth";
  1442. e = function(a) {
  1443. function e(b, c) {
  1444. a.call(this);
  1445. this.width = b;
  1446. this.height = c
  1447. }
  1448. __extends(e, a);
  1449. e.prototype._apply = function(a, e, b) {
  1450. b = this.width;
  1451. var l = this.height,
  1452. c = b / e;
  1453. this.setEgretSize(e, l / c, b, l);
  1454. a._scaleX = c;
  1455. a._scaleY = c
  1456. };
  1457. return e
  1458. }(f);
  1459. c.FixedSize = e;
  1460. e.prototype.__class__ = "egret.FixedSize";
  1461. e = function(a) {
  1462. function e() {
  1463. a.call(this)
  1464. }
  1465. __extends(e, a);
  1466. e.prototype._apply = function(a, e, b) {
  1467. this.setEgretSize(e,
  1468. b, e, b, Math.floor((e - e) / 2));
  1469. a._scaleX = 1;
  1470. a._scaleY = 1
  1471. };
  1472. return e
  1473. }(f);
  1474. c.NoScale = e;
  1475. e.prototype.__class__ = "egret.NoScale";
  1476. e = function(a) {
  1477. function e() {
  1478. a.call(this)
  1479. }
  1480. __extends(e, a);
  1481. e.prototype._apply = function(a, e, b) {
  1482. var c = this._getClientWidth(),
  1483. l = this._getClientHeight(),
  1484. d = c,
  1485. f = l,
  1486. q = d / e < f / b ? d / e : f / b,
  1487. d = e * q,
  1488. f = b * q,
  1489. c = Math.floor((c - d) / 2);
  1490. a._offSetY = Math.floor((l - f) / 2);
  1491. this.setEgretSize(e, b / 1, 1 * d, f, c, a._offSetY);
  1492. a._scaleX = 1 * q;
  1493. a._scaleY = 1 * q
  1494. };
  1495. return e
  1496. }(f);
  1497. c.ShowAll = e;
  1498. e.prototype.__class__ = "egret.ShowAll";
  1499. f = function(a) {
  1500. function e() {
  1501. a.call(this)
  1502. }
  1503. __extends(e, a);
  1504. e.prototype._apply = function(a, e, b) {
  1505. var c = this._getClientWidth(),
  1506. l = this._getClientHeight(),
  1507. c = c / e,
  1508. l = l / b;
  1509. this.setEgretSize(e, b, e * c, b * l);
  1510. a._scaleX = c;
  1511. a._scaleY = l
  1512. };
  1513. return e
  1514. }(f);
  1515. c.FullScreen = f;
  1516. f.prototype.__class__ = "egret.FullScreen"
  1517. })(egret || (egret = {}));
  1518. __extends = this.__extends || function(c, d) {
  1519. function f() {
  1520. this.constructor = c
  1521. }
  1522. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1523. f.prototype = d.prototype;
  1524. c.prototype = new f
  1525. };
  1526. (function(c) {
  1527. var d = function(d) {
  1528. function b() {
  1529. d.call(this);
  1530. this._originalData = {};
  1531. this._drawAreaList = []
  1532. }
  1533. __extends(b, d);
  1534. b.getInstance = function() {
  1535. null == b.instance && (b.instance = new b);
  1536. return b.instance
  1537. };
  1538. b.prototype.addDrawArea = function(a) {
  1539. this._drawAreaList.push(a)
  1540. };
  1541. b.prototype.clearDrawArea = function() {
  1542. this._drawAreaList = []
  1543. };
  1544. b.prototype.drawImage = function(a, e, b, d, f, g, h, m, k, p, r) {
  1545. void 0 === r && (r = void 0);
  1546. h = h || 0;
  1547. m = m || 0;
  1548. var s = e._texture_to_render;
  1549. if (null != s && 0 != g && 0 != f && 0 != k && 0 != p)
  1550. if (0 != this._drawAreaList.length &&
  1551. c.MainContext.instance.rendererContext._cacheCanvasContext) {
  1552. var t = c.DisplayObject.getTransformBounds(e._getSize(c.Rectangle.identity), e._worldTransform);
  1553. e._worldBounds.initialize(t.x, t.y, t.width, t.height);
  1554. t = this._originalData;
  1555. t.sourceX = b;
  1556. t.sourceY = d;
  1557. t.sourceWidth = f;
  1558. t.sourceHeight = g;
  1559. t.destX = h;
  1560. t.destY = m;
  1561. t.destWidth = k;
  1562. t.destHeight = p;
  1563. for (var v = this.getDrawAreaList(), x = 0; x < v.length; x++)
  1564. if (!this.ignoreRender(e, v[x], t.destX, t.destY)) {
  1565. a.drawImage(s, b, d, f, g, h, m, k, p, r);
  1566. break
  1567. }
  1568. } else a.drawImage(s, b, d, f, g, h, m,
  1569. k, p, r)
  1570. };
  1571. b.prototype.ignoreRender = function(a, e, b, c) {
  1572. var d = a._worldBounds;
  1573. b *= a._worldTransform.a;
  1574. c *= a._worldTransform.d;
  1575. return d.x + d.width + b <= e.x || d.x + b >= e.x + e.width || d.y + d.height + c <= e.y || d.y + c >= e.y + e.height ? !0 : !1
  1576. };
  1577. b.prototype.getDrawAreaList = function() {
  1578. var a;
  1579. 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,
  1580. this.onResize, this)), a = this._defaultDrawAreaList) : a = this._drawAreaList;
  1581. return a
  1582. };
  1583. b.prototype.onResize = function() {
  1584. c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
  1585. this._defaultDrawAreaList = null
  1586. };
  1587. return b
  1588. }(c.HashObject);
  1589. c.RenderFilter = d;
  1590. d.prototype.__class__ = "egret.RenderFilter"
  1591. })(egret || (egret = {}));
  1592. (function(c) {
  1593. var d = function() {
  1594. function d() {}
  1595. d.mapClass = function(b, a, e) {
  1596. void 0 === e && (e = "");
  1597. b = this.getKey(b) + "#" + e;
  1598. this.mapClassDic[b] = a
  1599. };
  1600. d.getKey = function(b) {
  1601. return "string" == typeof b ? b : c.getQualifiedClassName(b)
  1602. };
  1603. d.mapValue = function(b, a, e) {
  1604. void 0 === e && (e = "");
  1605. b = this.getKey(b) + "#" + e;
  1606. this.mapValueDic[b] = a
  1607. };
  1608. d.hasMapRule = function(b, a) {
  1609. void 0 === a && (a = "");
  1610. var e = this.getKey(b) + "#" + a;
  1611. return this.mapValueDic[e] || this.mapClassDic[e] ? !0 : !1
  1612. };
  1613. d.getInstance = function(b, a) {
  1614. void 0 === a && (a = "");
  1615. var e = this.getKey(b) + "#" +
  1616. a;
  1617. if (this.mapValueDic[e]) return this.mapValueDic[e];
  1618. var c = this.mapClassDic[e];
  1619. if (c) return c = new c, this.mapValueDic[e] = c, delete this.mapClassDic[e], c;
  1620. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + e + "\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");
  1621. };
  1622. d.mapClassDic = {};
  1623. d.mapValueDic = {};
  1624. return d
  1625. }();
  1626. c.Injector = d;
  1627. d.prototype.__class__ = "egret.Injector"
  1628. })(egret ||
  1629. (egret = {}));
  1630. (function(c) {
  1631. var d = function() {
  1632. function c() {}
  1633. c.NORMAL = "normal";
  1634. c.ADD = "add";
  1635. return c
  1636. }();
  1637. c.BlendMode = d;
  1638. d.prototype.__class__ = "egret.BlendMode"
  1639. })(egret || (egret = {}));
  1640. __extends = this.__extends || function(c, d) {
  1641. function f() {
  1642. this.constructor = c
  1643. }
  1644. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  1645. f.prototype = d.prototype;
  1646. c.prototype = new f
  1647. };
  1648. (function(c) {
  1649. var d = function(d) {
  1650. function b() {
  1651. d.call(this);
  1652. this.__hack_local_matrix = null;
  1653. this._sizeDirty = this._normalDirty = !0;
  1654. this._parent = this._texture_to_render = null;
  1655. this._y = this._x = 0;
  1656. this._scaleY = this._scaleX = 1;
  1657. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1658. this._visible = !0;
  1659. this._rotation = 0;
  1660. this._alpha = 1;
  1661. this._skewY = this._skewX = 0;
  1662. this._touchEnabled = !1;
  1663. this._scrollRect = this.blendMode = null;
  1664. this._hasHeightSet = this._hasWidthSet = !1;
  1665. this._worldBounds = this.mask = null;
  1666. this.worldAlpha =
  1667. 1;
  1668. this._rectH = this._rectW = 0;
  1669. this._stage = null;
  1670. this._cacheDirty = this._cacheAsBitmap = !1;
  1671. this._colorTransform = null;
  1672. this._worldTransform = new c.Matrix;
  1673. this._worldBounds = new c.Rectangle(0, 0, 0, 0);
  1674. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1675. }
  1676. __extends(b, d);
  1677. b.prototype._setDirty = function() {
  1678. this._normalDirty = !0
  1679. };
  1680. b.prototype.getDirty = function() {
  1681. return this._normalDirty || this._sizeDirty
  1682. };
  1683. b.prototype._setParentSizeDirty = function() {
  1684. var a = this._parent;
  1685. !a || a._hasWidthSet || a._hasHeightSet || a._setSizeDirty()
  1686. };
  1687. b.prototype._setSizeDirty =
  1688. function() {
  1689. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1690. };
  1691. b.prototype._clearDirty = function() {
  1692. this._normalDirty = !1
  1693. };
  1694. b.prototype._clearSizeDirty = function() {
  1695. this._sizeDirty = !1
  1696. };
  1697. Object.defineProperty(b.prototype, "parent", {
  1698. get: function() {
  1699. return this._parent
  1700. },
  1701. enumerable: !0,
  1702. configurable: !0
  1703. });
  1704. b.prototype._parentChanged = function(a) {
  1705. this._parent = a
  1706. };
  1707. Object.defineProperty(b.prototype, "x", {
  1708. get: function() {
  1709. return this._x
  1710. },
  1711. set: function(a) {
  1712. this._setX(a)
  1713. },
  1714. enumerable: !0,
  1715. configurable: !0
  1716. });
  1717. b.prototype._setX = function(a) {
  1718. c.NumberUtils.isNumber(a) && this._x != a && (this._x = a, this._setDirty(), this._setParentSizeDirty())
  1719. };
  1720. Object.defineProperty(b.prototype, "y", {
  1721. get: function() {
  1722. return this._y
  1723. },
  1724. set: function(a) {
  1725. this._setY(a)
  1726. },
  1727. enumerable: !0,
  1728. configurable: !0
  1729. });
  1730. b.prototype._setY = function(a) {
  1731. c.NumberUtils.isNumber(a) && this._y != a && (this._y = a, this._setDirty(), this._setParentSizeDirty())
  1732. };
  1733. Object.defineProperty(b.prototype, "scaleX", {
  1734. get: function() {
  1735. return this._scaleX
  1736. },
  1737. set: function(a) {
  1738. c.NumberUtils.isNumber(a) &&
  1739. this._scaleX != a && (this._scaleX = a, this._setDirty(), this._setParentSizeDirty())
  1740. },
  1741. enumerable: !0,
  1742. configurable: !0
  1743. });
  1744. Object.defineProperty(b.prototype, "scaleY", {
  1745. get: function() {
  1746. return this._scaleY
  1747. },
  1748. set: function(a) {
  1749. c.NumberUtils.isNumber(a) && this._scaleY != a && (this._scaleY = a, this._setDirty(), this._setParentSizeDirty())
  1750. },
  1751. enumerable: !0,
  1752. configurable: !0
  1753. });
  1754. Object.defineProperty(b.prototype, "anchorOffsetX", {
  1755. get: function() {
  1756. return this._anchorOffsetX
  1757. },
  1758. set: function(a) {
  1759. c.NumberUtils.isNumber(a) && this._anchorOffsetX !=
  1760. a && (this._anchorOffsetX = a, this._setDirty(), this._setParentSizeDirty())
  1761. },
  1762. enumerable: !0,
  1763. configurable: !0
  1764. });
  1765. Object.defineProperty(b.prototype, "anchorOffsetY", {
  1766. get: function() {
  1767. return this._anchorOffsetY
  1768. },
  1769. set: function(a) {
  1770. c.NumberUtils.isNumber(a) && this._anchorOffsetY != a && (this._anchorOffsetY = a, this._setDirty(), this._setParentSizeDirty())
  1771. },
  1772. enumerable: !0,
  1773. configurable: !0
  1774. });
  1775. Object.defineProperty(b.prototype, "anchorX", {
  1776. get: function() {
  1777. return this._anchorX
  1778. },
  1779. set: function(a) {
  1780. this._setAnchorX(a)
  1781. },
  1782. enumerable: !0,
  1783. configurable: !0
  1784. });
  1785. b.prototype._setAnchorX = function(a) {
  1786. c.NumberUtils.isNumber(a) && this._anchorX != a && (this._anchorX = a, this._setDirty(), this._setParentSizeDirty())
  1787. };
  1788. Object.defineProperty(b.prototype, "anchorY", {
  1789. get: function() {
  1790. return this._anchorY
  1791. },
  1792. set: function(a) {
  1793. this._setAnchorY(a)
  1794. },
  1795. enumerable: !0,
  1796. configurable: !0
  1797. });
  1798. b.prototype._setAnchorY = function(a) {
  1799. c.NumberUtils.isNumber(a) && this._anchorY != a && (this._anchorY = a, this._setDirty(), this._setParentSizeDirty())
  1800. };
  1801. Object.defineProperty(b.prototype, "visible", {
  1802. get: function() {
  1803. return this._visible
  1804. },
  1805. set: function(a) {
  1806. this._setVisible(a)
  1807. },
  1808. enumerable: !0,
  1809. configurable: !0
  1810. });
  1811. b.prototype._setVisible = function(a) {
  1812. this._visible != a && (this._visible = a, this._setSizeDirty())
  1813. };
  1814. Object.defineProperty(b.prototype, "rotation", {
  1815. get: function() {
  1816. return this._rotation
  1817. },
  1818. set: function(a) {
  1819. c.NumberUtils.isNumber(a) && this._rotation != a && (this._rotation = a, this._setSizeDirty())
  1820. },
  1821. enumerable: !0,
  1822. configurable: !0
  1823. });
  1824. Object.defineProperty(b.prototype, "alpha", {
  1825. get: function() {
  1826. return this._alpha
  1827. },
  1828. set: function(a) {
  1829. c.NumberUtils.isNumber(a) &&
  1830. this._alpha != a && (this._alpha = a, this._setDirty(), this._setCacheDirty())
  1831. },
  1832. enumerable: !0,
  1833. configurable: !0
  1834. });
  1835. Object.defineProperty(b.prototype, "skewX", {
  1836. get: function() {
  1837. return this._skewX
  1838. },
  1839. set: function(a) {
  1840. c.NumberUtils.isNumber(a) && this._skewX != a && (this._skewX = a, this._setSizeDirty())
  1841. },
  1842. enumerable: !0,
  1843. configurable: !0
  1844. });
  1845. Object.defineProperty(b.prototype, "skewY", {
  1846. get: function() {
  1847. return this._skewY
  1848. },
  1849. set: function(a) {
  1850. c.NumberUtils.isNumber(a) && this._skewY != a && (this._skewY = a, this._setSizeDirty())
  1851. },
  1852. enumerable: !0,
  1853. configurable: !0
  1854. });
  1855. Object.defineProperty(b.prototype, "touchEnabled", {
  1856. get: function() {
  1857. return this._touchEnabled
  1858. },
  1859. set: function(a) {
  1860. this._setTouchEnabled(a)
  1861. },
  1862. enumerable: !0,
  1863. configurable: !0
  1864. });
  1865. b.prototype._setTouchEnabled = function(a) {
  1866. this._touchEnabled = a
  1867. };
  1868. Object.defineProperty(b.prototype, "scrollRect", {
  1869. get: function() {
  1870. return this._scrollRect
  1871. },
  1872. set: function(a) {
  1873. this._setScrollRect(a)
  1874. },
  1875. enumerable: !0,
  1876. configurable: !0
  1877. });
  1878. b.prototype._setScrollRect = function(a) {
  1879. this._scrollRect = a;
  1880. this._setSizeDirty()
  1881. };
  1882. Object.defineProperty(b.prototype,
  1883. "measuredWidth", {
  1884. get: function() {
  1885. return this._measureBounds().width
  1886. },
  1887. enumerable: !0,
  1888. configurable: !0
  1889. });
  1890. Object.defineProperty(b.prototype, "measuredHeight", {
  1891. get: function() {
  1892. return this._measureBounds().height
  1893. },
  1894. enumerable: !0,
  1895. configurable: !0
  1896. });
  1897. Object.defineProperty(b.prototype, "explicitWidth", {
  1898. get: function() {
  1899. return this._explicitWidth
  1900. },
  1901. enumerable: !0,
  1902. configurable: !0
  1903. });
  1904. Object.defineProperty(b.prototype, "explicitHeight", {
  1905. get: function() {
  1906. return this._explicitHeight
  1907. },
  1908. enumerable: !0,
  1909. configurable: !0
  1910. });
  1911. Object.defineProperty(b.prototype,
  1912. "width", {
  1913. get: function() {
  1914. return this._getSize(c.Rectangle.identity).width
  1915. },
  1916. set: function(a) {
  1917. this._setWidth(a)
  1918. },
  1919. enumerable: !0,
  1920. configurable: !0
  1921. });
  1922. Object.defineProperty(b.prototype, "height", {
  1923. get: function() {
  1924. return this._getSize(c.Rectangle.identity).height
  1925. },
  1926. set: function(a) {
  1927. this._setHeight(a)
  1928. },
  1929. enumerable: !0,
  1930. configurable: !0
  1931. });
  1932. b.prototype._setWidth = function(a) {
  1933. this._setSizeDirty();
  1934. this._setCacheDirty();
  1935. this._explicitWidth = a;
  1936. this._hasWidthSet = c.NumberUtils.isNumber(a)
  1937. };
  1938. b.prototype._setHeight = function(a) {
  1939. this._setSizeDirty();
  1940. this._setCacheDirty();
  1941. this._explicitHeight = a;
  1942. this._hasHeightSet = c.NumberUtils.isNumber(a)
  1943. };
  1944. b.prototype._draw = function(a) {
  1945. if (this._visible && !this.drawCacheTexture(a)) {
  1946. this._colorTransform && a.setGlobalColorTransform(this._colorTransform.matrix);
  1947. a.setAlpha(this.worldAlpha, this.blendMode);
  1948. a.setTransform(this._worldTransform);
  1949. var e = this.mask || this._scrollRect;
  1950. e && a.pushMask(e);
  1951. this._render(a);
  1952. e && a.popMask();
  1953. this._colorTransform && a.setGlobalColorTransform(null)
  1954. }
  1955. this.destroyCacheBounds()
  1956. };
  1957. b.prototype.drawCacheTexture =
  1958. function(a) {
  1959. if (!1 == this._cacheAsBitmap) return !1;
  1960. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight)) this._cacheDirty = !this._makeBitmapCache();
  1961. if (null == this._texture_to_render) return !1;
  1962. var e = this._texture_to_render,
  1963. b = e._offsetX,
  1964. d = e._offsetY,
  1965. f = e._textureWidth,
  1966. e = e._textureHeight;
  1967. this._updateTransform();
  1968. a.setAlpha(this.worldAlpha, this.blendMode);
  1969. a.setTransform(this._worldTransform);
  1970. var g = c.MainContext.instance.rendererContext.texture_scale_factor;
  1971. c.RenderFilter.getInstance().drawImage(a, this, 0, 0, f * g, e * g, b, d, f, e);
  1972. return !0
  1973. };
  1974. b.prototype._updateTransform = function() {
  1975. this._calculateWorldTransform()
  1976. };
  1977. b.prototype._calculateWorldTransform = function() {
  1978. var a = this._worldTransform,
  1979. e = this._parent;
  1980. a.identityMatrix(e._worldTransform);
  1981. this._getMatrix(a);
  1982. var b = this._scrollRect;
  1983. b && a.append(1, 0, 0, 1, -b.x, -b.y);
  1984. this.worldAlpha = e.worldAlpha * this._alpha
  1985. };
  1986. b.prototype._render = function(a) {};
  1987. b.prototype.getBounds =
  1988. function(a, e) {
  1989. void 0 === e && (e = !0);
  1990. var b = this._measureBounds(),
  1991. d = this._hasWidthSet ? this._explicitWidth : b.width,
  1992. f = this._hasHeightSet ? this._explicitHeight : b.height;
  1993. this._rectW = b.width;
  1994. this._rectH = b.height;
  1995. this._clearSizeDirty();
  1996. var g = b.x,
  1997. b = b.y,
  1998. h = 0,
  1999. m = 0;
  2000. e && (0 != this._anchorX || 0 != this._anchorY ? (h = d * this._anchorX, m = f * this._anchorY) : (h = this._anchorOffsetX, m = this._anchorOffsetY));
  2001. this._cacheBounds.initialize(g - h, b - m, d, f);
  2002. d = this._cacheBounds;
  2003. a || (a = new c.Rectangle);
  2004. return a.initialize(d.x, d.y, d.width, d.height)
  2005. };
  2006. b.prototype.destroyCacheBounds = function() {
  2007. this._cacheBounds.x = 0;
  2008. this._cacheBounds.y = 0;
  2009. this._cacheBounds.width = 0;
  2010. this._cacheBounds.height = 0
  2011. };
  2012. b.prototype._getConcatenatedMatrix = function() {
  2013. for (var a = b.identityMatrixForGetConcatenated.identity(), e = this; null != e;) {
  2014. if (0 != e._anchorX || 0 != e._anchorY) {
  2015. var l = e._getSize(c.Rectangle.identity);
  2016. a.prependTransform(e._x, e._y, e._scaleX, e._scaleY, e._rotation, e._skewX, e._skewY, l.width * e._anchorX, l.height * e._anchorY)
  2017. } else a.prependTransform(e._x, e._y, e._scaleX, e._scaleY,
  2018. e._rotation, e._skewX, e._skewY, e._anchorOffsetX, e._anchorOffsetY);
  2019. e = e._parent
  2020. }
  2021. return a
  2022. };
  2023. b.prototype.localToGlobal = function(a, e, b) {
  2024. void 0 === a && (a = 0);
  2025. void 0 === e && (e = 0);
  2026. var d = this._getConcatenatedMatrix();
  2027. d.append(1, 0, 0, 1, a, e);
  2028. b || (b = new c.Point);
  2029. b.x = d.tx;
  2030. b.y = d.ty;
  2031. return b
  2032. };
  2033. b.prototype.globalToLocal = function(a, e, b) {
  2034. void 0 === a && (a = 0);
  2035. void 0 === e && (e = 0);
  2036. var d = this._getConcatenatedMatrix();
  2037. d.invert();
  2038. d.append(1, 0, 0, 1, a, e);
  2039. b || (b = new c.Point);
  2040. b.x = d.tx;
  2041. b.y = d.ty;
  2042. return b
  2043. };
  2044. b.prototype.hitTest = function(a, e, b) {
  2045. void 0 ===
  2046. b && (b = !1);
  2047. if (!this._visible || !b && !this._touchEnabled) return null;
  2048. b = this._getSize(c.Rectangle.identity);
  2049. return 0 <= a && a < b.width && 0 <= e && e < b.height ? this.mask || this._scrollRect ? this._scrollRect && a > this._scrollRect.x && e > this._scrollRect.y && a < this._scrollRect.x + this._scrollRect.width && e < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= a && a < this.mask.x + this.mask.width && this.mask.y <= e && e < this.mask.y + this.mask.height ? this : null : this : null
  2050. };
  2051. b.prototype.hitTestPoint = function(a, e, b) {
  2052. a = this.globalToLocal(a,
  2053. e);
  2054. return b ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), b = this._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(a.x - this._hitTestPointTexture._offsetX, a.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(a.x, a.y, !0)
  2055. };
  2056. b.prototype._getMatrix = function(a) {
  2057. a || (a = c.Matrix.identity.identity());
  2058. var e, b;
  2059. b = this._getOffsetPoint();
  2060. e = b.x;
  2061. b = b.y;
  2062. var d = this.__hack_local_matrix;
  2063. d ? (a.append(d.a, d.b, d.c, d.d, d.tx, d.ty), a.append(1, 0, 0, 1, -e, -b)) : a.appendTransform(this._x,
  2064. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, e, b);
  2065. return a
  2066. };
  2067. b.prototype._getSize = function(a) {
  2068. return this._hasHeightSet && this._hasWidthSet ? a.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(a)
  2069. };
  2070. b.prototype._measureSize = function(a) {
  2071. this._sizeDirty ? (a = this._measureBounds(), this._rectW = a.width, this._rectH = a.height, this._clearSizeDirty()) : (a.width = this._rectW, a.height = this._rectH);
  2072. a.x = 0;
  2073. a.y = 0;
  2074. return a
  2075. };
  2076. b.prototype._measureBounds = function() {
  2077. return c.Rectangle.identity.initialize(0,
  2078. 0, 0, 0)
  2079. };
  2080. b.prototype._getOffsetPoint = function() {
  2081. var a = this._anchorOffsetX,
  2082. e = this._anchorOffsetY;
  2083. if (0 != this._anchorX || 0 != this._anchorY) e = this._getSize(c.Rectangle.identity), a = this._anchorX * e.width, e = this._anchorY * e.height;
  2084. var b = c.Point.identity;
  2085. b.x = a;
  2086. b.y = e;
  2087. return b
  2088. };
  2089. b.prototype._onAddToStage = function() {
  2090. this._stage = c.MainContext.instance.stage;
  2091. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2092. };
  2093. b.prototype._onRemoveFromStage = function() {
  2094. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2095. };
  2096. Object.defineProperty(b.prototype, "stage", {
  2097. get: function() {
  2098. return this._stage
  2099. },
  2100. enumerable: !0,
  2101. configurable: !0
  2102. });
  2103. b.prototype.addEventListener = function(a, e, l, q, n) {
  2104. void 0 === q && (q = !1);
  2105. void 0 === n && (n = 0);
  2106. d.prototype.addEventListener.call(this, a, e, l, q, n);
  2107. ((q = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._insertEventBin(q ? b._enterFrameCallBackList : b._renderCallBackList, e, l, n, this)
  2108. };
  2109. b.prototype.removeEventListener = function(a, e, l, q) {
  2110. void 0 === q && (q = !1);
  2111. d.prototype.removeEventListener.call(this, a, e, l, q);
  2112. ((q =
  2113. a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._removeEventBin(q ? b._enterFrameCallBackList : b._renderCallBackList, e, l, this)
  2114. };
  2115. b.prototype.dispatchEvent = function(a) {
  2116. if (!a._bubbles) return d.prototype.dispatchEvent.call(this, a);
  2117. for (var e = [], b = this; b;) e.push(b), b = b._parent;
  2118. a._reset();
  2119. this._dispatchPropagationEvent(a, e);
  2120. return !a._isDefaultPrevented
  2121. };
  2122. b.prototype._dispatchPropagationEvent = function(a, e, b) {
  2123. b = e.length;
  2124. for (var c = 1, d = b - 1; 0 <= d; d--) {
  2125. var f = e[d];
  2126. a._currentTarget = f;
  2127. a._target = this;
  2128. a._eventPhase = c;
  2129. f._notifyListener(a);
  2130. if (a._isPropagationStopped || a._isPropagationImmediateStopped) return
  2131. }
  2132. f = e[0];
  2133. a._currentTarget = f;
  2134. a._target = this;
  2135. a._eventPhase = 2;
  2136. f._notifyListener(a);
  2137. if (!a._isPropagationStopped && !a._isPropagationImmediateStopped)
  2138. for (c = 3, d = 1; d < b && (f = e[d], a._currentTarget = f, a._target = this, a._eventPhase = c, f._notifyListener(a), !a._isPropagationStopped && !a._isPropagationImmediateStopped); d++);
  2139. };
  2140. b.prototype.willTrigger = function(a) {
  2141. for (var e = this; e;) {
  2142. if (e.hasEventListener(a)) return !0;
  2143. e = e._parent
  2144. }
  2145. return !1
  2146. };
  2147. Object.defineProperty(b.prototype, "cacheAsBitmap", {
  2148. get: function() {
  2149. return this._cacheAsBitmap
  2150. },
  2151. set: function(a) {
  2152. (this._cacheAsBitmap = a) ? c.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2153. },
  2154. enumerable: !0,
  2155. configurable: !0
  2156. });
  2157. b.prototype._makeBitmapCache = function() {
  2158. this.renderTexture || (this.renderTexture = new c.RenderTexture);
  2159. var a = this.renderTexture.drawToTexture(this);
  2160. this._texture_to_render = a ? this.renderTexture : null;
  2161. return a
  2162. };
  2163. b.prototype._setCacheDirty = function(a) {
  2164. void 0 === a && (a = !0);
  2165. this._cacheDirty =
  2166. a
  2167. };
  2168. b.getTransformBounds = function(a, e) {
  2169. var b = a.x,
  2170. c = a.y,
  2171. d = a.width,
  2172. f = a.height;
  2173. (b || c) && e.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2174. var h = d * e.a,
  2175. d = d * e.b,
  2176. m = f * e.c,
  2177. f = f * e.d,
  2178. k = e.tx,
  2179. p = e.ty,
  2180. r = k,
  2181. s = k,
  2182. t = p,
  2183. v = p;
  2184. (b = h + k) < r ? r = b : b > s && (s = b);
  2185. (b = h + m + k) < r ? r = b : b > s && (s = b);
  2186. (b = m + k) < r ? r = b : b > s && (s = b);
  2187. (c = d + p) < t ? t = c : c > v && (v = c);
  2188. (c = d + f + p) < t ? t = c : c > v && (v = c);
  2189. (c = f + p) < t ? t = c : c > v && (v = c);
  2190. return a.initialize(r, t, s - r, v - t)
  2191. };
  2192. Object.defineProperty(b.prototype, "colorTransform", {
  2193. get: function() {
  2194. return this._colorTransform
  2195. },
  2196. set: function(a) {
  2197. this._colorTransform =
  2198. a
  2199. },
  2200. enumerable: !0,
  2201. configurable: !0
  2202. });
  2203. b.identityMatrixForGetConcatenated = new c.Matrix;
  2204. b._enterFrameCallBackList = [];
  2205. b._renderCallBackList = [];
  2206. return b
  2207. }(c.EventDispatcher);
  2208. c.DisplayObject = d;
  2209. d.prototype.__class__ = "egret.DisplayObject";
  2210. d = function() {
  2211. function c() {
  2212. this.matrix = null
  2213. }
  2214. c.prototype.updateColor = function(b, a, e, c, d, f, g, h) {};
  2215. return c
  2216. }();
  2217. c.ColorTransform = d;
  2218. d.prototype.__class__ = "egret.ColorTransform"
  2219. })(egret || (egret = {}));
  2220. __extends = this.__extends || function(c, d) {
  2221. function f() {
  2222. this.constructor = c
  2223. }
  2224. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  2225. f.prototype = d.prototype;
  2226. c.prototype = new f
  2227. };
  2228. (function(c) {
  2229. var d = function(d) {
  2230. function b() {
  2231. d.call(this);
  2232. this._touchChildren = !0;
  2233. this._children = []
  2234. }
  2235. __extends(b, d);
  2236. Object.defineProperty(b.prototype, "touchChildren", {
  2237. get: function() {
  2238. return this._touchChildren
  2239. },
  2240. set: function(a) {
  2241. this._touchChildren = a
  2242. },
  2243. enumerable: !0,
  2244. configurable: !0
  2245. });
  2246. Object.defineProperty(b.prototype, "numChildren", {
  2247. get: function() {
  2248. return this._children.length
  2249. },
  2250. enumerable: !0,
  2251. configurable: !0
  2252. });
  2253. b.prototype.setChildIndex = function(a, e) {
  2254. this.doSetChildIndex(a, e)
  2255. };
  2256. b.prototype.doSetChildIndex = function(a,
  2257. e) {
  2258. var b = this._children.indexOf(a);
  2259. 0 > b && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2260. this._children.splice(b, 1);
  2261. 0 > e || this._children.length <= e ? this._children.push(a) : this._children.splice(e, 0, a)
  2262. };
  2263. b.prototype.addChild = function(a) {
  2264. var e = this._children.length;
  2265. a._parent == this && e--;
  2266. return this._doAddChild(a, e)
  2267. };
  2268. b.prototype.addChildAt = function(a, e) {
  2269. return this._doAddChild(a, e)
  2270. };
  2271. b.prototype._doAddChild = function(a, e, l) {
  2272. void 0 === l && (l = !0);
  2273. if (a == this) return a;
  2274. if (0 > e || e > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2275. a;
  2276. var d = a._parent;
  2277. if (d == this) return this.doSetChildIndex(a, e), a;
  2278. d && (e = d._children.indexOf(a), 0 <= e && d._doRemoveChild(e));
  2279. this._children.splice(e, 0, a);
  2280. a._parentChanged(this);
  2281. l && a.dispatchEventWith(c.Event.ADDED, !0);
  2282. if (this._stage)
  2283. for (a._onAddToStage(), e = b.__EVENT__ADD_TO_STAGE_LIST; 0 < e.length;) e.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  2284. a._setDirty();
  2285. this._setSizeDirty();
  2286. return a
  2287. };
  2288. b.prototype.removeChild = function(a) {
  2289. a = this._children.indexOf(a);
  2290. if (0 <= a) return this._doRemoveChild(a);
  2291. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2292. return null
  2293. };
  2294. b.prototype.removeChildAt = function(a) {
  2295. if (0 <= a && a < this._children.length) return this._doRemoveChild(a);
  2296. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2297. return null
  2298. };
  2299. b.prototype._doRemoveChild = function(a, e) {
  2300. void 0 === e && (e = !0);
  2301. var l = this._children,
  2302. d = l[a];
  2303. e && d.dispatchEventWith(c.Event.REMOVED, !0);
  2304. if (this._stage) {
  2305. d._onRemoveFromStage();
  2306. for (var f = b.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) {
  2307. var g = f.shift();
  2308. g.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
  2309. g._stage = null
  2310. }
  2311. }
  2312. d._parentChanged(null);
  2313. l.splice(a, 1);
  2314. this._setSizeDirty();
  2315. return d
  2316. };
  2317. b.prototype.getChildAt = function(a) {
  2318. if (0 <= a && a < this._children.length) return this._children[a];
  2319. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2320. return null
  2321. };
  2322. b.prototype.contains = function(a) {
  2323. for (; a;) {
  2324. if (a == this) return !0;
  2325. a = a._parent
  2326. }
  2327. return !1
  2328. };
  2329. b.prototype.swapChildrenAt = function(a, e) {
  2330. 0 <= a && a < this._children.length && 0 <= e && e < this._children.length ? this._swapChildrenAt(a, e) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2331. };
  2332. b.prototype.swapChildren = function(a, e) {
  2333. var b = this._children.indexOf(a),
  2334. d = this._children.indexOf(e); - 1 == b || -1 == d ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(b, d)
  2335. };
  2336. b.prototype._swapChildrenAt = function(a, e) {
  2337. if (a != e) {
  2338. var b = this._children,
  2339. c = b[a];
  2340. b[a] = b[e];
  2341. b[e] = c
  2342. }
  2343. };
  2344. b.prototype.getChildIndex = function(a) {
  2345. return this._children.indexOf(a)
  2346. };
  2347. b.prototype.removeChildren = function() {
  2348. for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
  2349. };
  2350. b.prototype._updateTransform =
  2351. function() {
  2352. if (this._visible) {
  2353. d.prototype._updateTransform.call(this);
  2354. for (var a = 0, e = this._children.length; a < e; a++) this._children[a]._updateTransform()
  2355. }
  2356. };
  2357. b.prototype._render = function(a) {
  2358. for (var e = 0, b = this._children.length; e < b; e++) this._children[e]._draw(a)
  2359. };
  2360. b.prototype._measureBounds = function() {
  2361. for (var a = 0, e = 0, b = 0, d = 0, f = this._children.length, g = 0; g < f; g++) {
  2362. var h = this._children[g];
  2363. if (h._visible) {
  2364. var m = h.getBounds(c.Rectangle.identity, !1),
  2365. k = m.x,
  2366. p = m.y,
  2367. r = m.width,
  2368. m = m.height,
  2369. h = h._getMatrix(),
  2370. h = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(k,
  2371. p, r, m), h),
  2372. k = h.x,
  2373. p = h.y,
  2374. r = h.width + h.x,
  2375. h = h.height + h.y;
  2376. if (k < a || 0 == g) a = k;
  2377. if (r > e || 0 == g) e = r;
  2378. if (p < b || 0 == g) b = p;
  2379. if (h > d || 0 == g) d = h
  2380. }
  2381. }
  2382. return c.Rectangle.identity.initialize(a, b, e - a, d - b)
  2383. };
  2384. b.prototype.hitTest = function(a, e, b) {
  2385. void 0 === b && (b = !1);
  2386. var q;
  2387. if (!this._visible) return null;
  2388. if (this._scrollRect) {
  2389. if (a < this._scrollRect.x || e < this._scrollRect.y || a > this._scrollRect.x + this._scrollRect.width || e > this._scrollRect.y + this._scrollRect.height) return null
  2390. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y >
  2391. e || e > this.mask.y + this.mask.height)) return null;
  2392. for (var n = this._children, g = this._touchChildren, h = n.length - 1; 0 <= h; h--) {
  2393. var m = n[h],
  2394. k = m._getMatrix(),
  2395. p = m._scrollRect;
  2396. p && k.append(1, 0, 0, 1, -p.x, -p.y);
  2397. k.invert();
  2398. k = c.Matrix.transformCoords(k, a, e);
  2399. if (m = m.hitTest(k.x, k.y, !0)) {
  2400. if (!g) return this;
  2401. if (m._touchEnabled && g) return m;
  2402. q = this
  2403. }
  2404. }
  2405. return q ? q : this._texture_to_render || this.graphics ? d.prototype.hitTest.call(this, a, e, b) : null
  2406. };
  2407. b.prototype._onAddToStage = function() {
  2408. d.prototype._onAddToStage.call(this);
  2409. for (var a = this._children.length,
  2410. e = 0; e < a; e++) this._children[e]._onAddToStage()
  2411. };
  2412. b.prototype._onRemoveFromStage = function() {
  2413. d.prototype._onRemoveFromStage.call(this);
  2414. for (var a = this._children.length, e = 0; e < a; e++) this._children[e]._onRemoveFromStage()
  2415. };
  2416. b.prototype.getChildByName = function(a) {
  2417. for (var e = this._children, b = e.length, c, d = 0; d < b; d++)
  2418. if (c = e[d], c.name == a) return c;
  2419. return null
  2420. };
  2421. b.__EVENT__ADD_TO_STAGE_LIST = [];
  2422. b.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2423. return b
  2424. }(c.DisplayObject);
  2425. c.DisplayObjectContainer = d;
  2426. d.prototype.__class__ = "egret.DisplayObjectContainer"
  2427. })(egret ||
  2428. (egret = {}));
  2429. __extends = this.__extends || function(c, d) {
  2430. function f() {
  2431. this.constructor = c
  2432. }
  2433. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  2434. f.prototype = d.prototype;
  2435. c.prototype = new f
  2436. };
  2437. (function(c) {
  2438. var d = function(d) {
  2439. function b(a, e) {
  2440. void 0 === a && (a = 480);
  2441. void 0 === e && (e = 800);
  2442. d.call(this);
  2443. this.touchEnabled = !0;
  2444. this._stage = this;
  2445. this._stageWidth = a;
  2446. this._stageHeight = e
  2447. }
  2448. __extends(b, d);
  2449. b.prototype.invalidate = function() {
  2450. b._invalidateRenderFlag = !0
  2451. };
  2452. Object.defineProperty(b.prototype, "scaleMode", {
  2453. get: function() {
  2454. return this._scaleMode
  2455. },
  2456. set: function(a) {
  2457. this._scaleMode != a && (this._scaleMode = a, this.setResolutionPolicy())
  2458. },
  2459. enumerable: !0,
  2460. configurable: !0
  2461. });
  2462. b.prototype.changeSize = function() {
  2463. this.setResolutionPolicy();
  2464. this.dispatchEventWith(c.Event.RESIZE)
  2465. };
  2466. b.prototype.setResolutionPolicy = function() {
  2467. var a = {};
  2468. a[c.StageScaleMode.NO_SCALE] = new c.NoScale;
  2469. a[c.StageScaleMode.SHOW_ALL] = new c.ShowAll;
  2470. a[c.StageScaleMode.NO_BORDER] = new c.FixedWidth;
  2471. a[c.StageScaleMode.EXACT_FIT] = new c.FullScreen;
  2472. a = a[this._scaleMode];
  2473. if (!a) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2474. var e = new c.EqualToFrame,
  2475. a = new c.ResolutionPolicy(e, a);
  2476. c.StageDelegate.getInstance()._setResolutionPolicy(a);
  2477. this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
  2478. this._stageHeight = c.StageDelegate.getInstance()._stageHeight
  2479. };
  2480. Object.defineProperty(b.prototype, "stageWidth", {
  2481. get: function() {
  2482. return this._stageWidth
  2483. },
  2484. enumerable: !0,
  2485. configurable: !0
  2486. });
  2487. Object.defineProperty(b.prototype, "stageHeight", {
  2488. get: function() {
  2489. return this._stageHeight
  2490. },
  2491. enumerable: !0,
  2492. configurable: !0
  2493. });
  2494. b.prototype.hitTest = function(a, e, b) {
  2495. if (!this._touchEnabled) return null;
  2496. var d;
  2497. if (!this._touchChildren) return this;
  2498. b = this._children;
  2499. for (var f = b.length - 1; 0 <= f; f--) {
  2500. d = b[f];
  2501. var g = d._getMatrix(),
  2502. h = d._scrollRect;
  2503. h && g.append(1, 0, 0, 1, -h.x, -h.y);
  2504. g.invert();
  2505. g = c.Matrix.transformCoords(g, a, e);
  2506. if ((d = d.hitTest(g.x, g.y, !0)) && d._touchEnabled) return d
  2507. }
  2508. return this
  2509. };
  2510. b.prototype.getBounds = function(a) {
  2511. a || (a = new c.Rectangle);
  2512. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2513. };
  2514. b.prototype._updateTransform = function() {
  2515. for (var a = 0, e = this._children.length; a < e; a++) this._children[a]._updateTransform()
  2516. };
  2517. Object.defineProperty(b.prototype, "focus", {
  2518. get: function() {
  2519. return null
  2520. },
  2521. enumerable: !0,
  2522. configurable: !0
  2523. });
  2524. b._invalidateRenderFlag = !1;
  2525. return b
  2526. }(c.DisplayObjectContainer);
  2527. c.Stage = d;
  2528. d.prototype.__class__ = "egret.Stage"
  2529. })(egret || (egret = {}));
  2530. (function(c) {
  2531. var d = function() {
  2532. function c() {}
  2533. c.NO_BORDER = "noBorder";
  2534. c.NO_SCALE = "noScale";
  2535. c.SHOW_ALL = "showAll";
  2536. c.EXACT_FIT = "exactFit";
  2537. return c
  2538. }();
  2539. c.StageScaleMode = d;
  2540. d.prototype.__class__ = "egret.StageScaleMode"
  2541. })(egret || (egret = {}));
  2542. __extends = this.__extends || function(c, d) {
  2543. function f() {
  2544. this.constructor = c
  2545. }
  2546. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  2547. f.prototype = d.prototype;
  2548. c.prototype = new f
  2549. };
  2550. (function(c) {
  2551. var d = function(d) {
  2552. function b(a) {
  2553. void 0 === a && (a = null);
  2554. d.call(this);
  2555. this._lastTouchPosition = new c.Point(0, 0);
  2556. this._lastTouchTime = 0;
  2557. this._lastTouchEvent = null;
  2558. this._velocitys = [];
  2559. this._content = null;
  2560. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2561. this._scrollTop = this._scrollLeft = 0;
  2562. this._vCanScroll = this._hCanScroll = !1;
  2563. this.touchEnabled = !0;
  2564. a && this.setContent(a)
  2565. }
  2566. __extends(b, d);
  2567. b.prototype.setContent = function(a) {
  2568. this._content && (this._removeEvents(), d.prototype.removeChildAt.call(this,
  2569. 0));
  2570. this._content = a;
  2571. d.prototype.addChild.call(this, a);
  2572. this._addEvents();
  2573. this._explicitWidth || this._getContentWidth();
  2574. this._explicitHeight || this._getContentHeight()
  2575. };
  2576. Object.defineProperty(b.prototype, "verticalScrollPolicy", {
  2577. get: function() {
  2578. return this._verticalScrollPolicy
  2579. },
  2580. set: function(a) {
  2581. a != this._verticalScrollPolicy && (this._verticalScrollPolicy = a)
  2582. },
  2583. enumerable: !0,
  2584. configurable: !0
  2585. });
  2586. Object.defineProperty(b.prototype, "horizontalScrollPolicy", {
  2587. get: function() {
  2588. return this._horizontalScrollPolicy
  2589. },
  2590. set: function(a) {
  2591. a !=
  2592. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = a)
  2593. },
  2594. enumerable: !0,
  2595. configurable: !0
  2596. });
  2597. Object.defineProperty(b.prototype, "scrollLeft", {
  2598. get: function() {
  2599. return this._scrollLeft
  2600. },
  2601. set: function(a) {
  2602. a != this._scrollLeft && (this._scrollLeft = a, this._validatePosition(!1, !0), this._updateContentPosition())
  2603. },
  2604. enumerable: !0,
  2605. configurable: !0
  2606. });
  2607. Object.defineProperty(b.prototype, "scrollTop", {
  2608. get: function() {
  2609. return this._scrollTop
  2610. },
  2611. set: function(a) {
  2612. a != this._scrollTop && (this._scrollTop = a, this._validatePosition(!0, !1), this._updateContentPosition())
  2613. },
  2614. enumerable: !0,
  2615. configurable: !0
  2616. });
  2617. b.prototype.setScrollPosition = function(a, e, b) {
  2618. void 0 === b && (b = !1);
  2619. if (!b || 0 != a || 0 != e)
  2620. if (b || this._scrollTop != a || this._scrollLeft != e) {
  2621. if (b) {
  2622. b = this._isOnTheEdge(!0);
  2623. var c = this._isOnTheEdge(!1);
  2624. this._scrollTop += b ? a / 2 : a;
  2625. this._scrollLeft += c ? e / 2 : e
  2626. } else this._scrollTop = a, this._scrollLeft = e;
  2627. this._validatePosition(!0, !0);
  2628. this._updateContentPosition()
  2629. }
  2630. };
  2631. b.prototype._isOnTheEdge = function(a) {
  2632. void 0 === a && (a = !0);
  2633. var e = this._scrollTop,
  2634. b = this._scrollLeft;
  2635. return a ? 0 > e || e > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2636. };
  2637. b.prototype._validatePosition = function(a, e) {
  2638. void 0 === a && (a = !1);
  2639. void 0 === e && (e = !1);
  2640. if (a) {
  2641. var b = this.height,
  2642. c = this._getContentHeight();
  2643. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2644. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : c / 2)
  2645. }
  2646. e && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : c / 2))
  2647. };
  2648. b.prototype._setWidth = function(a) {
  2649. this._explicitWidth !=
  2650. a && (d.prototype._setWidth.call(this, a), this._updateContentPosition())
  2651. };
  2652. b.prototype._setHeight = function(a) {
  2653. this._explicitHeight != a && (d.prototype._setHeight.call(this, a), this._updateContentPosition())
  2654. };
  2655. b.prototype._updateContentPosition = function() {
  2656. var a = this.getBounds(c.Rectangle.identity);
  2657. this.scrollRect = new c.Rectangle(this._scrollLeft, this._scrollTop, a.width, a.height);
  2658. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  2659. };
  2660. b.prototype._checkScrollPolicy = function() {
  2661. var a = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2662. this._getContentWidth(), this.width);
  2663. this._hCanScroll = a;
  2664. var e = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2665. this._vCanScroll = e;
  2666. return a || e
  2667. };
  2668. b.prototype.__checkScrollPolicy = function(a, e, b) {
  2669. return "on" == a ? !0 : "off" == a ? !1 : e > b
  2670. };
  2671. b.prototype._addEvents = function() {
  2672. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2673. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2674. this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2675. this, !0)
  2676. };
  2677. b.prototype._removeEvents = function() {
  2678. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2679. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2680. this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2681. };
  2682. b.prototype._onTouchBegin = function(a) {
  2683. a._isDefaultPrevented || (c.Tween.removeTweens(this), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END,
  2684. 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())
  2685. };
  2686. b.prototype._onTouchBeginCapture = function(a) {
  2687. var e = this._checkScrollPolicy();
  2688. if (e) {
  2689. for (var l = a.target; l != this;) {
  2690. if (l instanceof b && (e = l._checkScrollPolicy())) return;
  2691. l = l.parent
  2692. }
  2693. a.stopPropagation();
  2694. this.delayTouchBeginEvent = this.cloneTouchEvent(a);
  2695. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100,
  2696. 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2697. this.touchBeginTimer.start();
  2698. this._onTouchBegin(a)
  2699. }
  2700. };
  2701. b.prototype._onTouchEndCapture = function(a) {
  2702. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2703. };
  2704. b.prototype._onTouchBeginTimer = function() {
  2705. this.touchBeginTimer.stop();
  2706. var a = this.delayTouchBeginEvent;
  2707. this.delayTouchBeginEvent = null;
  2708. this.dispatchPropagationEvent(a)
  2709. };
  2710. b.prototype.dispatchPropagationEvent = function(a) {
  2711. for (var e = [], b = a._target; b;) e.push(b),
  2712. b = b.parent;
  2713. for (var c = this._content, d = 1;; d += 2) {
  2714. b = e[d];
  2715. if (!b || b === c) break;
  2716. e.unshift(b)
  2717. }
  2718. this._dispatchPropagationEvent(a, e)
  2719. };
  2720. b.prototype._dispatchPropagationEvent = function(a, e, b) {
  2721. for (var c = e.length, d = 0; d < c; d++) {
  2722. var f = e[d];
  2723. a._currentTarget = f;
  2724. a._target = this;
  2725. a._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  2726. f._notifyListener(a);
  2727. if (a._isPropagationStopped || a._isPropagationImmediateStopped) break
  2728. }
  2729. };
  2730. b.prototype._onTouchMove = function(a) {
  2731. if (this._lastTouchPosition.x != a.stageX || this._lastTouchPosition.y != a.stageY) {
  2732. this.delayTouchBeginEvent &&
  2733. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2734. this.touchChildren = !1;
  2735. var e = this._getPointChange(a);
  2736. this.setScrollPosition(e.y, e.x, !0);
  2737. this._calcVelocitys(a);
  2738. this._logTouchEvent(a)
  2739. }
  2740. };
  2741. b.prototype._onTouchEnd = function(a) {
  2742. this.touchChildren = !0;
  2743. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2744. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2745. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE,
  2746. this._onTouchEnd, this);
  2747. this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
  2748. this._moveAfterTouchEnd()
  2749. };
  2750. b.prototype._onEnterFrame = function(a) {
  2751. a = c.getTimer();
  2752. 100 < a - this._lastTouchTime && 300 > a - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2753. };
  2754. b.prototype._logTouchEvent = function(a) {
  2755. this._lastTouchPosition.x = a.stageX;
  2756. this._lastTouchPosition.y = a.stageY;
  2757. this._lastTouchEvent = this.cloneTouchEvent(a);
  2758. this._lastTouchTime = c.getTimer()
  2759. };
  2760. b.prototype._getPointChange = function(a) {
  2761. return {
  2762. x: !1 ===
  2763. this._hCanScroll ? 0 : this._lastTouchPosition.x - a.stageX,
  2764. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - a.stageY
  2765. }
  2766. };
  2767. b.prototype._calcVelocitys = function(a) {
  2768. var e = c.getTimer();
  2769. if (0 == this._lastTouchTime) this._lastTouchTime = e;
  2770. else {
  2771. var b = this._getPointChange(a),
  2772. e = e - this._lastTouchTime;
  2773. b.x /= e;
  2774. b.y /= e;
  2775. this._velocitys.push(b);
  2776. 5 < this._velocitys.length && this._velocitys.shift();
  2777. this._lastTouchPosition.x = a.stageX;
  2778. this._lastTouchPosition.y = a.stageY
  2779. }
  2780. };
  2781. b.prototype._getContentWidth = function() {
  2782. return this._content.explicitWidth ||
  2783. this._content.width
  2784. };
  2785. b.prototype._getContentHeight = function() {
  2786. return this._content.explicitHeight || this._content.height
  2787. };
  2788. b.prototype.getMaxScrollLeft = function() {
  2789. var a = this._getContentWidth() - this.width;
  2790. return Math.max(0, a)
  2791. };
  2792. b.prototype.getMaxScrollTop = function() {
  2793. var a = this._getContentHeight() - this.height;
  2794. return Math.max(0, a)
  2795. };
  2796. b.prototype._moveAfterTouchEnd = function() {
  2797. if (0 != this._velocitys.length) {
  2798. for (var a = 0, e = 0, c = 0, d = 0; d < this._velocitys.length; d++) var f = this._velocitys[d],
  2799. g = b.weight[d],
  2800. a = a + f.x * g,
  2801. e = e + f.y * g,
  2802. c = c + g;
  2803. this._velocitys.length = 0;
  2804. a /= c;
  2805. e /= c;
  2806. f = Math.abs(a);
  2807. c = Math.abs(e);
  2808. g = this.getMaxScrollLeft();
  2809. d = this.getMaxScrollTop();
  2810. a = 0.02 < f ? this.getAnimationDatas(a, this._scrollLeft, g) : {
  2811. position: this._scrollLeft,
  2812. duration: 1
  2813. };
  2814. e = 0.02 < c ? this.getAnimationDatas(e, this._scrollTop, d) : {
  2815. position: this._scrollTop,
  2816. duration: 1
  2817. };
  2818. this.setScrollLeft(a.position, a.duration);
  2819. this.setScrollTop(e.position, e.duration)
  2820. }
  2821. };
  2822. b.prototype.setScrollTop = function(a, e) {
  2823. void 0 === e && (e = 0);
  2824. var b = Math.min(this.getMaxScrollTop(), Math.max(a,
  2825. 0));
  2826. if (0 == e) return this.scrollTop = b, null;
  2827. var d = c.Tween.get(this).to({
  2828. scrollTop: a
  2829. }, e, c.Ease.quartOut);
  2830. b != a && d.to({
  2831. scrollTop: b
  2832. }, 300, c.Ease.quintOut)
  2833. };
  2834. b.prototype.setScrollLeft = function(a, e) {
  2835. void 0 === e && (e = 0);
  2836. var b = Math.min(this.getMaxScrollLeft(), Math.max(a, 0));
  2837. if (0 == e) return this.scrollLeft = b, null;
  2838. var d = c.Tween.get(this).to({
  2839. scrollLeft: a
  2840. }, e, c.Ease.quartOut);
  2841. b != a && d.to({
  2842. scrollLeft: b
  2843. }, 300, c.Ease.quintOut)
  2844. };
  2845. b.prototype.getAnimationDatas = function(a, e, b) {
  2846. var c = Math.abs(a),
  2847. d = 0,
  2848. f = e + 500 * a;
  2849. if (0 > f || f > b)
  2850. for (f =
  2851. e; Infinity != Math.abs(a) && 0.02 < Math.abs(a);) f += a, a = 0 > f || f > b ? 0.998 * a * 0.95 : 0.998 * a, d++;
  2852. else d = 500 * -Math.log(0.02 / c);
  2853. return {
  2854. position: Math.min(b + 50, Math.max(f, -50)),
  2855. duration: d
  2856. }
  2857. };
  2858. b.prototype.cloneTouchEvent = function(a) {
  2859. var e = new c.TouchEvent(a._type, a._bubbles, a.cancelable);
  2860. e.touchPointID = a.touchPointID;
  2861. e._stageX = a._stageX;
  2862. e._stageY = a._stageY;
  2863. e.ctrlKey = a.ctrlKey;
  2864. e.altKey = a.altKey;
  2865. e.shiftKey = a.shiftKey;
  2866. e.touchDown = a.touchDown;
  2867. e._isDefaultPrevented = !1;
  2868. e._target = a._target;
  2869. return e
  2870. };
  2871. b.prototype.throwNotSupportedError =
  2872. function() {
  2873. throw Error("\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!");
  2874. };
  2875. b.prototype.addChild = function(a) {
  2876. this.throwNotSupportedError();
  2877. return null
  2878. };
  2879. b.prototype.addChildAt = function(a, e) {
  2880. this.throwNotSupportedError();
  2881. return null
  2882. };
  2883. b.prototype.removeChild = function(a) {
  2884. this.throwNotSupportedError();
  2885. return null
  2886. };
  2887. b.prototype.removeChildAt = function(a) {
  2888. this.throwNotSupportedError();
  2889. return null
  2890. };
  2891. b.prototype.setChildIndex = function(a, e) {
  2892. this.throwNotSupportedError()
  2893. };
  2894. b.prototype.swapChildren = function(a,
  2895. e) {
  2896. this.throwNotSupportedError()
  2897. };
  2898. b.prototype.swapChildrenAt = function(a, e) {
  2899. this.throwNotSupportedError()
  2900. };
  2901. b.weight = [1, 1.33, 1.66, 2, 2.33];
  2902. return b
  2903. }(c.DisplayObjectContainer);
  2904. c.ScrollView = d;
  2905. d.prototype.__class__ = "egret.ScrollView"
  2906. })(egret || (egret = {}));
  2907. __extends = this.__extends || function(c, d) {
  2908. function f() {
  2909. this.constructor = c
  2910. }
  2911. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  2912. f.prototype = d.prototype;
  2913. c.prototype = new f
  2914. };
  2915. (function(c) {
  2916. var d = function(d) {
  2917. function b(a, e, b) {
  2918. void 0 === e && (e = NaN);
  2919. void 0 === b && (b = NaN);
  2920. d.call(this, a);
  2921. this.content = a;
  2922. this.width = NaN == e ? this._getContentWidth() : e;
  2923. this.height = NaN == b ? this._getContentHeight() : b;
  2924. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView")
  2925. }
  2926. __extends(b, d);
  2927. Object.defineProperty(b.prototype, "scrollXEnabled", {
  2928. get: function() {
  2929. return "off" != this.horizontalScrollPolicy
  2930. },
  2931. set: function(a) {
  2932. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  2933. this.horizontalScrollPolicy = a ? "auto" : "off"
  2934. },
  2935. enumerable: !0,
  2936. configurable: !0
  2937. });
  2938. Object.defineProperty(b.prototype, "scrollYEnabled", {
  2939. get: function() {
  2940. return "off" != this.verticalScrollPolicy
  2941. },
  2942. set: function(a) {
  2943. c.Logger.warning("egret.Scroller\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.ScrollView");
  2944. this.verticalScrollPolicy = a ? "auto" : "off"
  2945. },
  2946. enumerable: !0,
  2947. configurable: !0
  2948. });
  2949. return b
  2950. }(c.ScrollView);
  2951. c.Scroller = d;
  2952. d.prototype.__class__ = "egret.Scroller"
  2953. })(egret || (egret = {}));
  2954. (function(c) {
  2955. var d = function() {
  2956. function c() {}
  2957. c.REPEAT = "repeat";
  2958. c.SCALE = "scale";
  2959. return c
  2960. }();
  2961. c.BitmapFillMode = d;
  2962. d.prototype.__class__ = "egret.BitmapFillMode"
  2963. })(egret || (egret = {}));
  2964. __extends = this.__extends || function(c, d) {
  2965. function f() {
  2966. this.constructor = c
  2967. }
  2968. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  2969. f.prototype = d.prototype;
  2970. c.prototype = new f
  2971. };
  2972. (function(c) {
  2973. var d = function(d) {
  2974. function b(a) {
  2975. d.call(this);
  2976. this.debug = !1;
  2977. this.debugColor = 16711680;
  2978. this.scale9Grid = null;
  2979. this.fillMode = "scale";
  2980. a && (this._texture = a, this._setSizeDirty())
  2981. }
  2982. __extends(b, d);
  2983. Object.defineProperty(b.prototype, "texture", {
  2984. get: function() {
  2985. return this._texture
  2986. },
  2987. set: function(a) {
  2988. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2989. },
  2990. enumerable: !0,
  2991. configurable: !0
  2992. });
  2993. b.prototype._render = function(a) {
  2994. var e = this._texture;
  2995. e ? (this._texture_to_render = e, b._drawBitmap(a, this._hasWidthSet ? this._explicitWidth :
  2996. e._textureWidth, this._hasHeightSet ? this._explicitHeight : e._textureHeight, this)) : this._texture_to_render = null
  2997. };
  2998. b._drawBitmap = function(a, e, c, d) {
  2999. var f = d._texture_to_render;
  3000. if (f) {
  3001. var g = f._textureWidth,
  3002. h = f._textureHeight;
  3003. if ("scale" == d.fillMode) {
  3004. var m = d.scale9Grid || f.scale9Grid;
  3005. if (m && g - m.width < e && h - m.height < c) b.drawScale9GridImage(a, d, m, e, c);
  3006. else {
  3007. var m = f._offsetX,
  3008. k = f._offsetY,
  3009. p = f._bitmapWidth || g,
  3010. r = f._bitmapHeight || h;
  3011. e /= g;
  3012. m = Math.round(m * e);
  3013. e = Math.round(p * e);
  3014. c /= h;
  3015. k = Math.round(k * c);
  3016. c = Math.round(r * c);
  3017. b.renderFilter.drawImage(a,
  3018. d, f._bitmapX, f._bitmapY, p, r, m, k, e, c)
  3019. }
  3020. } else b.drawRepeatImage(a, d, e, c, d.fillMode)
  3021. }
  3022. };
  3023. b.drawRepeatImage = function(a, e, b, d, f) {
  3024. var g = e._texture_to_render;
  3025. if (g) {
  3026. var h = g._textureWidth,
  3027. m = g._textureHeight,
  3028. k = g._bitmapX,
  3029. p = g._bitmapY,
  3030. h = g._bitmapWidth || h,
  3031. m = g._bitmapHeight || m,
  3032. r = g._offsetX,
  3033. g = g._offsetY;
  3034. c.RenderFilter.getInstance().drawImage(a, e, k, p, h, m, r, g, b, d, f)
  3035. }
  3036. };
  3037. b.drawScale9GridImage = function(a, e, b, d, f) {
  3038. var g = e._texture_to_render;
  3039. if (g && b) {
  3040. var h = c.RenderFilter.getInstance(),
  3041. m = g._textureWidth,
  3042. k = g._textureHeight,
  3043. p = g._bitmapX,
  3044. r = g._bitmapY,
  3045. s = g._bitmapWidth || m,
  3046. t = g._bitmapHeight || k,
  3047. v = g._offsetX,
  3048. g = g._offsetY;
  3049. b = c.Rectangle.identity.initialize(b.x - Math.round(v), b.y - Math.round(v), b.width, b.height);
  3050. v = Math.round(v);
  3051. g = Math.round(g);
  3052. d -= m - s;
  3053. f -= k - t;
  3054. b.y == b.bottom && (b.bottom < t ? b.bottom++ : b.y--);
  3055. b.x == b.right && (b.right < s ? b.right++ : b.x--);
  3056. var m = p + b.x,
  3057. k = p + b.right,
  3058. x = s - b.right,
  3059. A = r + b.y,
  3060. z = r + b.bottom,
  3061. y = t - b.bottom,
  3062. H = v + b.x,
  3063. L = g + b.y,
  3064. t = f - (t - b.bottom),
  3065. s = d - (s - b.right);
  3066. h.drawImage(a, e, p, r, b.x, b.y, v, g, b.x, b.y);
  3067. h.drawImage(a, e, m, r, b.width,
  3068. b.y, H, g, s - b.x, b.y);
  3069. h.drawImage(a, e, k, r, x, b.y, v + s, g, d - s, b.y);
  3070. h.drawImage(a, e, p, A, b.x, b.height, v, L, b.x, t - b.y);
  3071. h.drawImage(a, e, m, A, b.width, b.height, H, L, s - b.x, t - b.y);
  3072. h.drawImage(a, e, k, A, x, b.height, v + s, L, d - s, t - b.y);
  3073. h.drawImage(a, e, p, z, b.x, y, v, g + t, b.x, f - t);
  3074. h.drawImage(a, e, m, z, b.width, y, H, g + t, s - b.x, f - t);
  3075. h.drawImage(a, e, k, z, x, y, v + s, g + t, d - s, f - t)
  3076. }
  3077. };
  3078. b.prototype._measureBounds = function() {
  3079. var a = this._texture;
  3080. return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : d.prototype._measureBounds.call(this)
  3081. };
  3082. b.debug = !1;
  3083. b.renderFilter = c.RenderFilter.getInstance();
  3084. return b
  3085. }(c.DisplayObject);
  3086. c.Bitmap = d;
  3087. d.prototype.__class__ = "egret.Bitmap"
  3088. })(egret || (egret = {}));
  3089. __extends = this.__extends || function(c, d) {
  3090. function f() {
  3091. this.constructor = c
  3092. }
  3093. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3094. f.prototype = d.prototype;
  3095. c.prototype = new f
  3096. };
  3097. (function(c) {
  3098. var d = function(d) {
  3099. function b() {
  3100. d.call(this);
  3101. this._text = "";
  3102. this._textChanged = !1;
  3103. this._bitmapPool = []
  3104. }
  3105. __extends(b, d);
  3106. Object.defineProperty(b.prototype, "text", {
  3107. get: function() {
  3108. return this._text
  3109. },
  3110. set: function(a) {
  3111. this._textChanged = !0;
  3112. this._text = a;
  3113. this._setSizeDirty()
  3114. },
  3115. enumerable: !0,
  3116. configurable: !0
  3117. });
  3118. b.prototype._updateTransform = function() {
  3119. this.visible && (this._textChanged && this._renderText(), d.prototype._updateTransform.call(this))
  3120. };
  3121. b.prototype._renderText = function(a) {
  3122. var e = a = 0;
  3123. this._textChanged &&
  3124. this.removeChildren();
  3125. for (var b = 0, d = this.text.length; b < d; b++) {
  3126. var f = this.text.charAt(b),
  3127. g = this.spriteSheet.getTexture(f);
  3128. if (null == g) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + f);
  3129. else {
  3130. var f = g._offsetX,
  3131. h = g._offsetY,
  3132. m = g._textureWidth;
  3133. if (this._textChanged) {
  3134. var k = this._bitmapPool[b];
  3135. k || (k = new c.Bitmap, this._bitmapPool.push(k));
  3136. k.texture = g;
  3137. this.addChild(k);
  3138. k.x = a
  3139. }
  3140. a += m + f;
  3141. h + g._textureHeight > e && (e = h + g._textureHeight)
  3142. }
  3143. }
  3144. this._textChanged = !1;
  3145. return c.Rectangle.identity.initialize(0, 0,
  3146. a, e)
  3147. };
  3148. b.prototype._measureBounds = function() {
  3149. return this._renderText(!0)
  3150. };
  3151. return b
  3152. }(c.DisplayObjectContainer);
  3153. c.BitmapText = d;
  3154. d.prototype.__class__ = "egret.BitmapText"
  3155. })(egret || (egret = {}));
  3156. (function(c) {
  3157. var d = function() {
  3158. function c() {
  3159. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3160. this.commandQueue = []
  3161. }
  3162. c.prototype.beginFill = function(b, a) {};
  3163. c.prototype._setStyle = function(b) {};
  3164. c.prototype.drawRect = function(b, a, e, c) {
  3165. this.checkRect(b, a, e, c)
  3166. };
  3167. c.prototype.drawCircle = function(b, a, e) {
  3168. this.checkRect(b - e, a - e, 2 * e, 2 * e)
  3169. };
  3170. c.prototype.drawRoundRect = function(b, a, e, c, d, f) {
  3171. this.checkRect(b, a, e, c)
  3172. };
  3173. c.prototype.drawEllipse = function(b, a, e, c) {
  3174. this.checkRect(b - e, a - c, 2 * e, 2 * c)
  3175. };
  3176. c.prototype.lineStyle =
  3177. function(b, a, e, c, d, f, g, h) {};
  3178. c.prototype.lineTo = function(b, a) {
  3179. this.checkPoint(b, a)
  3180. };
  3181. c.prototype.curveTo = function(b, a, e, c) {
  3182. this.checkPoint(b, a);
  3183. this.checkPoint(e, c)
  3184. };
  3185. c.prototype.moveTo = function(b, a) {
  3186. this.checkPoint(b, a)
  3187. };
  3188. c.prototype.clear = function() {
  3189. this._maxY = this._maxX = this._minY = this._minX = 0
  3190. };
  3191. c.prototype.endFill = function() {};
  3192. c.prototype._draw = function(b) {};
  3193. c.prototype.checkRect = function(b, a, e, c) {
  3194. this._minX = Math.min(this._minX, b);
  3195. this._minY = Math.min(this._minY, a);
  3196. this._maxX = Math.max(this._maxX, b +
  3197. e);
  3198. this._maxY = Math.max(this._maxY, a + c)
  3199. };
  3200. c.prototype.checkPoint = function(b, a) {
  3201. this._minX = Math.min(this._minX, b);
  3202. this._minY = Math.min(this._minY, a);
  3203. this._maxX = Math.max(this._maxX, b);
  3204. this._maxY = Math.max(this._maxY, a);
  3205. this._lastX = b;
  3206. this._lastY = a
  3207. };
  3208. return c
  3209. }();
  3210. c.Graphics = d;
  3211. d.prototype.__class__ = "egret.Graphics";
  3212. (function() {
  3213. return function(c, b, a) {
  3214. this.method = c;
  3215. this.thisObject = b;
  3216. this.args = a
  3217. }
  3218. })().prototype.__class__ = "egret.Command"
  3219. })(egret || (egret = {}));
  3220. __extends = this.__extends || function(c, d) {
  3221. function f() {
  3222. this.constructor = c
  3223. }
  3224. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3225. f.prototype = d.prototype;
  3226. c.prototype = new f
  3227. };
  3228. (function(c) {
  3229. var d = function(d) {
  3230. function b() {
  3231. d.call(this)
  3232. }
  3233. __extends(b, d);
  3234. Object.defineProperty(b.prototype, "graphics", {
  3235. get: function() {
  3236. this._graphics || (this._graphics = new c.Graphics);
  3237. return this._graphics
  3238. },
  3239. enumerable: !0,
  3240. configurable: !0
  3241. });
  3242. b.prototype._render = function(a) {
  3243. this._graphics && this._graphics._draw(a)
  3244. };
  3245. return b
  3246. }(c.DisplayObject);
  3247. c.Shape = d;
  3248. d.prototype.__class__ = "egret.Shape"
  3249. })(egret || (egret = {}));
  3250. __extends = this.__extends || function(c, d) {
  3251. function f() {
  3252. this.constructor = c
  3253. }
  3254. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3255. f.prototype = d.prototype;
  3256. c.prototype = new f
  3257. };
  3258. (function(c) {
  3259. var d = function(d) {
  3260. function b() {
  3261. d.call(this)
  3262. }
  3263. __extends(b, d);
  3264. Object.defineProperty(b.prototype, "graphics", {
  3265. get: function() {
  3266. this._graphics || (this._graphics = new c.Graphics);
  3267. return this._graphics
  3268. },
  3269. enumerable: !0,
  3270. configurable: !0
  3271. });
  3272. b.prototype._render = function(a) {
  3273. this._graphics && this._graphics._draw(a);
  3274. d.prototype._render.call(this, a)
  3275. };
  3276. return b
  3277. }(c.DisplayObjectContainer);
  3278. c.Sprite = d;
  3279. d.prototype.__class__ = "egret.Sprite"
  3280. })(egret || (egret = {}));
  3281. __extends = this.__extends || function(c, d) {
  3282. function f() {
  3283. this.constructor = c
  3284. }
  3285. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3286. f.prototype = d.prototype;
  3287. c.prototype = new f
  3288. };
  3289. (function(c) {
  3290. var d = function(d) {
  3291. function b() {
  3292. d.call(this);
  3293. this._inputEnabled = !1;
  3294. this._text = this._type = "";
  3295. this._displayAsPassword = !1;
  3296. this._fontFamily = b.default_fontFamily;
  3297. this._size = 30;
  3298. this._textColorString = "#FFFFFF";
  3299. this._textColor = 16777215;
  3300. this._strokeColorString = "#000000";
  3301. this._stroke = this._strokeColor = 0;
  3302. this._textAlign = "left";
  3303. this._verticalAlign = "top";
  3304. this._maxChars = 0;
  3305. this._scrollV = -1;
  3306. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3307. this._isFlow = this._multiline = !1;
  3308. this._textArr = [];
  3309. this._isArrayChanged = !1;
  3310. this._textMaxHeight = this._textMaxWidth = 0;
  3311. this._linesArr = []
  3312. }
  3313. __extends(b, d);
  3314. b.prototype.isInput = function() {
  3315. return this._type == c.TextFieldType.INPUT
  3316. };
  3317. b.prototype._setTouchEnabled = function(a) {
  3318. d.prototype._setTouchEnabled.call(this, a);
  3319. this.isInput() && (this._inputEnabled = !0)
  3320. };
  3321. Object.defineProperty(b.prototype, "type", {
  3322. get: function() {
  3323. return this._type
  3324. },
  3325. set: function(a) {
  3326. this._setType(a)
  3327. },
  3328. enumerable: !0,
  3329. configurable: !0
  3330. });
  3331. b.prototype._setType = function(a) {
  3332. this._type != a && (this._type = a, this._type == c.TextFieldType.INPUT ?
  3333. (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3334. };
  3335. Object.defineProperty(b.prototype, "text", {
  3336. get: function() {
  3337. return this._getText()
  3338. },
  3339. set: function(a) {
  3340. this._setText(a)
  3341. },
  3342. enumerable: !0,
  3343. configurable: !0
  3344. });
  3345. b.prototype._getText = function() {
  3346. return this._type ==
  3347. c.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3348. };
  3349. b.prototype._setSizeDirty = function() {
  3350. d.prototype._setSizeDirty.call(this);
  3351. this._isArrayChanged = !0
  3352. };
  3353. b.prototype._setTextDirty = function() {
  3354. this._setSizeDirty()
  3355. };
  3356. b.prototype._setBaseText = function(a) {
  3357. null == a && (a = "");
  3358. this._isFlow = !1;
  3359. if (this._text != a || this._displayAsPassword) this._setTextDirty(), this._text = a, a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3360. text: a
  3361. }])
  3362. };
  3363. b.prototype._setText = function(a) {
  3364. null ==
  3365. a && (a = "");
  3366. this._setBaseText(a);
  3367. this._inputUtils && this._inputUtils._setText(this._text)
  3368. };
  3369. Object.defineProperty(b.prototype, "displayAsPassword", {
  3370. get: function() {
  3371. return this._displayAsPassword
  3372. },
  3373. set: function(a) {
  3374. this._setDisplayAsPassword(a)
  3375. },
  3376. enumerable: !0,
  3377. configurable: !0
  3378. });
  3379. b.prototype._setDisplayAsPassword = function(a) {
  3380. this._displayAsPassword != a && (this._displayAsPassword = a, this._setText(this._text))
  3381. };
  3382. Object.defineProperty(b.prototype, "fontFamily", {
  3383. get: function() {
  3384. return this._fontFamily
  3385. },
  3386. set: function(a) {
  3387. this._setFontFamily(a)
  3388. },
  3389. enumerable: !0,
  3390. configurable: !0
  3391. });
  3392. b.prototype._setFontFamily = function(a) {
  3393. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  3394. };
  3395. Object.defineProperty(b.prototype, "size", {
  3396. get: function() {
  3397. return this._size
  3398. },
  3399. set: function(a) {
  3400. this._setSize(a)
  3401. },
  3402. enumerable: !0,
  3403. configurable: !0
  3404. });
  3405. b.prototype._setSize = function(a) {
  3406. this._size != a && (this._setTextDirty(), this._size = a)
  3407. };
  3408. Object.defineProperty(b.prototype, "italic", {
  3409. get: function() {
  3410. return this._italic
  3411. },
  3412. set: function(a) {
  3413. this._setItalic(a)
  3414. },
  3415. enumerable: !0,
  3416. configurable: !0
  3417. });
  3418. b.prototype._setItalic = function(a) {
  3419. this._italic != a && (this._setTextDirty(), this._italic = a)
  3420. };
  3421. Object.defineProperty(b.prototype, "bold", {
  3422. get: function() {
  3423. return this._bold
  3424. },
  3425. set: function(a) {
  3426. this._setBold(a)
  3427. },
  3428. enumerable: !0,
  3429. configurable: !0
  3430. });
  3431. b.prototype._setBold = function(a) {
  3432. this._bold != a && (this._setTextDirty(), this._bold = a)
  3433. };
  3434. Object.defineProperty(b.prototype, "textColor", {
  3435. get: function() {
  3436. return this._textColor
  3437. },
  3438. set: function(a) {
  3439. this._setTextColor(a)
  3440. },
  3441. enumerable: !0,
  3442. configurable: !0
  3443. });
  3444. b.prototype._setTextColor =
  3445. function(a) {
  3446. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = c.toColorString(a))
  3447. };
  3448. Object.defineProperty(b.prototype, "strokeColor", {
  3449. get: function() {
  3450. return this._strokeColor
  3451. },
  3452. set: function(a) {
  3453. this._setStrokeColor(a)
  3454. },
  3455. enumerable: !0,
  3456. configurable: !0
  3457. });
  3458. b.prototype._setStrokeColor = function(a) {
  3459. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = c.toColorString(a))
  3460. };
  3461. Object.defineProperty(b.prototype, "stroke", {
  3462. get: function() {
  3463. return this._stroke
  3464. },
  3465. set: function(a) {
  3466. this._setStroke(a)
  3467. },
  3468. enumerable: !0,
  3469. configurable: !0
  3470. });
  3471. b.prototype._setStroke = function(a) {
  3472. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  3473. };
  3474. Object.defineProperty(b.prototype, "textAlign", {
  3475. get: function() {
  3476. return this._textAlign
  3477. },
  3478. set: function(a) {
  3479. this._setTextAlign(a)
  3480. },
  3481. enumerable: !0,
  3482. configurable: !0
  3483. });
  3484. b.prototype._setTextAlign = function(a) {
  3485. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  3486. };
  3487. Object.defineProperty(b.prototype, "verticalAlign", {
  3488. get: function() {
  3489. return this._verticalAlign
  3490. },
  3491. set: function(a) {
  3492. this._setVerticalAlign(a)
  3493. },
  3494. enumerable: !0,
  3495. configurable: !0
  3496. });
  3497. b.prototype._setVerticalAlign = function(a) {
  3498. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  3499. };
  3500. Object.defineProperty(b.prototype, "maxChars", {
  3501. get: function() {
  3502. return this._maxChars
  3503. },
  3504. set: function(a) {
  3505. this._setMaxChars(a)
  3506. },
  3507. enumerable: !0,
  3508. configurable: !0
  3509. });
  3510. b.prototype._setMaxChars = function(a) {
  3511. this._maxChars != a && (this._maxChars = a)
  3512. };
  3513. Object.defineProperty(b.prototype, "scrollV", {
  3514. set: function(a) {
  3515. this._scrollV = a;
  3516. this._setDirty()
  3517. },
  3518. enumerable: !0,
  3519. configurable: !0
  3520. });
  3521. Object.defineProperty(b.prototype, "maxScrollV", {
  3522. get: function() {
  3523. return this._maxScrollV
  3524. },
  3525. enumerable: !0,
  3526. configurable: !0
  3527. });
  3528. Object.defineProperty(b.prototype, "selectionBeginIndex", {
  3529. get: function() {
  3530. return 0
  3531. },
  3532. enumerable: !0,
  3533. configurable: !0
  3534. });
  3535. Object.defineProperty(b.prototype, "selectionEndIndex", {
  3536. get: function() {
  3537. return 0
  3538. },
  3539. enumerable: !0,
  3540. configurable: !0
  3541. });
  3542. Object.defineProperty(b.prototype, "caretIndex", {
  3543. get: function() {
  3544. return 0
  3545. },
  3546. enumerable: !0,
  3547. configurable: !0
  3548. });
  3549. b.prototype._setSelection =
  3550. function(a, e) {};
  3551. Object.defineProperty(b.prototype, "lineSpacing", {
  3552. get: function() {
  3553. return this._lineSpacing
  3554. },
  3555. set: function(a) {
  3556. this._setLineSpacing(a)
  3557. },
  3558. enumerable: !0,
  3559. configurable: !0
  3560. });
  3561. b.prototype._setLineSpacing = function(a) {
  3562. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  3563. };
  3564. b.prototype._getLineHeight = function() {
  3565. return this._lineSpacing + this._size
  3566. };
  3567. Object.defineProperty(b.prototype, "numLines", {
  3568. get: function() {
  3569. return this._numLines
  3570. },
  3571. enumerable: !0,
  3572. configurable: !0
  3573. });
  3574. Object.defineProperty(b.prototype,
  3575. "multiline", {
  3576. get: function() {
  3577. return this._multiline
  3578. },
  3579. set: function(a) {
  3580. this._setMultiline(a)
  3581. },
  3582. enumerable: !0,
  3583. configurable: !0
  3584. });
  3585. b.prototype._setMultiline = function(a) {
  3586. this._multiline = a;
  3587. this._setDirty()
  3588. };
  3589. b.prototype.setFocus = function() {
  3590. c.Logger.warning("TextField.setFocus \u6ca1\u6709\u5b9e\u73b0")
  3591. };
  3592. b.prototype._onRemoveFromStage = function() {
  3593. d.prototype._onRemoveFromStage.call(this);
  3594. this._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3595. };
  3596. b.prototype._onAddToStage = function() {
  3597. d.prototype._onAddToStage.call(this);
  3598. this._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
  3599. };
  3600. b.prototype._updateBaseTransform = function() {
  3601. d.prototype._updateTransform.call(this)
  3602. };
  3603. b.prototype._updateTransform = function() {
  3604. this._type == c.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3605. };
  3606. b.prototype._render = function(a) {
  3607. this.drawText(a);
  3608. this._clearDirty()
  3609. };
  3610. b.prototype._measureBounds = function() {
  3611. return this.measureText()
  3612. };
  3613. Object.defineProperty(b.prototype, "textFlow", {
  3614. set: function(a) {
  3615. this._isFlow = !0;
  3616. for (var e = "", b = 0; b < a.length; b++) e += a[b].text;
  3617. this._displayAsPassword ? this._setBaseText(e) : (this._text = e, this.setMiddleStyle(a))
  3618. },
  3619. enumerable: !0,
  3620. configurable: !0
  3621. });
  3622. b.prototype.changeToPassText = function(a) {
  3623. if (this._displayAsPassword) {
  3624. for (var e = "", b = 0, c = a.length; b < c; b++) switch (a.charAt(b)) {
  3625. case "\n":
  3626. e += "\n";
  3627. break;
  3628. case "\r":
  3629. break;
  3630. default:
  3631. e += "*"
  3632. }
  3633. return e
  3634. }
  3635. return a
  3636. };
  3637. b.prototype.setMiddleStyle = function(a) {
  3638. this._isArrayChanged = !0;
  3639. this._textArr = a;
  3640. this._setSizeDirty()
  3641. };
  3642. Object.defineProperty(b.prototype, "textWidth", {
  3643. get: function() {
  3644. return this._textMaxWidth
  3645. },
  3646. enumerable: !0,
  3647. configurable: !0
  3648. });
  3649. Object.defineProperty(b.prototype, "textHeight", {
  3650. get: function() {
  3651. return this._textMaxHeight
  3652. },
  3653. enumerable: !0,
  3654. configurable: !0
  3655. });
  3656. b.prototype.appendText = function(a) {
  3657. this.appendElement({
  3658. text: a
  3659. })
  3660. };
  3661. b.prototype.appendElement = function(a) {
  3662. this._textArr.push(a);
  3663. this.setMiddleStyle(this._textArr)
  3664. };
  3665. b.prototype._getLinesArr = function() {
  3666. if (!this._isArrayChanged) return this._linesArr;
  3667. this._isArrayChanged = !1;
  3668. var a = this._textArr,
  3669. e = c.MainContext.instance.rendererContext;
  3670. this._linesArr = [];
  3671. this._textMaxWidth = this._textMaxHeight = 0;
  3672. var b = this._linesArr,
  3673. d = 0,
  3674. f = 0,
  3675. g = 0,
  3676. h;
  3677. this._isFlow || e.setupFont(this);
  3678. for (var m = 0; m < a.length; m++) {
  3679. var k = a[m];
  3680. k.style = k.style || {};
  3681. for (var p = k.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < p.length; r++) {
  3682. null == b[g] && (h = {
  3683. width: 0,
  3684. height: 0,
  3685. elements: []
  3686. }, b[g] = h, f = d = 0);
  3687. f = this._type == c.TextFieldType.INPUT ? this._size : Math.max(f, k.style.size || this._size);
  3688. if ("" != p[r]) {
  3689. this._isFlow &&
  3690. e.setupFont(this, k.style);
  3691. var s = e.measureText(p[r]);
  3692. if (this._hasWidthSet)
  3693. if (d + s <= this._explicitWidth) h.elements.push({
  3694. width: s,
  3695. text: p[r],
  3696. style: k.style
  3697. }), d += s;
  3698. else {
  3699. for (var t = 0, v = 0, x = p[r]; t < x.length; t++) {
  3700. s = e.measureText(x.charAt(t));
  3701. if (d + s > this._explicitWidth) break;
  3702. v += s;
  3703. d += s
  3704. }
  3705. 0 < t && (h.elements.push({
  3706. width: v,
  3707. text: x.substring(0, t),
  3708. style: k.style
  3709. }), p[r] = x.substring(t));
  3710. r--
  3711. } else d += s, h.elements.push({
  3712. width: s,
  3713. text: p[r],
  3714. style: k.style
  3715. })
  3716. }
  3717. if (r < p.length - 1) {
  3718. h.width = d;
  3719. h.height = f;
  3720. this._textMaxWidth = Math.max(this._textMaxWidth,
  3721. d);
  3722. this._textMaxHeight += f;
  3723. if (this._type == c.TextFieldType.INPUT && !this._multiline) return this._numLines = b.length, b;
  3724. g++
  3725. }
  3726. }
  3727. m == a.length - 1 && h && (h.width = d, h.height = f, this._textMaxWidth = Math.max(this._textMaxWidth, d), this._textMaxHeight += f)
  3728. }
  3729. this._numLines = b.length;
  3730. return b
  3731. };
  3732. b.prototype.measureText = function() {
  3733. return this._getLinesArr() ? c.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) *
  3734. this._lineSpacing) : c.Rectangle.identity.initialize(0, 0, 0, 0)
  3735. };
  3736. b.prototype.drawText = function(a) {
  3737. var e = this._getLinesArr();
  3738. if (e) {
  3739. this._isFlow || a.setupFont(this);
  3740. var b = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3741. d = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  3742. f = 0,
  3743. g = 0;
  3744. if (this._hasHeightSet)
  3745. if (d < this._explicitHeight) {
  3746. var h = 0;
  3747. this._verticalAlign == c.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (h = 1);
  3748. f += h * (this._explicitHeight - d)
  3749. } else d > this._explicitHeight &&
  3750. (g = Math.max(this._scrollV - 1, 0), g = Math.min(this._numLines - 1, g));
  3751. f = Math.round(f);
  3752. d = 0;
  3753. this._textAlign == c.HorizontalAlign.CENTER ? d = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (d = 1);
  3754. for (h = 0; g < this._numLines; g++) {
  3755. var m = e[g],
  3756. k = m.height,
  3757. f = f + k / 2;
  3758. if (0 != g && this._hasHeightSet && f > this._explicitHeight) break;
  3759. for (var h = Math.round((b - m.width) * d), p = 0; p < m.elements.length; p++) {
  3760. var r = m.elements[p],
  3761. s = r.style.size || this._size;
  3762. this._type == c.TextFieldType.INPUT ? a.drawText(this, r.text, h, f + (k - s) / 2, r.width) : (this._isFlow &&
  3763. a.setupFont(this, r.style), a.drawText(this, r.text, h, f + (k - s) / 2, r.width, r.style));
  3764. h += r.width
  3765. }
  3766. f += k / 2 + this._lineSpacing
  3767. }
  3768. }
  3769. };
  3770. b.default_fontFamily = "Arial";
  3771. return b
  3772. }(c.DisplayObject);
  3773. c.TextField = d;
  3774. d.prototype.__class__ = "egret.TextField"
  3775. })(egret || (egret = {}));
  3776. (function(c) {
  3777. var d = function() {
  3778. function c() {
  3779. this.resutlArr = []
  3780. }
  3781. c.prototype.parser = function(b) {
  3782. this.stackArray = [];
  3783. this.resutlArr = [];
  3784. for (var a = 0, e = b.length; a < e;) {
  3785. var c = b.indexOf("<", a);
  3786. 0 > c ? (this.addToResultArr(b.substring(a)), a = e) : (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)
  3787. }
  3788. return this.resutlArr
  3789. };
  3790. c.prototype.addToResultArr = function(b) {
  3791. if ("" != b) {
  3792. var a = [];
  3793. a.push(["&lt;", "<"]);
  3794. a.push(["&gt;", ">"]);
  3795. a.push(["&amp;",
  3796. "&"
  3797. ]);
  3798. a.push(["&quot;", '"']);
  3799. a.push(["&apos;;", "'"]);
  3800. for (var e = 0; e < a.length; e++) b.replace(new RegExp(a[e][0], "g"), a[e][1]);
  3801. 0 < this.stackArray.length ? this.resutlArr.push({
  3802. text: b,
  3803. style: this.stackArray[this.stackArray.length - 1]
  3804. }) : this.resutlArr.push({
  3805. text: b
  3806. })
  3807. }
  3808. };
  3809. c.prototype.changeStringToObject = function(b) {
  3810. var a = {};
  3811. b = b.replace(/( )+/g, " ").split(" ");
  3812. for (var e = 0; e < b.length; e++) this.addProperty(a, b[e]);
  3813. return a
  3814. };
  3815. c.prototype.addProperty = function(b, a) {
  3816. var e = a.replace(/( )*=( )*/g, "=").split("=");
  3817. e[1] && (e[1] =
  3818. e[1].replace(/(\"|\')/g, ""));
  3819. switch (e[0].toLowerCase()) {
  3820. case "color":
  3821. b.textColor = parseInt(e[1]);
  3822. break;
  3823. case "b":
  3824. b.bold = "true" == (e[1] || "true");
  3825. break;
  3826. case "i":
  3827. b.italic = "true" == (e[1] || "true");
  3828. break;
  3829. case "size":
  3830. b.size = parseInt(e[1]);
  3831. break;
  3832. case "fontFamily":
  3833. b.fontFamily = e[1]
  3834. }
  3835. };
  3836. c.prototype.addToArray = function(b) {
  3837. b = this.changeStringToObject(b);
  3838. if (0 != this.stackArray.length) {
  3839. var a = this.stackArray[this.stackArray.length - 1],
  3840. e;
  3841. for (e in a) null == b[e] && (b[e] = a[e])
  3842. }
  3843. this.stackArray.push(b)
  3844. };
  3845. return c
  3846. }();
  3847. c.HtmlTextParser =
  3848. d;
  3849. d.prototype.__class__ = "egret.HtmlTextParser"
  3850. })(egret || (egret = {}));
  3851. (function(c) {
  3852. var d = function() {
  3853. function c() {}
  3854. c.DYNAMIC = "dynamic";
  3855. c.INPUT = "input";
  3856. return c
  3857. }();
  3858. c.TextFieldType = d;
  3859. d.prototype.__class__ = "egret.TextFieldType"
  3860. })(egret || (egret = {}));
  3861. __extends = this.__extends || function(c, d) {
  3862. function f() {
  3863. this.constructor = c
  3864. }
  3865. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3866. f.prototype = d.prototype;
  3867. c.prototype = new f
  3868. };
  3869. (function(c) {
  3870. var d = function(d) {
  3871. function b(a) {
  3872. d.call(this);
  3873. var e = a.bitmapData;
  3874. this.bitmapData = e;
  3875. this._textureMap = {};
  3876. this._sourceWidth = e.width;
  3877. this._sourceHeight = e.height;
  3878. this._bitmapX = a._bitmapX - a._offsetX;
  3879. this._bitmapY = a._bitmapY - a._offsetY
  3880. }
  3881. __extends(b, d);
  3882. b.prototype.getTexture = function(a) {
  3883. return this._textureMap[a]
  3884. };
  3885. b.prototype.createTexture = function(a, e, b, d, f, g, h, m, k) {
  3886. void 0 === g && (g = 0);
  3887. void 0 === h && (h = 0);
  3888. "undefined" === typeof m && (m = g + d);
  3889. "undefined" === typeof k && (k = h + f);
  3890. var p = new c.Texture;
  3891. p._bitmapData =
  3892. this.bitmapData;
  3893. p._bitmapX = this._bitmapX + e;
  3894. p._bitmapY = this._bitmapY + b;
  3895. p._bitmapWidth = d;
  3896. p._bitmapHeight = f;
  3897. p._offsetX = g;
  3898. p._offsetY = h;
  3899. p._textureWidth = m;
  3900. p._textureHeight = k;
  3901. p._sourceWidth = this._sourceWidth;
  3902. p._sourceHeight = this._sourceHeight;
  3903. return this._textureMap[a] = p
  3904. };
  3905. return b
  3906. }(c.HashObject);
  3907. c.SpriteSheet = d;
  3908. d.prototype.__class__ = "egret.SpriteSheet"
  3909. })(egret || (egret = {}));
  3910. __extends = this.__extends || function(c, d) {
  3911. function f() {
  3912. this.constructor = c
  3913. }
  3914. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3915. f.prototype = d.prototype;
  3916. c.prototype = new f
  3917. };
  3918. (function(c) {
  3919. var d = function(d) {
  3920. function b() {
  3921. d.call(this);
  3922. c.Logger.warning("TextInput \u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextField\u4ee3\u66ff\uff0c\u5e76\u8bbe\u7f6etype\u4e3aTextFieldType.INPUT");
  3923. this.type = c.TextFieldType.INPUT
  3924. }
  3925. __extends(b, d);
  3926. b.prototype.setText = function(a) {
  3927. c.Logger.warning("TextField.setText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u8bbe\u7f6e");
  3928. this.text = a
  3929. };
  3930. b.prototype.getText = function() {
  3931. c.Logger.warning("TextField.getText()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.text\u83b7\u53d6");
  3932. return this.text
  3933. };
  3934. b.prototype.setTextType = function(a) {
  3935. c.Logger.warning("TextField.setTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u8bbe\u7f6e");
  3936. this.displayAsPassword = "password" == a
  3937. };
  3938. b.prototype.getTextType = function() {
  3939. c.Logger.warning("TextField.getTextType()\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528TextInput.displayAsPassword\u83b7\u53d6");
  3940. return this.displayAsPassword ? "password" : "text"
  3941. };
  3942. return b
  3943. }(c.TextField);
  3944. c.TextInput = d;
  3945. d.prototype.__class__ = "egret.TextInput"
  3946. })(egret ||
  3947. (egret = {}));
  3948. __extends = this.__extends || function(c, d) {
  3949. function f() {
  3950. this.constructor = c
  3951. }
  3952. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  3953. f.prototype = d.prototype;
  3954. c.prototype = new f
  3955. };
  3956. (function(c) {
  3957. var d = function(d) {
  3958. function b() {
  3959. d.call(this);
  3960. this._isFocus = !1;
  3961. this._isFirst = this._isFirst = !0
  3962. }
  3963. __extends(b, d);
  3964. b.prototype.init = function(a) {
  3965. this._text = a;
  3966. this.stageText = c.StageText.create();
  3967. a = this._text.localToGlobal();
  3968. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  3969. };
  3970. b.prototype._addStageText = function() {
  3971. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3972. this.stageText._add();
  3973. this.stageText._addListeners();
  3974. this.stageText.addEventListener("blur", this.onBlurHandler,
  3975. this);
  3976. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3977. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3978. this._text.addEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3979. c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3980. };
  3981. b.prototype._removeStageText = function() {
  3982. this.stageText._remove();
  3983. this.stageText._removeListeners();
  3984. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3985. this.stageText.removeEventListener("blur",
  3986. this.onBlurHandler, this);
  3987. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3988. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3989. this._text.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3990. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3991. };
  3992. b.prototype._getText = function() {
  3993. return this.stageText._getText()
  3994. };
  3995. b.prototype._setText = function(a) {
  3996. this.stageText._setText(a)
  3997. };
  3998. b.prototype.onFocusHandler =
  3999. function(a) {
  4000. this.hideText()
  4001. };
  4002. b.prototype.onBlurHandler = function(a) {
  4003. this.showText()
  4004. };
  4005. b.prototype.onMouseDownHandler = function(a) {
  4006. a.stopPropagation();
  4007. this._text._visible && this.stageText._show()
  4008. };
  4009. b.prototype.onStageDownHandler = function(a) {
  4010. this.stageText._hide();
  4011. this.showText()
  4012. };
  4013. b.prototype.showText = function() {
  4014. this._isFocus && (this._isFocus = !1, this.resetText())
  4015. };
  4016. b.prototype.hideText = function() {
  4017. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4018. };
  4019. b.prototype.updateTextHandler = function(a) {
  4020. this.resetText();
  4021. this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
  4022. };
  4023. b.prototype.resetText = function() {
  4024. this._text._setBaseText(this.stageText._getText())
  4025. };
  4026. b.prototype._updateTransform = function() {
  4027. var a = this._text._worldTransform.a,
  4028. e = this._text._worldTransform.b,
  4029. b = this._text._worldTransform.c,
  4030. d = this._text._worldTransform.d,
  4031. f = this._text._worldTransform.tx,
  4032. g = this._text._worldTransform.ty;
  4033. this._text._updateBaseTransform();
  4034. var h = this._text._worldTransform;
  4035. if (this._isFirst || a != h.a || e != h.b || b != h.c || d != h.d || f != h.tx || g !=
  4036. h.ty) {
  4037. this._isFirst = !1;
  4038. a = this._text.localToGlobal();
  4039. this.stageText.changePosition(a.x, a.y);
  4040. var m = this;
  4041. c.callLater(function() {
  4042. m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
  4043. }, this)
  4044. }
  4045. };
  4046. b.prototype._updateProperties = function() {
  4047. var a = this._text._stage;
  4048. if (null == a) this.stageText._setVisible(!1);
  4049. else {
  4050. for (var e = this._text, b = e._visible; b;) {
  4051. e = e.parent;
  4052. if (e == a) break;
  4053. b = e._visible
  4054. }
  4055. this.stageText._setVisible(b)
  4056. }
  4057. this.stageText._setMultiline(this._text._multiline);
  4058. this.stageText._setMaxChars(this._text._maxChars);
  4059. this.stageText._setSize(this._text._size);
  4060. this.stageText._setTextColor(this._text._textColorString);
  4061. this.stageText._setTextFontFamily(this._text._fontFamily);
  4062. this.stageText._setBold(this._text._bold);
  4063. this.stageText._setItalic(this._text._italic);
  4064. this.stageText._setTextAlign(this._text._textAlign);
  4065. this.stageText._setWidth(this._text._getSize(c.Rectangle.identity).width);
  4066. this.stageText._setHeight(this._text._getSize(c.Rectangle.identity).height);
  4067. this.stageText._setTextType(this._text._displayAsPassword ?
  4068. "password" : "text");
  4069. this.stageText._setText(this._text._text);
  4070. this.stageText._resetStageText();
  4071. this._updateTransform()
  4072. };
  4073. return b
  4074. }(c.HashObject);
  4075. c.InputController = d;
  4076. d.prototype.__class__ = "egret.InputController"
  4077. })(egret || (egret = {}));
  4078. __extends = this.__extends || function(c, d) {
  4079. function f() {
  4080. this.constructor = c
  4081. }
  4082. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4083. f.prototype = d.prototype;
  4084. c.prototype = new f
  4085. };
  4086. (function(c) {
  4087. var d = function(c) {
  4088. function b(a, e) {
  4089. c.call(this, a);
  4090. this.charList = this.parseConfig(e)
  4091. }
  4092. __extends(b, c);
  4093. b.prototype.getTexture = function(a) {
  4094. var e = this._textureMap[a];
  4095. if (!e) {
  4096. e = this.charList[a];
  4097. if (!e) return null;
  4098. e = this.createTexture(a, e.x, e.y, e.width, e.height, e.offsetX, e.offsetY);
  4099. this._textureMap[a] = e
  4100. }
  4101. return e
  4102. };
  4103. b.prototype.parseConfig = function(a) {
  4104. a = a.split("\r\n").join("\n");
  4105. a = a.split("\n");
  4106. for (var e = this.getConfigByKey(a[3], "count"), b = {}, c = 4; c < 4 + e; c++) {
  4107. var d = a[c],
  4108. f = String.fromCharCode(this.getConfigByKey(d,
  4109. "id")),
  4110. h = {};
  4111. b[f] = h;
  4112. h.x = this.getConfigByKey(d, "x");
  4113. h.y = this.getConfigByKey(d, "y");
  4114. h.width = this.getConfigByKey(d, "width");
  4115. h.height = this.getConfigByKey(d, "height");
  4116. h.offsetX = this.getConfigByKey(d, "xoffset");
  4117. h.offsetY = this.getConfigByKey(d, "yoffset")
  4118. }
  4119. return b
  4120. };
  4121. b.prototype.getConfigByKey = function(a, e) {
  4122. for (var b = a.split(" "), c = 0, d = b.length; c < d; c++) {
  4123. var f = b[c];
  4124. if (e == f.substring(0, e.length)) return b = f.substring(e.length + 1), parseInt(b)
  4125. }
  4126. return 0
  4127. };
  4128. return b
  4129. }(c.SpriteSheet);
  4130. c.BitmapTextSpriteSheet = d;
  4131. d.prototype.__class__ =
  4132. "egret.BitmapTextSpriteSheet"
  4133. })(egret || (egret = {}));
  4134. __extends = this.__extends || function(c, d) {
  4135. function f() {
  4136. this.constructor = c
  4137. }
  4138. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4139. f.prototype = d.prototype;
  4140. c.prototype = new f
  4141. };
  4142. (function(c) {
  4143. var d = function(b) {
  4144. function a(a, d) {
  4145. b.call(this);
  4146. this.frameRate = 60;
  4147. a instanceof f ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = a) : this.delegate = new f(a, d);
  4148. this.delegate.setMovieClip(this)
  4149. }
  4150. __extends(a, b);
  4151. a.prototype.gotoAndPlay = function(a) {
  4152. this.delegate.gotoAndPlay(a)
  4153. };
  4154. a.prototype.gotoAndStop = function(a) {
  4155. this.delegate.gotoAndStop(a)
  4156. };
  4157. a.prototype.stop =
  4158. function() {
  4159. this.delegate.stop()
  4160. };
  4161. a.prototype.dispose = function() {
  4162. this.delegate.dispose()
  4163. };
  4164. a.prototype.release = function() {
  4165. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4166. this.dispose()
  4167. };
  4168. a.prototype.getCurrentFrameIndex = function() {
  4169. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4170. return this.delegate._currentFrameIndex
  4171. };
  4172. a.prototype.getTotalFrame = function() {
  4173. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4174. return this.delegate._totalFrame
  4175. };
  4176. a.prototype.setInterval = function(a) {
  4177. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  4178. this.frameRate = 60 / a
  4179. };
  4180. a.prototype.getIsPlaying = function() {
  4181. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  4182. return this.delegate.isPlaying
  4183. };
  4184. return a
  4185. }(c.DisplayObjectContainer);
  4186. c.MovieClip = d;
  4187. d.prototype.__class__ = "egret.MovieClip";
  4188. var f = function() {
  4189. function b(a, e) {
  4190. this.data = a;
  4191. this._currentFrameIndex = this._passTime =
  4192. this._totalFrame = 0;
  4193. this._isPlaying = !1;
  4194. this._frameData = a;
  4195. this._spriteSheet = new c.SpriteSheet(e)
  4196. }
  4197. b.prototype.setMovieClip = function(a) {
  4198. this.movieClip = a;
  4199. this.bitmap = new c.Bitmap;
  4200. this.movieClip.addChild(this.bitmap)
  4201. };
  4202. b.prototype.gotoAndPlay = function(a) {
  4203. this.checkHasFrame(a);
  4204. this._isPlaying = !0;
  4205. this._currentFrameIndex = 0;
  4206. this._currentFrameName = a;
  4207. this._totalFrame = this._frameData.frames[a].totalFrame;
  4208. this.playNextFrame();
  4209. this._passTime = 0;
  4210. c.Ticker.getInstance().register(this.update, this)
  4211. };
  4212. b.prototype.gotoAndStop =
  4213. function(a) {
  4214. this.checkHasFrame(a);
  4215. this.stop();
  4216. this._currentFrameIndex = this._passTime = 0;
  4217. this._currentFrameName = a;
  4218. this._totalFrame = this._frameData.frames[a].totalFrame;
  4219. this.playNextFrame()
  4220. };
  4221. b.prototype.stop = function() {
  4222. this._isPlaying = !1;
  4223. c.Ticker.getInstance().unregister(this.update, this)
  4224. };
  4225. b.prototype.dispose = function() {};
  4226. b.prototype.checkHasFrame = function(a) {
  4227. void 0 == this._frameData.frames[a] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  4228. };
  4229. b.prototype.update = function(a) {
  4230. for (var e =
  4231. 1E3 / this.movieClip.frameRate, e = Math.floor((this._passTime % e + a) / e); 1 <= e;) 1 == e ? this.playNextFrame() : this.playNextFrame(!1), e--;
  4232. this._passTime += a
  4233. };
  4234. b.prototype.playNextFrame = function(a) {
  4235. void 0 === a && (a = !0);
  4236. var e = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4237. if (a) {
  4238. a = this.getTexture(e.res);
  4239. var b = this.bitmap;
  4240. b.x = e.x;
  4241. b.y = e.y;
  4242. b.texture = a
  4243. }
  4244. null != e.action && this.movieClip.dispatchEventWith(e.action);
  4245. this._currentFrameIndex++;
  4246. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4247. 0, e.action != c.Event.COMPLETE && this.movieClip.dispatchEventWith(c.Event.COMPLETE))
  4248. };
  4249. b.prototype.getTexture = function(a) {
  4250. var e = this._frameData.res[a],
  4251. b = this._spriteSheet.getTexture(a);
  4252. b || (b = this._spriteSheet.createTexture(a, e.x, e.y, e.w, e.h));
  4253. return b
  4254. };
  4255. return b
  4256. }();
  4257. c.DefaultMovieClipDelegate = f;
  4258. f.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4259. })(egret || (egret = {}));
  4260. __extends = this.__extends || function(c, d) {
  4261. function f() {
  4262. this.constructor = c
  4263. }
  4264. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4265. f.prototype = d.prototype;
  4266. c.prototype = new f
  4267. };
  4268. (function(c) {
  4269. var d = function(c) {
  4270. function b() {
  4271. c.call(this);
  4272. this._scaleY = this._scaleX = 1;
  4273. this._size = 30;
  4274. this._color = "#FFFFFF";
  4275. this._fontFamily = "Arial";
  4276. this._italic = this._bold = !1;
  4277. this._textAlign = "left";
  4278. this._multiline = this._visible = !1;
  4279. this._maxChars = 0
  4280. }
  4281. __extends(b, c);
  4282. b.prototype._getText = function() {
  4283. return null
  4284. };
  4285. b.prototype._setText = function(a) {};
  4286. b.prototype._setTextType = function(a) {};
  4287. b.prototype._getTextType = function() {
  4288. return null
  4289. };
  4290. b.prototype._open = function(a, e, b, c) {};
  4291. b.prototype._show = function() {};
  4292. b.prototype._add =
  4293. function() {};
  4294. b.prototype._remove = function() {};
  4295. b.prototype._hide = function() {};
  4296. b.prototype._addListeners = function() {};
  4297. b.prototype._removeListeners = function() {};
  4298. b.prototype._setScale = function(a, e) {
  4299. this._scaleX = a;
  4300. this._scaleY = e
  4301. };
  4302. b.prototype.changePosition = function(a, e) {};
  4303. b.prototype._setSize = function(a) {
  4304. this._size = a
  4305. };
  4306. b.prototype._setTextColor = function(a) {
  4307. this._color = a
  4308. };
  4309. b.prototype._setTextFontFamily = function(a) {
  4310. this._fontFamily = a
  4311. };
  4312. b.prototype._setBold = function(a) {
  4313. this._bold = a
  4314. };
  4315. b.prototype._setItalic =
  4316. function(a) {
  4317. this._italic = a
  4318. };
  4319. b.prototype._setTextAlign = function(a) {
  4320. this._textAlign = a
  4321. };
  4322. b.prototype._setVisible = function(a) {
  4323. this._visible = a
  4324. };
  4325. b.prototype._setWidth = function(a) {};
  4326. b.prototype._setHeight = function(a) {};
  4327. b.prototype._setMultiline = function(a) {
  4328. this._multiline = a
  4329. };
  4330. b.prototype._setMaxChars = function(a) {
  4331. this._maxChars = a
  4332. };
  4333. b.prototype._resetStageText = function() {};
  4334. b.create = function() {
  4335. return null
  4336. };
  4337. return b
  4338. }(c.EventDispatcher);
  4339. c.StageText = d;
  4340. d.prototype.__class__ = "egret.StageText"
  4341. })(egret || (egret = {}));
  4342. (function(c) {
  4343. var d = function() {
  4344. function c() {}
  4345. c.GET = "get";
  4346. c.POST = "post";
  4347. return c
  4348. }();
  4349. c.URLRequestMethod = d;
  4350. d.prototype.__class__ = "egret.URLRequestMethod"
  4351. })(egret || (egret = {}));
  4352. (function(c) {
  4353. var d = function() {
  4354. function c() {}
  4355. c.BINARY = "binary";
  4356. c.TEXT = "text";
  4357. c.VARIABLES = "variables";
  4358. c.TEXTURE = "texture";
  4359. c.SOUND = "sound";
  4360. return c
  4361. }();
  4362. c.URLLoaderDataFormat = d;
  4363. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  4364. })(egret || (egret = {}));
  4365. __extends = this.__extends || function(c, d) {
  4366. function f() {
  4367. this.constructor = c
  4368. }
  4369. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4370. f.prototype = d.prototype;
  4371. c.prototype = new f
  4372. };
  4373. (function(c) {
  4374. var d = function(c) {
  4375. function b(a) {
  4376. void 0 === a && (a = null);
  4377. c.call(this);
  4378. null !== a && this.decode(a)
  4379. }
  4380. __extends(b, c);
  4381. b.prototype.decode = function(a) {
  4382. this.variables || (this.variables = {});
  4383. a = a.split("+").join(" ");
  4384. for (var e, b = /[?&]?([^=]+)=([^&]*)/g; e = b.exec(a);) this.variables[decodeURIComponent(e[1])] = decodeURIComponent(e[2])
  4385. };
  4386. b.prototype.toString = function() {
  4387. if (!this.variables) return "";
  4388. var a = this.variables,
  4389. e = "",
  4390. b = !0,
  4391. c;
  4392. for (c in a) b ? b = !1 : e += "&", e += c + "=" + a[c];
  4393. return e
  4394. };
  4395. return b
  4396. }(c.HashObject);
  4397. c.URLVariables =
  4398. d;
  4399. d.prototype.__class__ = "egret.URLVariables"
  4400. })(egret || (egret = {}));
  4401. __extends = this.__extends || function(c, d) {
  4402. function f() {
  4403. this.constructor = c
  4404. }
  4405. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4406. f.prototype = d.prototype;
  4407. c.prototype = new f
  4408. };
  4409. (function(c) {
  4410. var d = function(d) {
  4411. function b(a) {
  4412. void 0 === a && (a = null);
  4413. d.call(this);
  4414. this.method = c.URLRequestMethod.GET;
  4415. this.url = a
  4416. }
  4417. __extends(b, d);
  4418. return b
  4419. }(c.HashObject);
  4420. c.URLRequest = d;
  4421. d.prototype.__class__ = "egret.URLRequest"
  4422. })(egret || (egret = {}));
  4423. __extends = this.__extends || function(c, d) {
  4424. function f() {
  4425. this.constructor = c
  4426. }
  4427. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4428. f.prototype = d.prototype;
  4429. c.prototype = new f
  4430. };
  4431. (function(c) {
  4432. var d = function(d) {
  4433. function b(a) {
  4434. void 0 === a && (a = null);
  4435. d.call(this);
  4436. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  4437. this._status = -1;
  4438. a && this.load(a)
  4439. }
  4440. __extends(b, d);
  4441. b.prototype.load = function(a) {
  4442. this._request = a;
  4443. this.data = null;
  4444. c.MainContext.instance.netContext.proceed(this)
  4445. };
  4446. return b
  4447. }(c.EventDispatcher);
  4448. c.URLLoader = d;
  4449. d.prototype.__class__ = "egret.URLLoader"
  4450. })(egret || (egret = {}));
  4451. __extends = this.__extends || function(c, d) {
  4452. function f() {
  4453. this.constructor = c
  4454. }
  4455. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4456. f.prototype = d.prototype;
  4457. c.prototype = new f
  4458. };
  4459. (function(c) {
  4460. var d = function(d) {
  4461. function b() {
  4462. d.call(this);
  4463. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4464. }
  4465. __extends(b, d);
  4466. Object.defineProperty(b.prototype, "textureWidth", {
  4467. get: function() {
  4468. return this._textureWidth
  4469. },
  4470. enumerable: !0,
  4471. configurable: !0
  4472. });
  4473. Object.defineProperty(b.prototype, "textureHeight", {
  4474. get: function() {
  4475. return this._textureHeight
  4476. },
  4477. enumerable: !0,
  4478. configurable: !0
  4479. });
  4480. Object.defineProperty(b.prototype, "bitmapData", {
  4481. get: function() {
  4482. return this._bitmapData
  4483. },
  4484. enumerable: !0,
  4485. configurable: !0
  4486. });
  4487. b.prototype._setBitmapData = function(a) {
  4488. var e = c.MainContext.instance.rendererContext.texture_scale_factor;
  4489. this._bitmapData = a;
  4490. this._sourceWidth = a.width;
  4491. this._sourceHeight = a.height;
  4492. this._textureWidth = this._sourceWidth * e;
  4493. this._textureHeight = this._sourceHeight * e;
  4494. this._bitmapWidth = this._textureWidth;
  4495. this._bitmapHeight = this._textureHeight;
  4496. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4497. };
  4498. b.prototype.getPixel32 = function(a, e) {
  4499. return this._bitmapData.getContext("2d").getImageData(a,
  4500. e, 1, 1).data
  4501. };
  4502. return b
  4503. }(c.HashObject);
  4504. c.Texture = d;
  4505. d.prototype.__class__ = "egret.Texture"
  4506. })(egret || (egret = {}));
  4507. __extends = this.__extends || function(c, d) {
  4508. function f() {
  4509. this.constructor = c
  4510. }
  4511. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4512. f.prototype = d.prototype;
  4513. c.prototype = new f
  4514. };
  4515. (function(c) {
  4516. var d = function(d) {
  4517. function b() {
  4518. d.call(this);
  4519. this._bitmapData = document.createElement("canvas");
  4520. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  4521. }
  4522. __extends(b, d);
  4523. b.prototype.drawToTexture = function(a) {
  4524. var e = this._bitmapData,
  4525. d = a.getBounds(c.Rectangle.identity);
  4526. if (0 == d.width || 0 == d.height) return c.Logger.warning("egret.RenderTexture#drawToTexture:\u663e\u793a\u5bf9\u8c61\u6d4b\u91cf\u7ed3\u679c\u5bbd\u9ad8\u4e3a0\uff0c\u8bf7\u68c0\u67e5"), !1;
  4527. d.width = Math.floor(d.width);
  4528. d.height = Math.floor(d.height);
  4529. e.width = d.width;
  4530. e.height = d.height;
  4531. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = d.width, this.renderContext._cacheCanvas.height = d.height);
  4532. b.identityRectangle.width = d.width;
  4533. b.identityRectangle.height = d.height;
  4534. a._worldTransform.identity();
  4535. a.worldAlpha = 1;
  4536. if (a instanceof c.DisplayObjectContainer) {
  4537. var e = a._anchorOffsetX,
  4538. f = a._anchorOffsetY;
  4539. if (0 != a._anchorX || 0 != a._anchorY) e = a._anchorX * d.width, f = a._anchorY * d.height;
  4540. this._offsetX = d.x + e;
  4541. this._offsetY = d.y +
  4542. f;
  4543. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4544. d = a._children;
  4545. e = 0;
  4546. for (f = d.length; e < f; e++) d[e]._updateTransform()
  4547. }
  4548. d = c.RenderFilter.getInstance();
  4549. e = d._drawAreaList.concat();
  4550. d._drawAreaList.length = 0;
  4551. this.renderContext.clearScreen();
  4552. this.renderContext.onRenderStart();
  4553. this.webGLTexture = null;
  4554. (f = a.mask || a._scrollRect) && this.renderContext.pushMask(f);
  4555. a._render(this.renderContext);
  4556. f && this.renderContext.popMask();
  4557. d.addDrawArea(b.identityRectangle);
  4558. this.renderContext.onRenderFinish();
  4559. d._drawAreaList =
  4560. e;
  4561. this._textureWidth = this._bitmapData.width;
  4562. this._textureHeight = this._bitmapData.height;
  4563. this._sourceWidth = this._textureWidth;
  4564. this._sourceHeight = this._textureHeight;
  4565. return !0
  4566. };
  4567. b.identityRectangle = new c.Rectangle;
  4568. return b
  4569. }(c.Texture);
  4570. c.RenderTexture = d;
  4571. d.prototype.__class__ = "egret.RenderTexture"
  4572. })(egret || (egret = {}));
  4573. __extends = this.__extends || function(c, d) {
  4574. function f() {
  4575. this.constructor = c
  4576. }
  4577. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4578. f.prototype = d.prototype;
  4579. c.prototype = new f
  4580. };
  4581. (function(c) {
  4582. var d = function(d) {
  4583. function b() {
  4584. d.call(this);
  4585. this.renderCost = 0;
  4586. this.texture_scale_factor = 1;
  4587. this.profiler = c.Profiler.getInstance()
  4588. }
  4589. __extends(b, d);
  4590. b.prototype.clearScreen = function() {};
  4591. b.prototype.clearRect = function(a, e, b, c) {};
  4592. b.prototype.drawImage = function(a, e, b, c, d, f, h, m, k, p) {
  4593. this.profiler.onDrawImage()
  4594. };
  4595. b.prototype.setTransform = function(a) {};
  4596. b.prototype.setAlpha = function(a, e) {};
  4597. b.prototype.setupFont = function(a, e) {};
  4598. b.prototype.measureText = function(a) {
  4599. return 0
  4600. };
  4601. b.prototype.drawText = function(a,
  4602. e, b, c, d, f) {
  4603. this.profiler.onDrawImage()
  4604. };
  4605. b.prototype.strokeRect = function(a, e, b, c, d) {};
  4606. b.prototype.pushMask = function(a) {};
  4607. b.prototype.popMask = function() {};
  4608. b.prototype.onRenderStart = function() {};
  4609. b.prototype.onRenderFinish = function() {};
  4610. b.prototype.setGlobalColorTransform = function(a) {};
  4611. b.createRendererContext = function(a) {
  4612. return null
  4613. };
  4614. b.imageSmoothingEnabled = !0;
  4615. return b
  4616. }(c.HashObject);
  4617. c.RendererContext = d;
  4618. d.prototype.__class__ = "egret.RendererContext"
  4619. })(egret || (egret = {}));
  4620. (function(c) {
  4621. var d = function() {
  4622. function c() {}
  4623. c.MOUSE = "mouse";
  4624. c.TOUCH = "touch";
  4625. c.mode = "touch";
  4626. return c
  4627. }();
  4628. c.InteractionMode = d;
  4629. d.prototype.__class__ = "egret.InteractionMode"
  4630. })(egret || (egret = {}));
  4631. __extends = this.__extends || function(c, d) {
  4632. function f() {
  4633. this.constructor = c
  4634. }
  4635. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4636. f.prototype = d.prototype;
  4637. c.prototype = new f
  4638. };
  4639. (function(c) {
  4640. var d = function(d) {
  4641. function b() {
  4642. d.call(this);
  4643. this._currentTouchTarget = {};
  4644. this.maxTouches = 2;
  4645. this.touchDownTarget = {};
  4646. this.touchingIdentifiers = [];
  4647. this.lastTouchY = this.lastTouchX = -1
  4648. }
  4649. __extends(b, d);
  4650. b.prototype.run = function() {};
  4651. b.prototype.getTouchData = function(a, e, b) {
  4652. var c = this._currentTouchTarget[a];
  4653. null == c && (c = {}, this._currentTouchTarget[a] = c);
  4654. c.stageX = e;
  4655. c.stageY = b;
  4656. c.identifier = a;
  4657. return c
  4658. };
  4659. b.prototype.dispatchEvent = function(a, e) {
  4660. c.TouchEvent.dispatchTouchEvent(e.target, a, e.identifier, e.stageX,
  4661. e.stageY, !1, !1, !1, !0 == this.touchDownTarget[e.identifier])
  4662. };
  4663. b.prototype.onTouchBegan = function(a, e, b) {
  4664. if (this.touchingIdentifiers.length != this.maxTouches) {
  4665. var d = c.MainContext.instance.stage.hitTest(a, e);
  4666. d && (a = this.getTouchData(b, a, e), this.touchDownTarget[b] = !0, a.target = d, a.beginTarget = d, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
  4667. this.touchingIdentifiers.push(b)
  4668. }
  4669. };
  4670. b.prototype.onTouchMove = function(a, e, b) {
  4671. if (-1 != this.touchingIdentifiers.indexOf(b) && (a != this.lastTouchX || e != this.lastTouchY)) {
  4672. this.lastTouchX =
  4673. a;
  4674. this.lastTouchY = e;
  4675. var d = c.MainContext.instance.stage.hitTest(a, e);
  4676. d && (a = this.getTouchData(b, a, e), a.target = d, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
  4677. }
  4678. };
  4679. b.prototype.onTouchEnd = function(a, e, b) {
  4680. var d = this.touchingIdentifiers.indexOf(b); - 1 != d && (this.touchingIdentifiers.splice(d, 1), d = c.MainContext.instance.stage.hitTest(a, e)) && (a = this.getTouchData(b, a, e), delete this.touchDownTarget[b], b = a.beginTarget, a.target = d, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), b == d ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP,
  4681. a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4682. };
  4683. return b
  4684. }(c.HashObject);
  4685. c.TouchContext = d;
  4686. d.prototype.__class__ = "egret.TouchContext"
  4687. })(egret || (egret = {}));
  4688. __extends = this.__extends || function(c, d) {
  4689. function f() {
  4690. this.constructor = c
  4691. }
  4692. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4693. f.prototype = d.prototype;
  4694. c.prototype = new f
  4695. };
  4696. (function(c) {
  4697. var d = function(d) {
  4698. function b() {
  4699. d.call(this)
  4700. }
  4701. __extends(b, d);
  4702. b.prototype.proceed = function(a) {};
  4703. b._getUrl = function(a) {
  4704. var e = a.url; - 1 == e.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (e = e + "?" + a.data.toString());
  4705. return e
  4706. };
  4707. b.prototype.getChangeList = function() {
  4708. return []
  4709. };
  4710. return b
  4711. }(c.HashObject);
  4712. c.NetContext = d;
  4713. d.prototype.__class__ = "egret.NetContext"
  4714. })(egret || (egret = {}));
  4715. __extends = this.__extends || function(c, d) {
  4716. function f() {
  4717. this.constructor = c
  4718. }
  4719. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4720. f.prototype = d.prototype;
  4721. c.prototype = new f
  4722. };
  4723. (function(c) {
  4724. var d = function(c) {
  4725. function b() {
  4726. c.call(this);
  4727. this.frameRate = 60
  4728. }
  4729. __extends(b, c);
  4730. b.prototype.executeMainLoop = function(a, e) {};
  4731. return b
  4732. }(c.HashObject);
  4733. c.DeviceContext = d;
  4734. d.prototype.__class__ = "egret.DeviceContext"
  4735. })(egret || (egret = {}));
  4736. (function(c) {
  4737. var d = function() {
  4738. function c() {}
  4739. c.call = function(b, a) {};
  4740. c.addCallback = function(b, a) {};
  4741. return c
  4742. }();
  4743. c.ExternalInterface = d;
  4744. d.prototype.__class__ = "egret.ExternalInterface"
  4745. })(egret || (egret = {}));
  4746. __extends = this.__extends || function(c, d) {
  4747. function f() {
  4748. this.constructor = c
  4749. }
  4750. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  4751. f.prototype = d.prototype;
  4752. c.prototype = new f
  4753. };
  4754. (function(c) {
  4755. var d = function(d) {
  4756. function b() {
  4757. d.call(this);
  4758. this.ua = navigator.userAgent.toLowerCase();
  4759. this.trans = this._getTrans()
  4760. }
  4761. __extends(b, d);
  4762. b.getInstance = function() {
  4763. null == b.instance && (b.instance = new b);
  4764. return b.instance
  4765. };
  4766. Object.defineProperty(b.prototype, "isMobile", {
  4767. get: function() {
  4768. c.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  4769. return c.MainContext.deviceType ==
  4770. c.MainContext.DEVICE_MOBILE
  4771. },
  4772. enumerable: !0,
  4773. configurable: !0
  4774. });
  4775. b.prototype._getHeader = function(a) {
  4776. if ("transform" in a) return "";
  4777. for (var e = ["webkit", "ms", "Moz", "O"], b = 0; b < e.length; b++)
  4778. if (e[b] + "Transform" in a) return e[b];
  4779. return ""
  4780. };
  4781. b.prototype._getTrans = function() {
  4782. var a = document.createElement("div").style,
  4783. a = this._getHeader(a);
  4784. return "" == a ? "transform" : a + "Transform"
  4785. };
  4786. b.prototype.$new = function(a) {
  4787. return this.$(document.createElement(a))
  4788. };
  4789. b.prototype.$ = function(a) {
  4790. var e = document;
  4791. if (a = a instanceof HTMLElement ?
  4792. a : e.querySelector(a)) a.find = a.find || this.$, a.hasClass = a.hasClass || function(a) {
  4793. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4794. }, a.addClass = a.addClass || function(a) {
  4795. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4796. return this
  4797. }, a.removeClass = a.removeClass || function(a) {
  4798. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4799. return this
  4800. }, a.remove = a.remove || function() {}, a.appendTo = a.appendTo || function(a) {
  4801. a.appendChild(this);
  4802. return this
  4803. }, a.prependTo = a.prependTo ||
  4804. function(a) {
  4805. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4806. return this
  4807. }, a.transforms = a.transforms || function() {
  4808. this.style[b.getInstance().trans] = b.getInstance().translate(this.position) + b.getInstance().rotate(this.rotation) + b.getInstance().scale(this.scale) + b.getInstance().skew(this.skew);
  4809. return this
  4810. }, a.position = a.position || {
  4811. x: 0,
  4812. y: 0
  4813. }, a.rotation = a.rotation || 0, a.scale = a.scale || {
  4814. x: 1,
  4815. y: 1
  4816. }, a.skew = a.skew || {
  4817. x: 0,
  4818. y: 0
  4819. }, a.translates = function(a, e) {
  4820. this.position.x = a;
  4821. this.position.y = e -
  4822. c.MainContext.instance.stage.stageHeight;
  4823. this.transforms();
  4824. return this
  4825. }, a.rotate = function(a) {
  4826. this.rotation = a;
  4827. this.transforms();
  4828. return this
  4829. }, a.resize = function(a, e) {
  4830. this.scale.x = a;
  4831. this.scale.y = e;
  4832. this.transforms();
  4833. return this
  4834. }, a.setSkew = function(a, e) {
  4835. this.skew.x = a;
  4836. this.skew.y = e;
  4837. this.transforms();
  4838. return this
  4839. };
  4840. return a
  4841. };
  4842. b.prototype.translate = function(a) {
  4843. return "translate(" + a.x + "px, " + a.y + "px) "
  4844. };
  4845. b.prototype.rotate = function(a) {
  4846. return "rotate(" + a + "deg) "
  4847. };
  4848. b.prototype.scale = function(a) {
  4849. return "scale(" + a.x + ", " +
  4850. a.y + ") "
  4851. };
  4852. b.prototype.skew = function(a) {
  4853. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4854. };
  4855. return b
  4856. }(c.HashObject);
  4857. c.Browser = d;
  4858. d.prototype.__class__ = "egret.Browser"
  4859. })(egret || (egret = {}));
  4860. (function(c) {
  4861. (function(c) {
  4862. c.getItem = function(c) {
  4863. return null
  4864. };
  4865. c.setItem = function(c, b) {
  4866. return !1
  4867. };
  4868. c.removeItem = function(c) {};
  4869. c.clear = function() {}
  4870. })(c.localStorage || (c.localStorage = {}))
  4871. })(egret || (egret = {}));
  4872. (function(c) {
  4873. var d = function() {
  4874. function d() {}
  4875. d.parse = function(b) {
  4876. b = c.SAXParser.getInstance().parserXML(b);
  4877. if (!b || !b.childNodes) return null;
  4878. for (var a = b.childNodes.length, e = !1, l = 0; l < a; l++) {
  4879. var q = b.childNodes[l];
  4880. if (1 == q.nodeType) {
  4881. e = !0;
  4882. break
  4883. }
  4884. }
  4885. return e ? d.parseNode(q) : null
  4886. };
  4887. d.parseNode = function(b) {
  4888. if (!b || 1 != b.nodeType) return null;
  4889. var a = {};
  4890. a.localName = b.localName;
  4891. a.name = b.nodeName;
  4892. b.namespaceURI && (a.namespace = b.namespaceURI);
  4893. b.prefix && (a.prefix = b.prefix);
  4894. for (var e = b.attributes, c = e.length, q = 0; q < c; q++) {
  4895. var n =
  4896. e[q],
  4897. g = n.name;
  4898. 0 != g.indexOf("xmlns:") && (a["$" + g] = n.value)
  4899. }
  4900. e = b.childNodes;
  4901. c = e.length;
  4902. for (q = 0; q < c; q++)
  4903. if (n = d.parseNode(e[q])) a.children || (a.children = []), n.parent = a, a.children.push(n);!a.children && (b = b.textContent.trim()) && (a.text = b);
  4904. return a
  4905. };
  4906. d.findChildren = function(b, a, e) {
  4907. e ? e.length = 0 : e = [];
  4908. d.findByPath(b, a, e);
  4909. return e
  4910. };
  4911. d.findByPath = function(b, a, e) {
  4912. var c = a.indexOf("."),
  4913. q; - 1 == c ? (q = a, c = !0) : (q = a.substring(0, c), a = a.substring(c + 1), c = !1);
  4914. if (b = b.children)
  4915. for (var n = b.length, g = 0; g < n; g++) {
  4916. var h = b[g];
  4917. h.localName ==
  4918. q && (c ? e.push(h) : d.findByPath(h, a, e))
  4919. }
  4920. };
  4921. d.getAttributes = function(b, a) {
  4922. a ? a.length = 0 : a = [];
  4923. for (var e in b) "$" == e.charAt(0) && a.push(e.substring(1));
  4924. return a
  4925. };
  4926. return d
  4927. }();
  4928. c.XML = d;
  4929. d.prototype.__class__ = "egret.XML"
  4930. })(egret || (egret = {}));
  4931. (function(c) {
  4932. var d = function() {
  4933. function b() {}
  4934. b.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  4935. b.BIG_ENDIAN = "BIG_ENDIAN";
  4936. return b
  4937. }();
  4938. c.Endian = d;
  4939. d.prototype.__class__ = "egret.Endian";
  4940. var f = function() {
  4941. function b() {
  4942. this.length = this.position = 0;
  4943. this._mode = "";
  4944. this.maxlength = 0;
  4945. this._endian = d.LITTLE_ENDIAN;
  4946. this.isLittleEndian = !1;
  4947. this._mode = "Typed array";
  4948. this.maxlength = 4;
  4949. this.arraybytes = new ArrayBuffer(this.maxlength);
  4950. this.unalignedarraybytestemp = new ArrayBuffer(16);
  4951. this.endian = b.DEFAULT_ENDIAN
  4952. }
  4953. Object.defineProperty(b.prototype,
  4954. "endian", {
  4955. get: function() {
  4956. return this._endian
  4957. },
  4958. set: function(a) {
  4959. this._endian = a;
  4960. this.isLittleEndian = a == d.LITTLE_ENDIAN
  4961. },
  4962. enumerable: !0,
  4963. configurable: !0
  4964. });
  4965. b.prototype.ensureWriteableSpace = function(a) {
  4966. this.ensureSpace(a + this.position)
  4967. };
  4968. b.prototype.setArrayBuffer = function(a) {
  4969. this.ensureSpace(a.byteLength);
  4970. this.length = a.byteLength;
  4971. a = new Int8Array(a);
  4972. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  4973. this.position = 0
  4974. };
  4975. Object.defineProperty(b.prototype, "bytesAvailable", {
  4976. get: function() {
  4977. return this.length - this.position
  4978. },
  4979. enumerable: !0,
  4980. configurable: !0
  4981. });
  4982. b.prototype.ensureSpace = function(a) {
  4983. if (a > this.maxlength) {
  4984. a = a + 255 & -256;
  4985. var e = new ArrayBuffer(a),
  4986. b = new Uint8Array(this.arraybytes, 0, this.length);
  4987. (new Uint8Array(e, 0, this.length)).set(b);
  4988. this.arraybytes = e;
  4989. this.maxlength = a
  4990. }
  4991. };
  4992. b.prototype.writeByte = function(a) {
  4993. this.ensureWriteableSpace(1);
  4994. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  4995. this.position > this.length && (this.length = this.position)
  4996. };
  4997. b.prototype.readByte = function() {
  4998. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  4999. this.position + ", Length=" + this.length;
  5000. return (new Int8Array(this.arraybytes))[this.position++]
  5001. };
  5002. b.prototype.readBytes = function(a, e, b) {
  5003. void 0 === e && (e = 0);
  5004. void 0 === b && (b = 0);
  5005. null == b && (b = a.length);
  5006. a.ensureWriteableSpace(e + b);
  5007. var c = new Int8Array(a.arraybytes),
  5008. d = new Int8Array(this.arraybytes);
  5009. c.set(d.subarray(this.position, this.position + b), e);
  5010. this.position += b;
  5011. b + e > a.length && (a.length += b + e - a.length)
  5012. };
  5013. b.prototype.writeUnsignedByte = function(a) {
  5014. this.ensureWriteableSpace(1);
  5015. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  5016. this.position > this.length && (this.length = this.position)
  5017. };
  5018. b.prototype.readUnsignedByte = function() {
  5019. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  5020. return (new Uint8Array(this.arraybytes))[this.position++]
  5021. };
  5022. b.prototype.writeUnsignedShort = function(a) {
  5023. this.ensureWriteableSpace(2);
  5024. if (0 == (this.position & 1)) {
  5025. var e = new Uint16Array(this.arraybytes);
  5026. e[this.position >> 1] = ~~a & 65535
  5027. } else e = new Uint16Array(this.unalignedarraybytestemp, 0, 1), e[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), e = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(e);
  5028. this.position += 2;
  5029. this.position > this.length && (this.length = this.position)
  5030. };
  5031. b.prototype.readUTFBytes = function(a) {
  5032. var e = "";
  5033. a = this.position + a;
  5034. for (var b = new DataView(this.arraybytes); this.position < a;) {
  5035. var c = b.getUint8(this.position++);
  5036. if (128 > c) {
  5037. if (0 == c) break;
  5038. e += String.fromCharCode(c)
  5039. } else if (224 > c) e += String.fromCharCode((c & 63) << 6 | b.getUint8(this.position++) & 127);
  5040. else if (240 > c) var d = b.getUint8(this.position++),
  5041. e = e + String.fromCharCode((c & 31) << 12 | (d & 127) << 6 | b.getUint8(this.position++) & 127);
  5042. else var d = b.getUint8(this.position++),
  5043. f = b.getUint8(this.position++),
  5044. e = e + String.fromCharCode((c & 15) << 18 | (d & 127) << 12 | f << 6 & 127 | b.getUint8(this.position++) & 127)
  5045. }
  5046. return e
  5047. };
  5048. b.prototype.readInt = function() {
  5049. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  5050. this.position += 4;
  5051. return a
  5052. };
  5053. b.prototype.readShort = function() {
  5054. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  5055. this.position += 2;
  5056. return a
  5057. };
  5058. b.prototype.readDouble = function() {
  5059. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  5060. this.position += 8;
  5061. return a
  5062. };
  5063. b.prototype.readUnsignedShort = function() {
  5064. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5065. if (0 == (this.position & 1)) {
  5066. var a = new Uint16Array(this.arraybytes),
  5067. e = this.position >> 1;
  5068. this.position += 2;
  5069. return a[e]
  5070. }
  5071. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  5072. e = new Uint8Array(this.arraybytes,
  5073. this.position, 2);
  5074. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(e);
  5075. this.position += 2;
  5076. return a[0]
  5077. };
  5078. b.prototype.writeUnsignedInt = function(a) {
  5079. this.ensureWriteableSpace(4);
  5080. if (0 == (this.position & 3)) {
  5081. var e = new Uint32Array(this.arraybytes);
  5082. e[this.position >> 2] = ~~a & 4294967295
  5083. } else e = new Uint32Array(this.unalignedarraybytestemp, 0, 1), e[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), e = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(e);
  5084. this.position += 4;
  5085. this.position > this.length &&
  5086. (this.length = this.position)
  5087. };
  5088. b.prototype.readUnsignedInt = function() {
  5089. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5090. if (0 == (this.position & 3)) {
  5091. var a = new Uint32Array(this.arraybytes),
  5092. e = this.position >> 2;
  5093. this.position += 4;
  5094. return a[e]
  5095. }
  5096. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  5097. e = new Uint8Array(this.arraybytes, this.position, 4);
  5098. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(e);
  5099. this.position += 4;
  5100. return a[0]
  5101. };
  5102. b.prototype.writeFloat =
  5103. function(a) {
  5104. this.ensureWriteableSpace(4);
  5105. if (0 == (this.position & 3)) {
  5106. var e = new Float32Array(this.arraybytes);
  5107. e[this.position >> 2] = a
  5108. } else e = new Float32Array(this.unalignedarraybytestemp, 0, 1), e[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), e = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(e);
  5109. this.position += 4;
  5110. this.position > this.length && (this.length = this.position)
  5111. };
  5112. b.prototype.readFloat = function() {
  5113. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  5114. this.length;
  5115. if (0 == (this.position & 3)) {
  5116. var a = new Float32Array(this.arraybytes),
  5117. e = this.position >> 2;
  5118. this.position += 4;
  5119. return a[e]
  5120. }
  5121. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  5122. e = new Uint8Array(this.arraybytes, this.position, 4);
  5123. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(e);
  5124. this.position += 4;
  5125. return a[0]
  5126. };
  5127. b.DEFAULT_ENDIAN = d.BIG_ENDIAN;
  5128. return b
  5129. }();
  5130. c.ByteArray = f;
  5131. f.prototype.__class__ = "egret.ByteArray"
  5132. })(egret || (egret = {}));
  5133. __extends = this.__extends || function(c, d) {
  5134. function f() {
  5135. this.constructor = c
  5136. }
  5137. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5138. f.prototype = d.prototype;
  5139. c.prototype = new f
  5140. };
  5141. (function(c) {
  5142. var d = function(d) {
  5143. function b(a, e, b) {
  5144. d.call(this);
  5145. this._target = null;
  5146. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5147. this._actions = this._steps = this.pluginData = null;
  5148. this.paused = !1;
  5149. this.duration = 0;
  5150. this._prevPos = -1;
  5151. this.position = null;
  5152. this._stepPosition = this._prevPosition = 0;
  5153. this.passive = !1;
  5154. this.initialize(a, e, b)
  5155. }
  5156. __extends(b, d);
  5157. b.get = function(a, e, c, d) {
  5158. void 0 === e && (e = null);
  5159. void 0 === c && (c = null);
  5160. void 0 === d && (d = !1);
  5161. d && b.removeTweens(a);
  5162. return new b(a, e, c)
  5163. };
  5164. b.removeTweens = function(a) {
  5165. if (a.tween_count) {
  5166. for (var e =
  5167. b._tweens, c = e.length - 1; 0 <= c; c--) e[c]._target == a && (e[c].paused = !0, e.splice(c, 1));
  5168. a.tween_count = 0
  5169. }
  5170. };
  5171. b.pauseTweens = function(a) {
  5172. if (a.tween_count)
  5173. for (var e = c.Tween._tweens, b = e.length - 1; 0 <= b; b--) e[b]._target == a && (e[b].paused = !0)
  5174. };
  5175. b.resumeTweens = function(a) {
  5176. if (a.tween_count)
  5177. for (var e = c.Tween._tweens, b = e.length - 1; 0 <= b; b--) e[b]._target == a && (e[b].paused = !1)
  5178. };
  5179. b.tick = function(a, e) {
  5180. void 0 === e && (e = !1);
  5181. for (var c = b._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  5182. var f = c[d];
  5183. e && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ?
  5184. 1 : a)
  5185. }
  5186. };
  5187. b._register = function(a, e) {
  5188. var d = a._target,
  5189. f = b._tweens;
  5190. if (e) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), f.push(a), b._inited || (c.Ticker.getInstance().register(b.tick, null), b._inited = !0);
  5191. else
  5192. for (d && d.tween_count--, d = f.length; d--;)
  5193. if (f[d] == a) {
  5194. f.splice(d, 1);
  5195. break
  5196. }
  5197. };
  5198. b.removeAllTweens = function() {
  5199. for (var a = b._tweens, e = 0, c = a.length; e < c; e++) {
  5200. var d = a[e];
  5201. d.paused = !0;
  5202. d._target.tweenjs_count = 0
  5203. }
  5204. a.length = 0
  5205. };
  5206. b.prototype.initialize = function(a, e, c) {
  5207. this._target = a;
  5208. e && (this._useTicks = e.useTicks, this.ignoreGlobalPause =
  5209. e.ignoreGlobalPause, this.loop = e.loop, e.onChange && this.addEventListener("change", e.onChange, e.onChangeObj), e.override && b.removeTweens(a));
  5210. this.pluginData = c || {};
  5211. this._curQueueProps = {};
  5212. this._initQueueProps = {};
  5213. this._steps = [];
  5214. this._actions = [];
  5215. e && e.paused ? this.paused = !0 : b._register(this, !0);
  5216. e && null != e.position && this.setPosition(e.position, b.NONE)
  5217. };
  5218. b.prototype.setPosition = function(a, e) {
  5219. void 0 === e && (e = 1);
  5220. 0 > a && (a = 0);
  5221. var b = a,
  5222. c = !1;
  5223. b >= this.duration && (this.loop ? b %= this.duration : (b = this.duration, c = !0));
  5224. if (b == this._prevPos) return c;
  5225. var d = this._prevPos;
  5226. this.position = this._prevPos = b;
  5227. this._prevPosition = a;
  5228. if (this._target)
  5229. if (c) this._updateTargetProps(null, 1);
  5230. else if (0 < this._steps.length) {
  5231. for (var f = 0, h = this._steps.length; f < h && !(this._steps[f].t > b); f++);
  5232. f = this._steps[f - 1];
  5233. this._updateTargetProps(f, (this._stepPosition = b - f.t) / f.d)
  5234. }
  5235. 0 != e && 0 < this._actions.length && (this._useTicks ? this._runActions(b, b) : 1 == e && b < d ? (d != this.duration && this._runActions(d, this.duration), this._runActions(0, b, !0)) : this._runActions(d, b));
  5236. c && this.setPaused(!0);
  5237. this.dispatchEventWith("change");
  5238. return c
  5239. };
  5240. b.prototype._runActions = function(a, e, b) {
  5241. void 0 === b && (b = !1);
  5242. var c = a,
  5243. d = e,
  5244. f = -1,
  5245. h = this._actions.length,
  5246. m = 1;
  5247. a > e && (c = e, d = a, f = h, h = m = -1);
  5248. for (;
  5249. (f += m) != h;) {
  5250. e = this._actions[f];
  5251. var k = e.t;
  5252. (k == d || k > c && k < d || b && k == a) && e.f.apply(e.o, e.p)
  5253. }
  5254. };
  5255. b.prototype._updateTargetProps = function(a, e) {
  5256. var c, d, f, g;
  5257. if (a || 1 != e) {
  5258. if (this.passive = !!a.v) return;
  5259. a.e && (e = a.e(e, 0, 1, 1));
  5260. c = a.p0;
  5261. d = a.p1
  5262. } else this.passive = !1, c = d = this._curQueueProps;
  5263. for (var h in this._initQueueProps) {
  5264. null == (f = c[h]) && (c[h] = f = this._initQueueProps[h]);
  5265. null ==
  5266. (g = d[h]) && (d[h] = g = f);
  5267. f = f == g || 0 == e || 1 == e || "number" != typeof f ? 1 == e ? g : f : f + (g - f) * e;
  5268. var m = !1;
  5269. if (g = b._plugins[h])
  5270. for (var k = 0, p = g.length; k < p; k++) {
  5271. var r = g[k].tween(this, h, f, c, d, e, !!a && c == d, !a);
  5272. r == b.IGNORE ? m = !0 : f = r
  5273. }
  5274. m || (this._target[h] = f)
  5275. }
  5276. };
  5277. b.prototype.setPaused = function(a) {
  5278. this.paused = a;
  5279. b._register(this, !a);
  5280. return this
  5281. };
  5282. b.prototype._cloneProps = function(a) {
  5283. var e = {},
  5284. b;
  5285. for (b in a) e[b] = a[b];
  5286. return e
  5287. };
  5288. b.prototype._addStep = function(a) {
  5289. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5290. return this
  5291. };
  5292. b.prototype._appendQueueProps = function(a) {
  5293. var e, c, d, f, g, h;
  5294. for (h in a)
  5295. if (void 0 === this._initQueueProps[h]) {
  5296. c = this._target[h];
  5297. if (e = b._plugins[h])
  5298. for (d = 0, f = e.length; d < f; d++) c = e[d].init(this, h, c);
  5299. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === c ? null : c
  5300. }
  5301. for (h in a) {
  5302. c = this._curQueueProps[h];
  5303. if (e = b._plugins[h])
  5304. for (g = g || {}, d = 0, f = e.length; d < f; d++) e[d].step && e[d].step(this, h, c, a[h], g);
  5305. this._curQueueProps[h] = a[h]
  5306. }
  5307. g && this._appendQueueProps(g);
  5308. return this._curQueueProps
  5309. };
  5310. b.prototype._addAction = function(a) {
  5311. a.t =
  5312. this.duration;
  5313. this._actions.push(a);
  5314. return this
  5315. };
  5316. b.prototype._set = function(a, e) {
  5317. for (var b in a) e[b] = a[b]
  5318. };
  5319. b.prototype.wait = function(a, e) {
  5320. if (null == a || 0 >= a) return this;
  5321. var b = this._cloneProps(this._curQueueProps);
  5322. return this._addStep({
  5323. d: a,
  5324. p0: b,
  5325. p1: b,
  5326. v: e
  5327. })
  5328. };
  5329. b.prototype.to = function(a, e, b) {
  5330. void 0 === b && (b = void 0);
  5331. if (isNaN(e) || 0 > e) e = 0;
  5332. return this._addStep({
  5333. d: e || 0,
  5334. p0: this._cloneProps(this._curQueueProps),
  5335. e: b,
  5336. p1: this._cloneProps(this._appendQueueProps(a))
  5337. })
  5338. };
  5339. b.prototype.call = function(a, e, b) {
  5340. void 0 === e && (e = void 0);
  5341. void 0 === b && (b = void 0);
  5342. return this._addAction({
  5343. f: a,
  5344. p: b ? b : [],
  5345. o: e ? e : this._target
  5346. })
  5347. };
  5348. b.prototype.set = function(a, e) {
  5349. void 0 === e && (e = null);
  5350. return this._addAction({
  5351. f: this._set,
  5352. o: this,
  5353. p: [a, e ? e : this._target]
  5354. })
  5355. };
  5356. b.prototype.play = function(a) {
  5357. a || (a = this);
  5358. return this.call(a.setPaused, a, [!1])
  5359. };
  5360. b.prototype.pause = function(a) {
  5361. a || (a = this);
  5362. return this.call(a.setPaused, a, [!0])
  5363. };
  5364. b.prototype.tick = function(a) {
  5365. this.paused || this.setPosition(this._prevPosition + a)
  5366. };
  5367. b.NONE = 0;
  5368. b.LOOP = 1;
  5369. b.REVERSE = 2;
  5370. b._tweens = [];
  5371. b.IGNORE = {};
  5372. b._plugins = {};
  5373. b._inited = !1;
  5374. return b
  5375. }(c.EventDispatcher);
  5376. c.Tween = d;
  5377. d.prototype.__class__ = "egret.Tween"
  5378. })(egret || (egret = {}));
  5379. (function(c) {
  5380. var d = function() {
  5381. function d() {
  5382. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5383. }
  5384. d.get = function(b) {
  5385. -1 > b && (b = -1);
  5386. 1 < b && (b = 1);
  5387. return function(a) {
  5388. return 0 == b ? a : 0 > b ? a * (a * -b + 1 + b) : a * ((2 - a) * b + (1 - b))
  5389. }
  5390. };
  5391. d.getPowIn = function(b) {
  5392. return function(a) {
  5393. return Math.pow(a, b)
  5394. }
  5395. };
  5396. d.getPowOut = function(b) {
  5397. return function(a) {
  5398. return 1 - Math.pow(1 - a, b)
  5399. }
  5400. };
  5401. d.getPowInOut = function(b) {
  5402. return function(a) {
  5403. return 1 > (a *= 2) ? 0.5 * Math.pow(a, b) : 1 - 0.5 * Math.abs(Math.pow(2 - a, b))
  5404. }
  5405. };
  5406. d.sineIn = function(b) {
  5407. return 1 - Math.cos(b *
  5408. Math.PI / 2)
  5409. };
  5410. d.sineOut = function(b) {
  5411. return Math.sin(b * Math.PI / 2)
  5412. };
  5413. d.sineInOut = function(b) {
  5414. return -0.5 * (Math.cos(Math.PI * b) - 1)
  5415. };
  5416. d.getBackIn = function(b) {
  5417. return function(a) {
  5418. return a * a * ((b + 1) * a - b)
  5419. }
  5420. };
  5421. d.getBackOut = function(b) {
  5422. return function(a) {
  5423. return --a * a * ((b + 1) * a + b) + 1
  5424. }
  5425. };
  5426. d.getBackInOut = function(b) {
  5427. b *= 1.525;
  5428. return function(a) {
  5429. return 1 > (a *= 2) ? 0.5 * a * a * ((b + 1) * a - b) : 0.5 * ((a -= 2) * a * ((b + 1) * a + b) + 2)
  5430. }
  5431. };
  5432. d.circIn = function(b) {
  5433. return -(Math.sqrt(1 - b * b) - 1)
  5434. };
  5435. d.circOut = function(b) {
  5436. return Math.sqrt(1 - --b * b)
  5437. };
  5438. d.circInOut = function(b) {
  5439. return 1 >
  5440. (b *= 2) ? -0.5 * (Math.sqrt(1 - b * b) - 1) : 0.5 * (Math.sqrt(1 - (b -= 2) * b) + 1)
  5441. };
  5442. d.bounceIn = function(b) {
  5443. return 1 - d.bounceOut(1 - b)
  5444. };
  5445. d.bounceOut = function(b) {
  5446. return b < 1 / 2.75 ? 7.5625 * b * b : b < 2 / 2.75 ? 7.5625 * (b -= 1.5 / 2.75) * b + 0.75 : b < 2.5 / 2.75 ? 7.5625 * (b -= 2.25 / 2.75) * b + 0.9375 : 7.5625 * (b -= 2.625 / 2.75) * b + 0.984375
  5447. };
  5448. d.bounceInOut = function(b) {
  5449. return 0.5 > b ? 0.5 * d.bounceIn(2 * b) : 0.5 * d.bounceOut(2 * b - 1) + 0.5
  5450. };
  5451. d.getElasticIn = function(b, a) {
  5452. var e = 2 * Math.PI;
  5453. return function(c) {
  5454. if (0 == c || 1 == c) return c;
  5455. var d = a / e * Math.asin(1 / b);
  5456. return -(b * Math.pow(2, 10 *
  5457. (c -= 1)) * Math.sin((c - d) * e / a))
  5458. }
  5459. };
  5460. d.getElasticOut = function(b, a) {
  5461. var e = 2 * Math.PI;
  5462. return function(c) {
  5463. if (0 == c || 1 == c) return c;
  5464. var d = a / e * Math.asin(1 / b);
  5465. return b * Math.pow(2, -10 * c) * Math.sin((c - d) * e / a) + 1
  5466. }
  5467. };
  5468. d.getElasticInOut = function(b, a) {
  5469. var e = 2 * Math.PI;
  5470. return function(c) {
  5471. var d = a / e * Math.asin(1 / b);
  5472. return 1 > (c *= 2) ? -0.5 * b * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - d) * e / a) : b * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - d) * e / a) * 0.5 + 1
  5473. }
  5474. };
  5475. d.quadIn = d.getPowIn(2);
  5476. d.quadOut = d.getPowOut(2);
  5477. d.quadInOut = d.getPowInOut(2);
  5478. d.cubicIn = d.getPowIn(3);
  5479. d.cubicOut = d.getPowOut(3);
  5480. d.cubicInOut = d.getPowInOut(3);
  5481. d.quartIn = d.getPowIn(4);
  5482. d.quartOut = d.getPowOut(4);
  5483. d.quartInOut = d.getPowInOut(4);
  5484. d.quintIn = d.getPowIn(5);
  5485. d.quintOut = d.getPowOut(5);
  5486. d.quintInOut = d.getPowInOut(5);
  5487. d.backIn = d.getBackIn(1.7);
  5488. d.backOut = d.getBackOut(1.7);
  5489. d.backInOut = d.getBackInOut(1.7);
  5490. d.elasticIn = d.getElasticIn(1, 0.3);
  5491. d.elasticOut = d.getElasticOut(1, 0.3);
  5492. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5493. return d
  5494. }();
  5495. c.Ease = d;
  5496. d.prototype.__class__ = "egret.Ease"
  5497. })(egret || (egret = {}));
  5498. (function(c) {
  5499. var d = function() {
  5500. function c() {
  5501. this.type = c.EFFECT
  5502. }
  5503. c.prototype.play = function(b) {
  5504. void 0 === b && (b = !1);
  5505. var a = this.audio;
  5506. a && (isNaN(a.duration) || (a.currentTime = 0), a.loop = b, a.play())
  5507. };
  5508. c.prototype.pause = function() {
  5509. var b = this.audio;
  5510. b && b.pause()
  5511. };
  5512. c.prototype.load = function() {
  5513. var b = this.audio;
  5514. b && b.load()
  5515. };
  5516. c.prototype.addEventListener = function(b, a) {
  5517. this.audio && this.audio.addEventListener(b, a, !1)
  5518. };
  5519. c.prototype.removeEventListener = function(b, a) {
  5520. this.audio && this.audio.removeEventListener(b, a, !1)
  5521. };
  5522. c.prototype.setVolume =
  5523. function(b) {
  5524. var a = this.audio;
  5525. a && (a.volume = b)
  5526. };
  5527. c.prototype.getVolume = function() {
  5528. return this.audio ? this.audio.volume : 0
  5529. };
  5530. c.prototype.preload = function(b) {
  5531. this.type = b
  5532. };
  5533. c.prototype._setAudio = function(b) {
  5534. this.audio = b
  5535. };
  5536. c.MUSIC = "music";
  5537. c.EFFECT = "effect";
  5538. return c
  5539. }();
  5540. c.Sound = d;
  5541. d.prototype.__class__ = "egret.Sound"
  5542. })(egret || (egret = {}));
  5543. (function(c) {
  5544. var d = function() {
  5545. function c() {}
  5546. c.isNumber = function(b) {
  5547. return "number" === typeof b && !isNaN(b)
  5548. };
  5549. return c
  5550. }();
  5551. c.NumberUtils = d;
  5552. d.prototype.__class__ = "egret.NumberUtils"
  5553. })(egret || (egret = {}));
  5554. Function.prototype.bind || (Function.prototype.bind = function(c) {
  5555. if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5556. var d = Array.prototype.slice.call(arguments, 1),
  5557. f = this,
  5558. b = function() {},
  5559. a = function() {
  5560. return f.apply(this instanceof b && c ? this : c, d.concat(Array.prototype.slice.call(arguments)))
  5561. };
  5562. b.prototype = this.prototype;
  5563. a.prototype = new b;
  5564. return a
  5565. });
  5566. var __extends = this.__extends || function(c, d) {
  5567. function f() {
  5568. this.constructor = c
  5569. }
  5570. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5571. f.prototype = d.prototype;
  5572. c.prototype = new f
  5573. },
  5574. RES;
  5575. (function(c) {
  5576. var d = function(c) {
  5577. function b(a, e, b) {
  5578. void 0 === e && (e = !1);
  5579. void 0 === b && (b = !1);
  5580. c.call(this, a, e, b);
  5581. this.itemsTotal = this.itemsLoaded = 0
  5582. }
  5583. __extends(b, c);
  5584. b.dispatchResourceEvent = function(a, e, c, d, f, g) {
  5585. void 0 === c && (c = "");
  5586. void 0 === d && (d = null);
  5587. void 0 === f && (f = 0);
  5588. void 0 === g && (g = 0);
  5589. var h = egret.Event._getPropertyData(b);
  5590. h.groupName = c;
  5591. h.resItem = d;
  5592. h.itemsLoaded = f;
  5593. h.itemsTotal = g;
  5594. egret.Event._dispatchByTarget(b, a, e, h)
  5595. };
  5596. b.ITEM_LOAD_ERROR = "itemLoadError";
  5597. b.CONFIG_COMPLETE = "configComplete";
  5598. b.GROUP_PROGRESS = "groupProgress";
  5599. b.GROUP_COMPLETE = "groupComplete";
  5600. return b
  5601. }(egret.Event);
  5602. c.ResourceEvent = d;
  5603. d.prototype.__class__ = "RES.ResourceEvent"
  5604. })(RES || (RES = {}));
  5605. (function(c) {
  5606. var d = function() {
  5607. function c(b, a, e) {
  5608. this._loaded = !1;
  5609. this.name = b;
  5610. this.url = a;
  5611. this.type = e
  5612. }
  5613. Object.defineProperty(c.prototype, "loaded", {
  5614. get: function() {
  5615. return this.data ? this.data.loaded : this._loaded
  5616. },
  5617. set: function(b) {
  5618. this.data && (this.data.loaded = b);
  5619. this._loaded = b
  5620. },
  5621. enumerable: !0,
  5622. configurable: !0
  5623. });
  5624. c.prototype.toString = function() {
  5625. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5626. };
  5627. c.TYPE_XML = "xml";
  5628. c.TYPE_IMAGE = "image";
  5629. c.TYPE_BIN = "bin";
  5630. c.TYPE_TEXT = "text";
  5631. c.TYPE_JSON =
  5632. "json";
  5633. c.TYPE_SHEET = "sheet";
  5634. c.TYPE_FONT = "font";
  5635. c.TYPE_SOUND = "sound";
  5636. return c
  5637. }();
  5638. c.ResourceItem = d;
  5639. d.prototype.__class__ = "RES.ResourceItem"
  5640. })(RES || (RES = {}));
  5641. (function(c) {
  5642. var d = function() {
  5643. function d() {
  5644. this.keyMap = {};
  5645. this.groupDic = {};
  5646. c.configInstance = this
  5647. }
  5648. d.prototype.getGroupByName = function(b) {
  5649. var a = [];
  5650. if (!this.groupDic[b]) return a;
  5651. b = this.groupDic[b];
  5652. for (var e = b.length, c = 0; c < e; c++) a.push(this.parseResourceItem(b[c]));
  5653. return a
  5654. };
  5655. d.prototype.getRawGroupByName = function(b) {
  5656. return this.groupDic[b] ? this.groupDic[b] : []
  5657. };
  5658. d.prototype.createGroup = function(b, a, e) {
  5659. void 0 === e && (e = !1);
  5660. if (!e && this.groupDic[b] || !a || 0 == a.length) return !1;
  5661. e = this.groupDic;
  5662. for (var c = [], d = a.length,
  5663. f = 0; f < d; f++) {
  5664. var g = a[f],
  5665. h = e[g];
  5666. if (h)
  5667. for (var g = h.length, m = 0; m < g; m++) {
  5668. var k = h[m]; - 1 == c.indexOf(k) && c.push(k)
  5669. } else(k = this.keyMap[g]) && -1 == c.indexOf(k) && c.push(k)
  5670. }
  5671. if (0 == c.length) return !1;
  5672. this.groupDic[b] = c;
  5673. return !0
  5674. };
  5675. d.prototype.parseConfig = function(b, a) {
  5676. if (b) {
  5677. var e = b.resources;
  5678. if (e)
  5679. for (var c = e.length, d = 0; d < c; d++) {
  5680. var f = e[d],
  5681. g = f.url;
  5682. g && -1 == g.indexOf("://") && (f.url = a + g);
  5683. this.addItemToKeyMap(f)
  5684. }
  5685. if (e = b.groups)
  5686. for (c = e.length, d = 0; d < c; d++) {
  5687. for (var g = e[d], h = [], m = g.keys.split(","), k = m.length, p = 0; p < k; p++) f = m[p].trim(), (f = this.keyMap[f]) && -1 == h.indexOf(f) && h.push(f);
  5688. this.groupDic[g.name] = h
  5689. }
  5690. }
  5691. };
  5692. d.prototype.addSubkey = function(b, a) {
  5693. var e = this.keyMap[a];
  5694. e && !this.keyMap[b] && (this.keyMap[b] = e)
  5695. };
  5696. d.prototype.addItemToKeyMap = function(b) {
  5697. this.keyMap[b.name] || (this.keyMap[b.name] = b);
  5698. if (b.hasOwnProperty("subkeys")) {
  5699. var a = b.subkeys.split(",");
  5700. b.subkeys = a;
  5701. for (var e = a.length, c = 0; c < e; c++) {
  5702. var d = a[c];
  5703. null == this.keyMap[d] && (this.keyMap[d] = b)
  5704. }
  5705. }
  5706. };
  5707. d.prototype.getName = function(b) {
  5708. return (b = this.keyMap[b]) ? b.name : ""
  5709. };
  5710. d.prototype.getType =
  5711. function(b) {
  5712. return (b = this.keyMap[b]) ? b.type : ""
  5713. };
  5714. d.prototype.getRawResourceItem = function(b) {
  5715. return this.keyMap[b]
  5716. };
  5717. d.prototype.getResourceItem = function(b) {
  5718. return (b = this.keyMap[b]) ? this.parseResourceItem(b) : null
  5719. };
  5720. d.prototype.parseResourceItem = function(b) {
  5721. var a = new c.ResourceItem(b.name, b.url, b.type);
  5722. a.data = b;
  5723. return a
  5724. };
  5725. return d
  5726. }();
  5727. c.ResourceConfig = d;
  5728. d.prototype.__class__ = "RES.ResourceConfig"
  5729. })(RES || (RES = {}));
  5730. __extends = this.__extends || function(c, d) {
  5731. function f() {
  5732. this.constructor = c
  5733. }
  5734. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5735. f.prototype = d.prototype;
  5736. c.prototype = new f
  5737. };
  5738. (function(c) {
  5739. var d = function(d) {
  5740. function b() {
  5741. d.call(this);
  5742. this.thread = 2;
  5743. this.loadingCount = 0;
  5744. this.groupTotalDic = {};
  5745. this.numLoadedDic = {};
  5746. this.itemListDic = {};
  5747. this.priorityQueue = {};
  5748. this.lazyLoadList = [];
  5749. this.analyzerDic = {};
  5750. this.queueIndex = 0
  5751. }
  5752. __extends(b, d);
  5753. b.prototype.isGroupInLoading = function(a) {
  5754. return void 0 !== this.itemListDic[a]
  5755. };
  5756. b.prototype.loadGroup = function(a, e, b) {
  5757. void 0 === b && (b = 0);
  5758. if (!this.itemListDic[e] && e)
  5759. if (a && 0 != a.length) {
  5760. this.priorityQueue[b] ? this.priorityQueue[b].push(e) : this.priorityQueue[b] =
  5761. [e];
  5762. this.itemListDic[e] = a;
  5763. b = a.length;
  5764. for (var d = 0; d < b; d++) a[d].groupName = e;
  5765. this.groupTotalDic[e] = a.length;
  5766. this.numLoadedDic[e] = 0;
  5767. this.next()
  5768. } else egret.Logger.warning('RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4\uff1a"' + e + '"'), a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE), a.groupName = e, this.dispatchEvent(a)
  5769. };
  5770. b.prototype.loadItem = function(a) {
  5771. this.lazyLoadList.push(a);
  5772. a.groupName = "";
  5773. this.next()
  5774. };
  5775. b.prototype.next = function() {
  5776. for (; this.loadingCount < this.thread;) {
  5777. var a =
  5778. this.getOneResourceItem();
  5779. if (!a) break;
  5780. this.loadingCount++;
  5781. if (a.loaded) this.onItemComplete(a);
  5782. else {
  5783. var e = this.analyzerDic[a.type];
  5784. e || (e = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  5785. e.loadFile(a, this.onItemComplete, this)
  5786. }
  5787. }
  5788. };
  5789. b.prototype.getOneResourceItem = function() {
  5790. var a = Number.NEGATIVE_INFINITY,
  5791. e;
  5792. for (e in this.priorityQueue) a = Math.max(a, e);
  5793. a = this.priorityQueue[a];
  5794. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  5795. e = a.length;
  5796. for (var b, c =
  5797. 0; c < e; c++) {
  5798. this.queueIndex >= e && (this.queueIndex = 0);
  5799. b = this.itemListDic[a[this.queueIndex]];
  5800. if (0 < b.length) break;
  5801. this.queueIndex++
  5802. }
  5803. return 0 == b.length ? null : b.shift()
  5804. };
  5805. b.prototype.onItemComplete = function(a) {
  5806. this.loadingCount--;
  5807. var e = a.groupName;
  5808. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, e, a);
  5809. if (e) {
  5810. this.numLoadedDic[e] ++;
  5811. var b = this.numLoadedDic[e],
  5812. d = this.groupTotalDic[e];
  5813. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS,
  5814. e, a, b, d);
  5815. b == d && (this.removeGroupName(e), delete this.groupTotalDic[e], delete this.numLoadedDic[e], delete this.itemListDic[e], c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, e))
  5816. } else this.callBack.call(this.resInstance, a);
  5817. this.next()
  5818. };
  5819. b.prototype.removeGroupName = function(a) {
  5820. for (var e in this.priorityQueue) {
  5821. for (var b = this.priorityQueue[e], c = b.length, d = 0, f = !1, c = b.length, h = 0; h < c; h++) {
  5822. if (b[h] == a) {
  5823. b.splice(d, 1);
  5824. f = !0;
  5825. break
  5826. }
  5827. d++
  5828. }
  5829. if (f) {
  5830. 0 == b.length && delete this.priorityQueue[e];
  5831. break
  5832. }
  5833. }
  5834. };
  5835. return b
  5836. }(egret.EventDispatcher);
  5837. c.ResourceLoader = d;
  5838. d.prototype.__class__ = "RES.ResourceLoader"
  5839. })(RES || (RES = {}));
  5840. __extends = this.__extends || function(c, d) {
  5841. function f() {
  5842. this.constructor = c
  5843. }
  5844. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5845. f.prototype = d.prototype;
  5846. c.prototype = new f
  5847. };
  5848. (function(c) {
  5849. var d = function(d) {
  5850. function b() {
  5851. d.call(this);
  5852. this.resourceConfig = c.configInstance
  5853. }
  5854. __extends(b, d);
  5855. b.prototype.addSubkey = function(a, e) {
  5856. this.resourceConfig.addSubkey(a, e)
  5857. };
  5858. b.prototype.loadFile = function(a, e, b) {};
  5859. b.prototype.getRes = function(a) {};
  5860. b.prototype.destroyRes = function(a) {
  5861. return !1
  5862. };
  5863. b.getStringPrefix = function(a) {
  5864. if (!a) return "";
  5865. var e = a.indexOf(".");
  5866. return -1 != e ? a.substring(0, e) : ""
  5867. };
  5868. b.getStringTail = function(a) {
  5869. if (!a) return "";
  5870. var e = a.indexOf(".");
  5871. return -1 != e ? a.substring(e + 1) : ""
  5872. };
  5873. return b
  5874. }(egret.HashObject);
  5875. c.AnalyzerBase = d;
  5876. d.prototype.__class__ = "RES.AnalyzerBase"
  5877. })(RES || (RES = {}));
  5878. __extends = this.__extends || function(c, d) {
  5879. function f() {
  5880. this.constructor = c
  5881. }
  5882. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5883. f.prototype = d.prototype;
  5884. c.prototype = new f
  5885. };
  5886. (function(c) {
  5887. var d = function(c) {
  5888. function b() {
  5889. c.call(this);
  5890. this.fileDic = {};
  5891. this.resItemDic = [];
  5892. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  5893. this.recycler = new egret.Recycler
  5894. }
  5895. __extends(b, c);
  5896. b.prototype.loadFile = function(a, e, b) {
  5897. if (this.fileDic[a.name]) e.call(b, a);
  5898. else {
  5899. var c = this.getLoader();
  5900. this.resItemDic[c.hashCode] = {
  5901. item: a,
  5902. func: e,
  5903. thisObject: b
  5904. };
  5905. c.load(new egret.URLRequest(a.url))
  5906. }
  5907. };
  5908. b.prototype.getLoader = function() {
  5909. var a = this.recycler.pop();
  5910. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  5911. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  5912. a.dataFormat = this._dataFormat;
  5913. return a
  5914. };
  5915. b.prototype.onLoadFinish = function(a) {
  5916. var e = a.target,
  5917. b = this.resItemDic[e.hashCode];
  5918. delete this.resItemDic[e.hashCode];
  5919. this.recycler.push(e);
  5920. var c = b.item,
  5921. d = b.func;
  5922. c.loaded = a.type == egret.Event.COMPLETE;
  5923. c.loaded && this.analyzeData(c, e.data);
  5924. d.call(b.thisObject, c)
  5925. };
  5926. b.prototype.analyzeData = function(a, e) {
  5927. var b = a.name;
  5928. !this.fileDic[b] && e && (this.fileDic[b] = e)
  5929. };
  5930. b.prototype.getRes =
  5931. function(a) {
  5932. return this.fileDic[a]
  5933. };
  5934. b.prototype.hasRes = function(a) {
  5935. return null != this.getRes(a)
  5936. };
  5937. b.prototype.destroyRes = function(a) {
  5938. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  5939. };
  5940. return b
  5941. }(c.AnalyzerBase);
  5942. c.BinAnalyzer = d;
  5943. d.prototype.__class__ = "RES.BinAnalyzer"
  5944. })(RES || (RES = {}));
  5945. __extends = this.__extends || function(c, d) {
  5946. function f() {
  5947. this.constructor = c
  5948. }
  5949. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5950. f.prototype = d.prototype;
  5951. c.prototype = new f
  5952. };
  5953. (function(c) {
  5954. var d = function(c) {
  5955. function b() {
  5956. c.call(this);
  5957. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  5958. }
  5959. __extends(b, c);
  5960. b.prototype.analyzeData = function(a, e) {
  5961. var b = a.name;
  5962. !this.fileDic[b] && e && (this.fileDic[b] = e, (b = a.data) && b.scale9grid && (b = b.scale9grid.split(","), e.scale9Grid = new egret.Rectangle(parseInt(b[0]), parseInt(b[1]), parseInt(b[2]), parseInt(b[3]))))
  5963. };
  5964. return b
  5965. }(c.BinAnalyzer);
  5966. c.ImageAnalyzer = d;
  5967. d.prototype.__class__ = "RES.ImageAnalyzer"
  5968. })(RES || (RES = {}));
  5969. __extends = this.__extends || function(c, d) {
  5970. function f() {
  5971. this.constructor = c
  5972. }
  5973. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  5974. f.prototype = d.prototype;
  5975. c.prototype = new f
  5976. };
  5977. (function(c) {
  5978. var d = function(c) {
  5979. function b() {
  5980. c.call(this);
  5981. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5982. }
  5983. __extends(b, c);
  5984. b.prototype.analyzeData = function(a, e) {
  5985. var b = a.name;
  5986. if (!this.fileDic[b] && e) try {
  5987. this.fileDic[b] = JSON.parse(e)
  5988. } catch (c) {
  5989. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url + "\ndata:" + e)
  5990. }
  5991. };
  5992. return b
  5993. }(c.BinAnalyzer);
  5994. c.JsonAnalyzer = d;
  5995. d.prototype.__class__ = "RES.JsonAnalyzer"
  5996. })(RES || (RES = {}));
  5997. __extends = this.__extends || function(c, d) {
  5998. function f() {
  5999. this.constructor = c
  6000. }
  6001. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6002. f.prototype = d.prototype;
  6003. c.prototype = new f
  6004. };
  6005. (function(c) {
  6006. var d = function(c) {
  6007. function b() {
  6008. c.call(this);
  6009. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6010. }
  6011. __extends(b, c);
  6012. return b
  6013. }(c.BinAnalyzer);
  6014. c.TextAnalyzer = d;
  6015. d.prototype.__class__ = "RES.TextAnalyzer"
  6016. })(RES || (RES = {}));
  6017. __extends = this.__extends || function(c, d) {
  6018. function f() {
  6019. this.constructor = c
  6020. }
  6021. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6022. f.prototype = d.prototype;
  6023. c.prototype = new f
  6024. };
  6025. (function(c) {
  6026. var d = function(d) {
  6027. function b() {
  6028. d.call(this);
  6029. this.sheetMap = {};
  6030. this.textureMap = {};
  6031. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6032. }
  6033. __extends(b, d);
  6034. b.prototype.getRes = function(a) {
  6035. var e = this.fileDic[a];
  6036. e || (e = this.textureMap[a]);
  6037. !e && (e = c.AnalyzerBase.getStringPrefix(a), e = this.fileDic[e]) && (a = c.AnalyzerBase.getStringTail(a), e = e.getTexture(a));
  6038. return e
  6039. };
  6040. b.prototype.onLoadFinish = function(a) {
  6041. var e = a.target,
  6042. b = this.resItemDic[e.hashCode];
  6043. delete this.resItemDic[e.hashCode];
  6044. this.recycler.push(e);
  6045. var c =
  6046. b.item,
  6047. d = b.func;
  6048. c.loaded = a.type == egret.Event.COMPLETE;
  6049. c.loaded && this.analyzeData(c, e.data);
  6050. "string" == typeof e.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(c, d, b.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : d.call(b.thisObject, c)
  6051. };
  6052. b.prototype.analyzeData = function(a, e) {
  6053. var b = a.name;
  6054. if (!this.fileDic[b] && e) {
  6055. var c;
  6056. if ("string" == typeof e) {
  6057. try {
  6058. c = JSON.parse(e)
  6059. } catch (d) {
  6060. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  6061. }
  6062. c && (this.sheetMap[b] =
  6063. c, a.loaded = !1, a.url = this.getRelativePath(a.url, c.file))
  6064. } else c = this.sheetMap[b], delete this.sheetMap[b], e && (c = this.parseSpriteSheet(e, c, a.data && a.data.subkeys ? "" : b), this.fileDic[b] = c)
  6065. }
  6066. };
  6067. b.prototype.getRelativePath = function(a, e) {
  6068. a = a.split("\\").join("/");
  6069. var b = a.lastIndexOf("/");
  6070. return a = -1 != b ? a.substring(0, b + 1) + e : e
  6071. };
  6072. b.prototype.parseSpriteSheet = function(a, e, b) {
  6073. e = e.frames;
  6074. if (!e) return null;
  6075. var c = new egret.SpriteSheet(a),
  6076. d = this.textureMap,
  6077. f;
  6078. for (f in e) {
  6079. var h = e[f];
  6080. a = c.createTexture(f, h.x, h.y, h.w, h.h,
  6081. h.offX, h.offY, h.sourceW, h.sourceH);
  6082. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  6083. null == d[f] && (d[f] = a, b && this.addSubkey(f, b))
  6084. }
  6085. return c
  6086. };
  6087. return b
  6088. }(c.BinAnalyzer);
  6089. c.SheetAnalyzer = d;
  6090. d.prototype.__class__ = "RES.SheetAnalyzer"
  6091. })(RES || (RES = {}));
  6092. __extends = this.__extends || function(c, d) {
  6093. function f() {
  6094. this.constructor = c
  6095. }
  6096. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6097. f.prototype = d.prototype;
  6098. c.prototype = new f
  6099. };
  6100. (function(c) {
  6101. var d = function(c) {
  6102. function b() {
  6103. c.call(this)
  6104. }
  6105. __extends(b, c);
  6106. b.prototype.analyzeData = function(a, e) {
  6107. var b = a.name;
  6108. if (!this.fileDic[b] && e) {
  6109. var c;
  6110. "string" == typeof e ? (c = e, this.sheetMap[b] = c, a.loaded = !1, a.url = this.getTexturePath(a.url, c)) : (c = this.sheetMap[b], delete this.sheetMap[b], e && (c = new egret.BitmapTextSpriteSheet(e, c), this.fileDic[b] = c))
  6111. }
  6112. };
  6113. b.prototype.getTexturePath = function(a, e) {
  6114. var b = "",
  6115. c = e.split("\n")[2],
  6116. d = c.indexOf('file="'); - 1 != d && (c = c.substring(d + 6), d = c.indexOf('"'), b = c.substring(0,
  6117. d));
  6118. a = a.split("\\").join("/");
  6119. d = a.lastIndexOf("/");
  6120. return a = -1 != d ? a.substring(0, d + 1) + b : b
  6121. };
  6122. return b
  6123. }(c.SheetAnalyzer);
  6124. c.FontAnalyzer = d;
  6125. d.prototype.__class__ = "RES.FontAnalyzer"
  6126. })(RES || (RES = {}));
  6127. __extends = this.__extends || function(c, d) {
  6128. function f() {
  6129. this.constructor = c
  6130. }
  6131. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6132. f.prototype = d.prototype;
  6133. c.prototype = new f
  6134. };
  6135. (function(c) {
  6136. var d = function(c) {
  6137. function b() {
  6138. c.call(this);
  6139. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  6140. }
  6141. __extends(b, c);
  6142. b.prototype.analyzeData = function(a, e) {
  6143. var b = a.name;
  6144. !this.fileDic[b] && e && (this.fileDic[b] = e, (b = a.data) && b.soundType ? e.preload(b.soundType) : e.preload(egret.Sound.EFFECT))
  6145. };
  6146. return b
  6147. }(c.BinAnalyzer);
  6148. c.SoundAnalyzer = d;
  6149. d.prototype.__class__ = "RES.SoundAnalyzer"
  6150. })(RES || (RES = {}));
  6151. __extends = this.__extends || function(c, d) {
  6152. function f() {
  6153. this.constructor = c
  6154. }
  6155. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6156. f.prototype = d.prototype;
  6157. c.prototype = new f
  6158. };
  6159. (function(c) {
  6160. var d = function(c) {
  6161. function b() {
  6162. c.call(this);
  6163. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6164. }
  6165. __extends(b, c);
  6166. b.prototype.analyzeData = function(a, e) {
  6167. var b = a.name;
  6168. if (!this.fileDic[b] && e) try {
  6169. var c = egret.XML.parse(e);
  6170. this.fileDic[b] = c
  6171. } catch (d) {}
  6172. };
  6173. return b
  6174. }(c.BinAnalyzer);
  6175. c.XMLAnalyzer = d;
  6176. d.prototype.__class__ = "RES.XMLAnalyzer"
  6177. })(RES || (RES = {}));
  6178. __extends = this.__extends || function(c, d) {
  6179. function f() {
  6180. this.constructor = c
  6181. }
  6182. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6183. f.prototype = d.prototype;
  6184. c.prototype = new f
  6185. };
  6186. (function(c) {
  6187. c.loadConfig = function(b, a, e) {
  6188. void 0 === a && (a = "");
  6189. void 0 === e && (e = "json");
  6190. f.loadConfig(b, a, e)
  6191. };
  6192. c.loadGroup = function(b, a) {
  6193. void 0 === a && (a = 0);
  6194. f.loadGroup(b, a)
  6195. };
  6196. c.isGroupLoaded = function(b) {
  6197. return f.isGroupLoaded(b)
  6198. };
  6199. c.getGroupByName = function(b) {
  6200. return f.getGroupByName(b)
  6201. };
  6202. c.createGroup = function(b, a, e) {
  6203. void 0 === e && (e = !1);
  6204. return f.createGroup(b, a, e)
  6205. };
  6206. c.hasRes = function(b) {
  6207. return f.hasRes(b)
  6208. };
  6209. c.getRes = function(b) {
  6210. return f.getRes(b)
  6211. };
  6212. c.getResAsync = function(b, a, e) {
  6213. f.getResAsync(b, a, e)
  6214. };
  6215. c.getResByUrl =
  6216. function(b, a, e, c) {
  6217. void 0 === c && (c = "");
  6218. f.getResByUrl(b, a, e, c)
  6219. };
  6220. c.destroyRes = function(b) {
  6221. return f.destroyRes(b)
  6222. };
  6223. c.setMaxLoadingThread = function(b) {
  6224. f.setMaxLoadingThread(b)
  6225. };
  6226. c.addEventListener = function(b, a, e, c, d) {
  6227. void 0 === c && (c = !1);
  6228. void 0 === d && (d = 0);
  6229. f.addEventListener(b, a, e, c, d)
  6230. };
  6231. c.removeEventListener = function(b, a, e, c) {
  6232. void 0 === c && (c = !1);
  6233. f.removeEventListener(b, a, e, c)
  6234. };
  6235. var d = function(b) {
  6236. function a() {
  6237. b.call(this);
  6238. this.analyzerDic = {};
  6239. this.configItemList = [];
  6240. this.configComplete = this.callLaterFlag = !1;
  6241. this.loadedGroups =
  6242. [];
  6243. this.groupNameList = [];
  6244. this.asyncDic = {};
  6245. this.init()
  6246. }
  6247. __extends(a, b);
  6248. a.prototype.getAnalyzerByType = function(a) {
  6249. var b = this.analyzerDic[a];
  6250. b || (b = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  6251. return b
  6252. };
  6253. a.prototype.init = function() {
  6254. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  6255. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer,
  6256. c.ResourceItem.TYPE_IMAGE);
  6257. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  6258. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  6259. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  6260. egret.Injector.hasMapRule(c.AnalyzerBase,
  6261. c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  6262. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  6263. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  6264. this.resConfig = new c.ResourceConfig;
  6265. this.resLoader = new c.ResourceLoader;
  6266. this.resLoader.callBack = this.onResourceItemComp;
  6267. this.resLoader.resInstance = this;
  6268. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  6269. };
  6270. a.prototype.loadConfig = function(a, b, c) {
  6271. void 0 === c && (c = "json");
  6272. this.configItemList.push({
  6273. url: a,
  6274. resourceRoot: b,
  6275. type: c
  6276. });
  6277. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6278. };
  6279. a.prototype.startLoadConfig = function() {
  6280. this.callLaterFlag = !1;
  6281. var e = this.configItemList;
  6282. this.configItemList = [];
  6283. this.loadingConfigList = e;
  6284. for (var b = e.length, d = [], f = 0; f < b; f++) {
  6285. var g =
  6286. e[f],
  6287. g = new c.ResourceItem(g.url, g.url, g.type);
  6288. d.push(g)
  6289. }
  6290. this.resLoader.loadGroup(d, a.GROUP_CONFIG, Number.MAX_VALUE)
  6291. };
  6292. a.prototype.isGroupLoaded = function(a) {
  6293. return -1 != this.loadedGroups.indexOf(a)
  6294. };
  6295. a.prototype.getGroupByName = function(a) {
  6296. return this.resConfig.getGroupByName(a)
  6297. };
  6298. a.prototype.loadGroup = function(a, b) {
  6299. void 0 === b && (b = 0);
  6300. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  6301. if (this.configComplete) {
  6302. var c = this.resConfig.getGroupByName(a);
  6303. this.resLoader.loadGroup(c, a, b)
  6304. } else this.groupNameList.push({
  6305. name: a,
  6306. priority: b
  6307. })
  6308. };
  6309. a.prototype.createGroup = function(a, b, c) {
  6310. void 0 === c && (c = !1);
  6311. if (c) {
  6312. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  6313. }
  6314. return this.resConfig.createGroup(a, b, c)
  6315. };
  6316. a.prototype.onGroupComp = function(e) {
  6317. if (e.groupName == a.GROUP_CONFIG) {
  6318. e = this.loadingConfigList.length;
  6319. for (var b = 0; b < e; b++) {
  6320. var d = this.loadingConfigList[b],
  6321. f = this.getAnalyzerByType(d.type),
  6322. g = f.getRes(d.url);
  6323. f.destroyRes(d.url);
  6324. this.resConfig.parseConfig(g, d.resourceRoot)
  6325. }
  6326. this.configComplete = !0;
  6327. this.loadingConfigList =
  6328. null;
  6329. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  6330. d = this.groupNameList;
  6331. e = d.length;
  6332. for (b = 0; b < e; b++) f = d[b], this.loadGroup(f.name, f.priority);
  6333. this.groupNameList = []
  6334. } else this.loadedGroups.push(e.groupName), this.dispatchEvent(e)
  6335. };
  6336. a.prototype.hasRes = function(a) {
  6337. var b = this.resConfig.getType(a);
  6338. return "" == b && (a = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(a), "" == b) ? !1 : !0
  6339. };
  6340. a.prototype.getRes = function(a) {
  6341. var b = this.resConfig.getType(a);
  6342. return "" == b && (b = c.AnalyzerBase.getStringPrefix(a),
  6343. b = this.resConfig.getType(b), "" == b) ? null : this.getAnalyzerByType(b).getRes(a)
  6344. };
  6345. a.prototype.getResAsync = function(a, b, d) {
  6346. var f = this.resConfig.getType(a),
  6347. g = this.resConfig.getName(a);
  6348. if ("" == f && (g = c.AnalyzerBase.getStringPrefix(a), f = this.resConfig.getType(g), "" == f)) {
  6349. b.call(d, null);
  6350. return
  6351. }(f = this.getAnalyzerByType(f).getRes(a)) ? b.call(d, f): (a = {
  6352. key: a,
  6353. compFunc: b,
  6354. thisObject: d
  6355. }, this.asyncDic[g] ? this.asyncDic[g].push(a) : (this.asyncDic[g] = [a], g = this.resConfig.getResourceItem(g), this.resLoader.loadItem(g)))
  6356. };
  6357. a.prototype.getResByUrl =
  6358. function(a, b, d, f) {
  6359. void 0 === f && (f = "");
  6360. if (a) {
  6361. f || (f = this.getTypeByUrl(a));
  6362. var g = this.getAnalyzerByType(f).getRes(a);
  6363. g ? b.call(d, g) : (b = {
  6364. key: a,
  6365. compFunc: b,
  6366. thisObject: d
  6367. }, this.asyncDic[a] ? this.asyncDic[a].push(b) : (this.asyncDic[a] = [b], a = new c.ResourceItem(a, a, f), this.resLoader.loadItem(a)))
  6368. } else b.call(d, null)
  6369. };
  6370. a.prototype.getTypeByUrl = function(a) {
  6371. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6372. switch (a) {
  6373. case c.ResourceItem.TYPE_XML:
  6374. case c.ResourceItem.TYPE_JSON:
  6375. case c.ResourceItem.TYPE_SHEET:
  6376. break;
  6377. case "png":
  6378. case "jpg":
  6379. case "gif":
  6380. a = c.ResourceItem.TYPE_IMAGE;
  6381. break;
  6382. case "fnt":
  6383. a = c.ResourceItem.TYPE_FONT;
  6384. break;
  6385. case "txt":
  6386. a = c.ResourceItem.TYPE_TEXT;
  6387. break;
  6388. case "mp3":
  6389. case "ogg":
  6390. case "mpeg":
  6391. case "wav":
  6392. case "m4a":
  6393. case "mp4":
  6394. case "aiff":
  6395. case "wma":
  6396. case "mid":
  6397. a = c.ResourceItem.TYPE_SOUND;
  6398. break;
  6399. default:
  6400. a = c.ResourceItem.TYPE_BIN
  6401. }
  6402. return a
  6403. };
  6404. a.prototype.onResourceItemComp = function(a) {
  6405. var b = this.asyncDic[a.name];
  6406. delete this.asyncDic[a.name];
  6407. a = this.getAnalyzerByType(a.type);
  6408. for (var c = b.length, d = 0; d < c; d++) {
  6409. var f =
  6410. b[d],
  6411. h = a.getRes(f.key);
  6412. f.compFunc.call(f.thisObject, h, f.key)
  6413. }
  6414. };
  6415. a.prototype.destroyRes = function(a) {
  6416. var b = this.resConfig.getRawGroupByName(a);
  6417. if (b) {
  6418. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  6419. a = b.length;
  6420. for (var d = 0; d < a; d++) {
  6421. c = b[d];
  6422. c.loaded = !1;
  6423. var f = this.getAnalyzerByType(c.type);
  6424. f.destroyRes(c.name)
  6425. }
  6426. return !0
  6427. }
  6428. b = this.resConfig.getType(a);
  6429. if ("" == b) return !1;
  6430. c = this.resConfig.getRawResourceItem(a);
  6431. c.loaded = !1;
  6432. f = this.getAnalyzerByType(b);
  6433. return f.destroyRes(a)
  6434. };
  6435. a.prototype.setMaxLoadingThread =
  6436. function(a) {
  6437. 1 > a && (a = 1);
  6438. this.resLoader.thread = a
  6439. };
  6440. a.GROUP_CONFIG = "RES__CONFIG";
  6441. return a
  6442. }(egret.EventDispatcher);
  6443. d.prototype.__class__ = "RES.Resource";
  6444. var f = new d
  6445. })(RES || (RES = {}));
  6446. __extends = this.__extends || function(c, d) {
  6447. function f() {
  6448. this.constructor = c
  6449. }
  6450. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6451. f.prototype = d.prototype;
  6452. c.prototype = new f
  6453. };
  6454. (function(c) {
  6455. (function(d) {
  6456. var f = function(b) {
  6457. function a() {
  6458. b.call(this);
  6459. this.targetLevel = Number.MAX_VALUE;
  6460. this.updateCompleteQueue = new d.DepthQueue;
  6461. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  6462. this.invalidatePropertiesQueue = new d.DepthQueue;
  6463. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  6464. this.invalidateSizeQueue = new d.DepthQueue;
  6465. this.invalidateDisplayListFlag = !1;
  6466. this.invalidateDisplayListQueue = new d.DepthQueue;
  6467. this.listenersAttached = !1
  6468. }
  6469. __extends(a, b);
  6470. a.prototype.invalidateProperties =
  6471. function(a) {
  6472. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  6473. this.targetLevel <= a.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  6474. this.invalidatePropertiesQueue.insert(a)
  6475. };
  6476. a.prototype.validateProperties = function() {
  6477. for (var a = this.invalidatePropertiesQueue.shift(); a;) a.parent && (a.validateProperties(), a.updateCompletePendingFlag || (this.updateCompleteQueue.insert(a), a.updateCompletePendingFlag = !0)), a = this.invalidatePropertiesQueue.shift();
  6478. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  6479. };
  6480. a.prototype.invalidateSize = function(a) {
  6481. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  6482. this.targetLevel <= a.nestLevel && (this.invalidateClientSizeFlag = !0);
  6483. this.invalidateSizeQueue.insert(a)
  6484. };
  6485. a.prototype.validateSize = function() {
  6486. for (var a = this.invalidateSizeQueue.pop(); a;) a.parent && (a.validateSize(), a.updateCompletePendingFlag || (this.updateCompleteQueue.insert(a), a.updateCompletePendingFlag = !0)), a = this.invalidateSizeQueue.pop();
  6487. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  6488. };
  6489. a.prototype.invalidateDisplayList = function(a) {
  6490. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  6491. this.invalidateDisplayListQueue.insert(a)
  6492. };
  6493. a.prototype.validateDisplayList = function() {
  6494. for (var a = this.invalidateDisplayListQueue.shift(); a;) a.parent && (a.validateDisplayList(), a.updateCompletePendingFlag || (this.updateCompleteQueue.insert(a),
  6495. a.updateCompletePendingFlag = !0)), a = this.invalidateDisplayListQueue.shift();
  6496. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  6497. };
  6498. a.prototype.attachListeners = function() {
  6499. d.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  6500. d.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  6501. d.UIGlobals.stage.invalidate();
  6502. this.listenersAttached = !0
  6503. };
  6504. a.prototype.doPhasedInstantiationCallBack = function(a) {
  6505. d.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  6506. this.doPhasedInstantiationCallBack, this);
  6507. d.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  6508. this.doPhasedInstantiation()
  6509. };
  6510. a.prototype.doPhasedInstantiation = function() {
  6511. this.invalidatePropertiesFlag && this.validateProperties();
  6512. this.invalidateSizeFlag && this.validateSize();
  6513. this.invalidateDisplayListFlag && this.validateDisplayList();
  6514. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  6515. else {
  6516. this.listenersAttached = !1;
  6517. for (var a = this.updateCompleteQueue.pop(); a;) a.initialized || (a.initialized = !0), a.hasEventListener(d.UIEvent.UPDATE_COMPLETE) && d.UIEvent.dispatchUIEvent(a, d.UIEvent.UPDATE_COMPLETE), a.updateCompletePendingFlag = !1, a = this.updateCompleteQueue.pop();
  6518. d.UIEvent.dispatchUIEvent(this, d.UIEvent.UPDATE_COMPLETE)
  6519. }
  6520. };
  6521. a.prototype.validateNow = function() {
  6522. for (var a = 0; this.listenersAttached && 100 > a++;) this.doPhasedInstantiationCallBack()
  6523. };
  6524. a.prototype.validateClient = function(a, b) {
  6525. void 0 === b && (b = !1);
  6526. var c, f = !1,
  6527. g = this.targetLevel;
  6528. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = a.nestLevel);
  6529. for (; !f;) {
  6530. f = !0;
  6531. for (c = this.invalidatePropertiesQueue.removeSmallestChild(a); c;) c.parent && (c.validateProperties(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0)), c = this.invalidatePropertiesQueue.removeSmallestChild(a);
  6532. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  6533. this.invalidateClientPropertiesFlag = !1;
  6534. for (c = this.invalidateSizeQueue.removeLargestChild(a); c;) {
  6535. c.parent &&
  6536. (c.validateSize(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0));
  6537. if (this.invalidateClientPropertiesFlag && (c = this.invalidatePropertiesQueue.removeSmallestChild(a))) {
  6538. this.invalidatePropertiesQueue.insert(c);
  6539. f = !1;
  6540. break
  6541. }
  6542. c = this.invalidateSizeQueue.removeLargestChild(a)
  6543. }
  6544. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  6545. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  6546. if (!b) {
  6547. for (c = this.invalidateDisplayListQueue.removeSmallestChild(a); c;) {
  6548. c.parent &&
  6549. (c.validateDisplayList(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0));
  6550. if (this.invalidateClientPropertiesFlag && (c = this.invalidatePropertiesQueue.removeSmallestChild(a))) {
  6551. this.invalidatePropertiesQueue.insert(c);
  6552. f = !1;
  6553. break
  6554. }
  6555. if (this.invalidateClientSizeFlag && (c = this.invalidateSizeQueue.removeLargestChild(a))) {
  6556. this.invalidateSizeQueue.insert(c);
  6557. f = !1;
  6558. break
  6559. }
  6560. c = this.invalidateDisplayListQueue.removeSmallestChild(a)
  6561. }
  6562. this.invalidateDisplayListQueue.isEmpty() &&
  6563. (this.invalidateDisplayListFlag = !1)
  6564. }
  6565. }
  6566. if (g == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !b))
  6567. for (c = this.updateCompleteQueue.removeLargestChild(a); c;) c.initialized || (c.initialized = !0), c.hasEventListener(d.UIEvent.UPDATE_COMPLETE) && d.UIEvent.dispatchUIEvent(c, d.UIEvent.UPDATE_COMPLETE), c.updateCompletePendingFlag = !1, c = this.updateCompleteQueue.removeLargestChild(a)
  6568. };
  6569. return a
  6570. }(c.EventDispatcher);
  6571. d.LayoutManager = f;
  6572. f.prototype.__class__ = "egret.gui.LayoutManager"
  6573. })(c.gui || (c.gui = {}))
  6574. })(egret || (egret = {}));
  6575. (function(c) {
  6576. (function(d) {
  6577. var f = function() {
  6578. function a() {
  6579. this.depthBins = [];
  6580. this.minDepth = 0;
  6581. this.maxDepth = -1
  6582. }
  6583. a.prototype.insert = function(a) {
  6584. var c = a.nestLevel,
  6585. d = a.hashCode;
  6586. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = c : (c < this.minDepth && (this.minDepth = c), c > this.maxDepth && (this.maxDepth = c));
  6587. var f = this.depthBins[c];
  6588. f ? null == f.items[d] && (f.items[d] = a, f.length++) : (f = new b, this.depthBins[c] = f, f.items[d] = a, f.length++)
  6589. };
  6590. a.prototype.pop = function() {
  6591. var a = null;
  6592. if (this.minDepth <= this.maxDepth) {
  6593. for (var b = this.depthBins[this.maxDepth]; !b ||
  6594. 0 == b.length;) {
  6595. this.maxDepth--;
  6596. if (this.maxDepth < this.minDepth) return null;
  6597. b = this.depthBins[this.maxDepth]
  6598. }
  6599. var c = b.items,
  6600. d;
  6601. for (d in c) {
  6602. a = c[d];
  6603. this.remove(a, this.maxDepth);
  6604. break
  6605. }
  6606. for (; !b || 0 == b.length;) {
  6607. this.maxDepth--;
  6608. if (this.maxDepth < this.minDepth) break;
  6609. b = this.depthBins[this.maxDepth]
  6610. }
  6611. }
  6612. return a
  6613. };
  6614. a.prototype.shift = function() {
  6615. var a = null;
  6616. if (this.minDepth <= this.maxDepth) {
  6617. for (var b = this.depthBins[this.minDepth]; !b || 0 == b.length;) {
  6618. this.minDepth++;
  6619. if (this.minDepth > this.maxDepth) return null;
  6620. b = this.depthBins[this.minDepth]
  6621. }
  6622. var c =
  6623. b.items,
  6624. d;
  6625. for (d in c) {
  6626. a = c[d];
  6627. this.remove(a, this.minDepth);
  6628. break
  6629. }
  6630. for (; !b || 0 == b.length;) {
  6631. this.minDepth++;
  6632. if (this.minDepth > this.maxDepth) break;
  6633. b = this.depthBins[this.minDepth]
  6634. }
  6635. }
  6636. return a
  6637. };
  6638. a.prototype.removeLargestChild = function(a) {
  6639. for (var b = this.maxDepth, d = a.nestLevel, f = a.hashCode; d <= b;) {
  6640. var g = this.depthBins[b];
  6641. if (g && 0 < g.length) {
  6642. if (b == a.nestLevel) {
  6643. if (g.items[f]) return this.remove(a, b), a
  6644. } else {
  6645. var g = g.items,
  6646. h;
  6647. for (h in g) {
  6648. var m = g[h];
  6649. if (m instanceof c.DisplayObject && a instanceof c.DisplayObjectContainer &&
  6650. a.contains(m)) return this.remove(m, b), m
  6651. }
  6652. }
  6653. b--
  6654. } else if (b == this.maxDepth && this.maxDepth--, b--, b < d) break
  6655. }
  6656. return null
  6657. };
  6658. a.prototype.removeSmallestChild = function(a) {
  6659. for (var b = a.nestLevel, d = a.hashCode; b <= this.maxDepth;) {
  6660. var f = this.depthBins[b];
  6661. if (f && 0 < f.length) {
  6662. if (b == a.nestLevel) {
  6663. if (f.items[d]) return this.remove(a, b), a
  6664. } else {
  6665. var f = f.items,
  6666. g;
  6667. for (g in f) {
  6668. var h = f[g];
  6669. if (h instanceof c.DisplayObject && a instanceof c.DisplayObjectContainer && a.contains(h)) return this.remove(h, b), h
  6670. }
  6671. }
  6672. b++
  6673. } else if (b == this.minDepth && this.minDepth++,
  6674. b++, b > this.maxDepth) break
  6675. }
  6676. return null
  6677. };
  6678. a.prototype.remove = function(a, b) {
  6679. void 0 === b && (b = -1);
  6680. var c = a.hashCode,
  6681. d = this.depthBins[0 <= b ? b : a.nestLevel];
  6682. return d && null != d.items[c] ? (delete d.items[c], d.length--, a) : null
  6683. };
  6684. a.prototype.removeAll = function() {
  6685. this.minDepth = this.depthBins.length = 0;
  6686. this.maxDepth = -1
  6687. };
  6688. a.prototype.isEmpty = function() {
  6689. return this.minDepth > this.maxDepth
  6690. };
  6691. return a
  6692. }();
  6693. d.DepthQueue = f;
  6694. f.prototype.__class__ = "egret.gui.DepthQueue";
  6695. var b = function() {
  6696. return function() {
  6697. this.length = 0;
  6698. this.items = []
  6699. }
  6700. }();
  6701. d.DepthBin = b;
  6702. b.prototype.__class__ = "egret.gui.DepthBin"
  6703. })(c.gui || (c.gui = {}))
  6704. })(egret || (egret = {}));
  6705. (function(c) {
  6706. (function(c) {
  6707. var f = function() {
  6708. function b() {}
  6709. Object.defineProperty(b, "stage", {
  6710. get: function() {
  6711. return b._stage
  6712. },
  6713. enumerable: !0,
  6714. configurable: !0
  6715. });
  6716. b._initlize = function(a) {
  6717. b.initlized || (b._stage = a, b._layoutManager = new c.LayoutManager, b.initlized = !0)
  6718. };
  6719. Object.defineProperty(b, "uiStage", {
  6720. get: function() {
  6721. return b._uiStage
  6722. },
  6723. enumerable: !0,
  6724. configurable: !0
  6725. });
  6726. b.initlized = !1;
  6727. return b
  6728. }();
  6729. c.UIGlobals = f;
  6730. f.prototype.__class__ = "egret.gui.UIGlobals"
  6731. })(c.gui || (c.gui = {}))
  6732. })(egret || (egret = {}));
  6733. __extends = this.__extends || function(c, d) {
  6734. function f() {
  6735. this.constructor = c
  6736. }
  6737. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  6738. f.prototype = d.prototype;
  6739. c.prototype = new f
  6740. };
  6741. (function(c) {
  6742. (function(d) {
  6743. var f = function(b) {
  6744. function a() {
  6745. b.call(this);
  6746. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  6747. this._nestLevel = 0;
  6748. this._enabled = !0;
  6749. this._minWidth = this._height = this._width = 0;
  6750. this._maxWidth = 1E4;
  6751. this._minHeight = 0;
  6752. this._maxHeight = 1E4;
  6753. this._measuredHeight = this._measuredWidth = 0;
  6754. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  6755. this._includeInLayout = !0;
  6756. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  6757. this.touchEnabled = !0;
  6758. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6759. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  6760. }
  6761. __extends(a, b);
  6762. a.prototype.onAddedToStage = function(a) {
  6763. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6764. this._initialize();
  6765. d.UIGlobals._initlize(this.stage);
  6766. 0 < this._nestLevel && this.checkInvalidateFlag()
  6767. };
  6768. Object.defineProperty(a.prototype, "id", {
  6769. get: function() {
  6770. return this._id
  6771. },
  6772. set: function(a) {
  6773. this._id = a
  6774. },
  6775. enumerable: !0,
  6776. configurable: !0
  6777. });
  6778. Object.defineProperty(a.prototype, "isPopUp", {
  6779. get: function() {
  6780. return this._isPopUp
  6781. },
  6782. set: function(a) {
  6783. this._isPopUp = a
  6784. },
  6785. enumerable: !0,
  6786. configurable: !0
  6787. });
  6788. Object.defineProperty(a.prototype, "owner", {
  6789. get: function() {
  6790. return this._owner ? this._owner : this.parent
  6791. },
  6792. enumerable: !0,
  6793. configurable: !0
  6794. });
  6795. a.prototype.ownerChanged = function(a) {
  6796. this._owner = a
  6797. };
  6798. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  6799. get: function() {
  6800. return this._updateCompletePendingFlag
  6801. },
  6802. set: function(a) {
  6803. this._updateCompletePendingFlag =
  6804. a
  6805. },
  6806. enumerable: !0,
  6807. configurable: !0
  6808. });
  6809. Object.defineProperty(a.prototype, "initialized", {
  6810. get: function() {
  6811. return this._initialized
  6812. },
  6813. set: function(a) {
  6814. this._initialized != a && (this._initialized = a) && d.UIEvent.dispatchUIEvent(this, d.UIEvent.CREATION_COMPLETE)
  6815. },
  6816. enumerable: !0,
  6817. configurable: !0
  6818. });
  6819. a.prototype._initialize = function() {
  6820. this.initializeCalled || (d.UIGlobals.stage && this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, d.UIEvent.dispatchUIEvent(this, d.UIEvent.INITIALIZE),
  6821. this.createChildren(), this.childrenCreated())
  6822. };
  6823. a.prototype.createChildren = function() {};
  6824. a.prototype.childrenCreated = function() {
  6825. this.invalidateProperties();
  6826. this.invalidateSize();
  6827. this.invalidateDisplayList()
  6828. };
  6829. Object.defineProperty(a.prototype, "nestLevel", {
  6830. get: function() {
  6831. return this._nestLevel
  6832. },
  6833. set: function(a) {
  6834. if (this._nestLevel != a)
  6835. for (this._nestLevel = a, 0 == this._nestLevel ? this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag,
  6836. this), a = this.numChildren - 1; 0 <= a; a--) {
  6837. var b = this.getChildAt(a);
  6838. null != b && (b.nestLevel = this._nestLevel + 1)
  6839. }
  6840. },
  6841. enumerable: !0,
  6842. configurable: !0
  6843. });
  6844. a.prototype._addToDisplayList = function(a, b) {
  6845. void 0 === b && (b = !0);
  6846. var c = this.numChildren;
  6847. a.parent == this && c--;
  6848. this._addingChild(a);
  6849. this._doAddChild(a, c, b);
  6850. this._childAdded(a);
  6851. return a
  6852. };
  6853. a.prototype._addToDisplayListAt = function(a, b, c) {
  6854. void 0 === c && (c = !0);
  6855. this._addingChild(a);
  6856. this._doAddChild(a, b, c);
  6857. this._childAdded(a);
  6858. return a
  6859. };
  6860. a.prototype._removeFromDisplayList = function(a,
  6861. b) {
  6862. void 0 === b && (b = !0);
  6863. var d = this._children.indexOf(a);
  6864. if (0 <= d) return this._doRemoveChild(d, b), this._childRemoved(a), a;
  6865. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  6866. return null
  6867. };
  6868. a.prototype._removeFromDisplayListAt = function(a, b) {
  6869. void 0 === b && (b = !0);
  6870. if (0 <= a && a < this._children.length) {
  6871. var d = this._doRemoveChild(a, b);
  6872. this._childRemoved(d);
  6873. return d
  6874. }
  6875. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  6876. return null
  6877. };
  6878. a.prototype.addChild = function(a) {
  6879. this._addingChild(a);
  6880. b.prototype.addChild.call(this,
  6881. a);
  6882. this._childAdded(a);
  6883. return a
  6884. };
  6885. a.prototype.addChildAt = function(a, c) {
  6886. this._addingChild(a);
  6887. b.prototype.addChildAt.call(this, a, c);
  6888. this._childAdded(a);
  6889. return a
  6890. };
  6891. a.prototype._addingChild = function(a) {
  6892. a && "nestLevel" in a && (a.nestLevel = this._nestLevel + 1)
  6893. };
  6894. a.prototype._childAdded = function(b) {
  6895. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  6896. };
  6897. a.prototype.removeChild = function(a) {
  6898. b.prototype.removeChild.call(this, a);
  6899. this._childRemoved(a);
  6900. return a
  6901. };
  6902. a.prototype.removeChildAt = function(a) {
  6903. a = b.prototype.removeChildAt.call(this,
  6904. a);
  6905. this._childRemoved(a);
  6906. return a
  6907. };
  6908. a.prototype._childRemoved = function(a) {
  6909. a && "nestLevel" in a && (a.nestLevel = 0)
  6910. };
  6911. a.prototype.checkInvalidateFlag = function(a) {
  6912. d.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && d.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && d.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && d.UIGlobals._layoutManager.invalidateDisplayList(this), this._validateNowFlag && (d.UIGlobals._layoutManager.validateClient(this),
  6913. this._validateNowFlag = !1))
  6914. };
  6915. Object.defineProperty(a.prototype, "enabled", {
  6916. get: function() {
  6917. return this._enabled
  6918. },
  6919. set: function(a) {
  6920. this._enabled = a
  6921. },
  6922. enumerable: !0,
  6923. configurable: !0
  6924. });
  6925. Object.defineProperty(a.prototype, "width", {
  6926. get: function() {
  6927. return this._width
  6928. },
  6929. set: function(a) {
  6930. this._setWidth(a)
  6931. },
  6932. enumerable: !0,
  6933. configurable: !0
  6934. });
  6935. a.prototype._setWidth = function(a) {
  6936. if (this._width != a || this._explicitWidth != a) b.prototype._setWidth.call(this, a), isNaN(a) ? this.invalidateSize() : this._width = a, this.invalidateProperties(),
  6937. this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6938. };
  6939. Object.defineProperty(a.prototype, "height", {
  6940. get: function() {
  6941. return this._height
  6942. },
  6943. set: function(a) {
  6944. this._setHeight(a)
  6945. },
  6946. enumerable: !0,
  6947. configurable: !0
  6948. });
  6949. a.prototype._setHeight = function(a) {
  6950. if (this._height != a || this._explicitHeight != a) b.prototype._setHeight.call(this, a), isNaN(a) ? this.invalidateSize() : this._height = a, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6951. };
  6952. Object.defineProperty(a.prototype,
  6953. "scaleX", {
  6954. get: function() {
  6955. return this._scaleX
  6956. },
  6957. set: function(a) {
  6958. this._setScaleX(a)
  6959. },
  6960. enumerable: !0,
  6961. configurable: !0
  6962. });
  6963. a.prototype._setScaleX = function(a) {
  6964. this._scaleX != a && (this._scaleX = a, this.invalidateParentSizeAndDisplayList())
  6965. };
  6966. Object.defineProperty(a.prototype, "scaleY", {
  6967. get: function() {
  6968. return this._scaleY
  6969. },
  6970. set: function(a) {
  6971. this._setScaleY(a)
  6972. },
  6973. enumerable: !0,
  6974. configurable: !0
  6975. });
  6976. a.prototype._setScaleY = function(a) {
  6977. this._scaleY != a && (this._scaleY = a, this.invalidateParentSizeAndDisplayList())
  6978. };
  6979. Object.defineProperty(a.prototype,
  6980. "minWidth", {
  6981. get: function() {
  6982. return this._minWidth
  6983. },
  6984. set: function(a) {
  6985. this._minWidth != a && (this._minWidth = a, this.invalidateSize())
  6986. },
  6987. enumerable: !0,
  6988. configurable: !0
  6989. });
  6990. Object.defineProperty(a.prototype, "maxWidth", {
  6991. get: function() {
  6992. return this._maxWidth
  6993. },
  6994. set: function(a) {
  6995. this._maxWidth != a && (this._maxWidth = a, this.invalidateSize())
  6996. },
  6997. enumerable: !0,
  6998. configurable: !0
  6999. });
  7000. a.prototype._getMaxWidth = function() {
  7001. return this._maxWidth
  7002. };
  7003. Object.defineProperty(a.prototype, "minHeight", {
  7004. get: function() {
  7005. return this._minHeight
  7006. },
  7007. set: function(a) {
  7008. this._minHeight !=
  7009. a && (this._minHeight = a, this.invalidateSize())
  7010. },
  7011. enumerable: !0,
  7012. configurable: !0
  7013. });
  7014. Object.defineProperty(a.prototype, "maxHeight", {
  7015. get: function() {
  7016. return this._maxHeight
  7017. },
  7018. set: function(a) {
  7019. this._maxHeight != a && (this._maxHeight = a, this.invalidateSize())
  7020. },
  7021. enumerable: !0,
  7022. configurable: !0
  7023. });
  7024. Object.defineProperty(a.prototype, "measuredWidth", {
  7025. get: function() {
  7026. return this._measuredWidth
  7027. },
  7028. set: function(a) {
  7029. this._measuredWidth = a
  7030. },
  7031. enumerable: !0,
  7032. configurable: !0
  7033. });
  7034. Object.defineProperty(a.prototype, "measuredHeight", {
  7035. get: function() {
  7036. return this._measuredHeight
  7037. },
  7038. set: function(a) {
  7039. this._measuredHeight = a
  7040. },
  7041. enumerable: !0,
  7042. configurable: !0
  7043. });
  7044. a.prototype.setActualSize = function(a, b) {
  7045. var c = !1;
  7046. this._width != a && (this._width = a, c = !0);
  7047. this._height != b && (this._height = b, c = !0);
  7048. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  7049. };
  7050. Object.defineProperty(a.prototype, "x", {
  7051. get: function() {
  7052. return this._x
  7053. },
  7054. set: function(b) {
  7055. this._x != b && (this._setX(b), this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  7056. },
  7057. enumerable: !0,
  7058. configurable: !0
  7059. });
  7060. Object.defineProperty(a.prototype, "y", {
  7061. get: function() {
  7062. return this._y
  7063. },
  7064. set: function(b) {
  7065. this._y != b && (this._setY(b), this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  7066. },
  7067. enumerable: !0,
  7068. configurable: !0
  7069. });
  7070. a.prototype.invalidateProperties = function() {
  7071. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && d.UIGlobals._layoutManager && d.UIGlobals._layoutManager.invalidateProperties(this))
  7072. };
  7073. a.prototype.validateProperties =
  7074. function() {
  7075. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  7076. };
  7077. a.prototype.invalidateSize = function() {
  7078. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && d.UIGlobals._layoutManager && d.UIGlobals._layoutManager.invalidateSize(this))
  7079. };
  7080. a.prototype.validateSize = function(a) {
  7081. void 0 === a && (a = !1);
  7082. if (a)
  7083. for (a = 0; a < this.numChildren; a++) {
  7084. var b = this.getChildAt(a);
  7085. "validateSize" in b && b.validateSize(!0)
  7086. }
  7087. this._invalidateSizeFlag && (this.measureSizes() && (this.invalidateDisplayList(),
  7088. this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  7089. };
  7090. a.prototype.measureSizes = function() {
  7091. var a = !1;
  7092. if (!this._invalidateSizeFlag) return a;
  7093. this.canSkipMeasurement() || (this.measure(), this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth), this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth), this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight), this.measuredHeight > this.maxHeight && (this.measuredHeight = this.maxHeight));
  7094. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth =
  7095. this.preferredWidth, this._oldPreferHeight = this.preferredHeight, a = !0;
  7096. else {
  7097. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) a = !0;
  7098. this._oldPreferWidth = this.preferredWidth;
  7099. this._oldPreferHeight = this.preferredHeight
  7100. }
  7101. return a
  7102. };
  7103. a.prototype.invalidateDisplayList = function() {
  7104. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && d.UIGlobals._layoutManager && d.UIGlobals._layoutManager.invalidateDisplayList(this), this._setSizeDirty())
  7105. };
  7106. a.prototype.validateDisplayList =
  7107. function() {
  7108. if (this._invalidateDisplayListFlag) {
  7109. var a = 0,
  7110. b = 0,
  7111. a = this._layoutWidthExplicitlySet ? this._width : isNaN(this.explicitWidth) ? this.measuredWidth : this._explicitWidth,
  7112. b = this._layoutHeightExplicitlySet ? this._height : isNaN(this.explicitHeight) ? this.measuredHeight : this._explicitHeight;
  7113. isNaN(a) && (a = 0);
  7114. isNaN(b) && (b = 0);
  7115. this.setActualSize(a, b);
  7116. this.updateDisplayList(a, b);
  7117. this._invalidateDisplayListFlag = !1
  7118. }
  7119. };
  7120. a.prototype.validateNow = function(a) {
  7121. void 0 === a && (a = !1);
  7122. this._validateNowFlag || null == d.UIGlobals._layoutManager ?
  7123. this._validateNowFlag = !0 : d.UIGlobals._layoutManager.validateClient(this, a)
  7124. };
  7125. a.prototype.invalidateParentSizeAndDisplayList = function() {
  7126. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  7127. var a = this.parent;
  7128. a.invalidateSize();
  7129. a.invalidateDisplayList()
  7130. }
  7131. };
  7132. a.prototype.updateDisplayList = function(a, b) {};
  7133. a.prototype.canSkipMeasurement = function() {
  7134. return !isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  7135. };
  7136. a.prototype.commitProperties = function() {
  7137. this.oldWidth == this._width && this.oldHeight ==
  7138. this._height || this.dispatchResizeEvent();
  7139. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  7140. };
  7141. a.prototype.measure = function() {
  7142. this._measuredWidth = this._measuredHeight = 0
  7143. };
  7144. a.prototype.dispatchMoveEvent = function() {
  7145. this.hasEventListener(d.MoveEvent.MOVE) && d.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  7146. this.oldX = this.x;
  7147. this.oldY = this.y
  7148. };
  7149. a.prototype._childXYChanged = function() {};
  7150. a.prototype.dispatchResizeEvent = function() {
  7151. this.hasEventListener(d.ResizeEvent.RESIZE) && d.ResizeEvent.dispatchResizeEvent(this,
  7152. this.oldWidth, this.oldHeight);
  7153. this.oldWidth = this._width;
  7154. this.oldHeight = this._height
  7155. };
  7156. Object.defineProperty(a.prototype, "includeInLayout", {
  7157. get: function() {
  7158. return this._includeInLayout
  7159. },
  7160. set: function(a) {
  7161. this._includeInLayout != a && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = a)
  7162. },
  7163. enumerable: !0,
  7164. configurable: !0
  7165. });
  7166. Object.defineProperty(a.prototype, "left", {
  7167. get: function() {
  7168. return this._left
  7169. },
  7170. set: function(a) {
  7171. this._left != a && (this._left = a, this.invalidateParentSizeAndDisplayList())
  7172. },
  7173. enumerable: !0,
  7174. configurable: !0
  7175. });
  7176. Object.defineProperty(a.prototype, "right", {
  7177. get: function() {
  7178. return this._right
  7179. },
  7180. set: function(a) {
  7181. this._right != a && (this._right = a, this.invalidateParentSizeAndDisplayList())
  7182. },
  7183. enumerable: !0,
  7184. configurable: !0
  7185. });
  7186. Object.defineProperty(a.prototype, "top", {
  7187. get: function() {
  7188. return this._top
  7189. },
  7190. set: function(a) {
  7191. this._top != a && (this._top = a, this.invalidateParentSizeAndDisplayList())
  7192. },
  7193. enumerable: !0,
  7194. configurable: !0
  7195. });
  7196. Object.defineProperty(a.prototype, "bottom", {
  7197. get: function() {
  7198. return this._bottom
  7199. },
  7200. set: function(a) {
  7201. this._bottom != a && (this._bottom = a, this.invalidateParentSizeAndDisplayList())
  7202. },
  7203. enumerable: !0,
  7204. configurable: !0
  7205. });
  7206. Object.defineProperty(a.prototype, "horizontalCenter", {
  7207. get: function() {
  7208. return this._horizontalCenter
  7209. },
  7210. set: function(a) {
  7211. this._horizontalCenter != a && (this._horizontalCenter = a, this.invalidateParentSizeAndDisplayList())
  7212. },
  7213. enumerable: !0,
  7214. configurable: !0
  7215. });
  7216. Object.defineProperty(a.prototype, "verticalCenter", {
  7217. get: function() {
  7218. return this._verticalCenter
  7219. },
  7220. set: function(a) {
  7221. this._verticalCenter !=
  7222. a && (this._verticalCenter = a, this.invalidateParentSizeAndDisplayList())
  7223. },
  7224. enumerable: !0,
  7225. configurable: !0
  7226. });
  7227. Object.defineProperty(a.prototype, "percentWidth", {
  7228. get: function() {
  7229. return this._percentWidth
  7230. },
  7231. set: function(a) {
  7232. this._percentWidth != a && (this._percentWidth = a, this.invalidateParentSizeAndDisplayList())
  7233. },
  7234. enumerable: !0,
  7235. configurable: !0
  7236. });
  7237. Object.defineProperty(a.prototype, "percentHeight", {
  7238. get: function() {
  7239. return this._percentHeight
  7240. },
  7241. set: function(a) {
  7242. this._percentHeight != a && (this._percentHeight = a, this.invalidateParentSizeAndDisplayList())
  7243. },
  7244. enumerable: !0,
  7245. configurable: !0
  7246. });
  7247. a.prototype.setLayoutBoundsSize = function(a, b) {
  7248. isNaN(a) ? (this._layoutWidthExplicitlySet = !1, a = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  7249. isNaN(b) ? (this._layoutHeightExplicitlySet = !1, b = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  7250. this.setActualSize(a / this._scaleX, b / this._scaleY)
  7251. };
  7252. a.prototype.setLayoutBoundsPosition = function(a, b) {
  7253. 0 > this._scaleX && (a += this.layoutBoundsWidth);
  7254. 0 > this._scaleY && (b += this.layoutBoundsHeight);
  7255. var c = !1;
  7256. this._x != a && (this._setX(a),
  7257. c = !0);
  7258. this._y != b && (this._setY(b), c = !0);
  7259. c && this.dispatchMoveEvent()
  7260. };
  7261. Object.defineProperty(a.prototype, "preferredWidth", {
  7262. get: function() {
  7263. var a = this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  7264. b = this._scaleX;
  7265. 0 > b && (b = -b);
  7266. return a * b
  7267. },
  7268. enumerable: !0,
  7269. configurable: !0
  7270. });
  7271. Object.defineProperty(a.prototype, "preferredHeight", {
  7272. get: function() {
  7273. var a = this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  7274. b = this._scaleY;
  7275. 0 > b && (b = -b);
  7276. return a * b
  7277. },
  7278. enumerable: !0,
  7279. configurable: !0
  7280. });
  7281. Object.defineProperty(a.prototype,
  7282. "preferredX", {
  7283. get: function() {
  7284. return 0 <= this._scaleX ? this._x : this._x - this.preferredWidth
  7285. },
  7286. enumerable: !0,
  7287. configurable: !0
  7288. });
  7289. Object.defineProperty(a.prototype, "preferredY", {
  7290. get: function() {
  7291. return 0 <= this._scaleY ? this._y : this._y - this.preferredHeight
  7292. },
  7293. enumerable: !0,
  7294. configurable: !0
  7295. });
  7296. Object.defineProperty(a.prototype, "layoutBoundsX", {
  7297. get: function() {
  7298. return 0 <= this._scaleX ? this._x : this._x - this.layoutBoundsWidth
  7299. },
  7300. enumerable: !0,
  7301. configurable: !0
  7302. });
  7303. Object.defineProperty(a.prototype, "layoutBoundsY", {
  7304. get: function() {
  7305. return 0 <=
  7306. this._scaleY ? this._y : this._y - this.layoutBoundsHeight
  7307. },
  7308. enumerable: !0,
  7309. configurable: !0
  7310. });
  7311. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  7312. get: function() {
  7313. var a = 0,
  7314. a = this._layoutWidthExplicitlySet ? this._width : this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  7315. b = this._scaleX;
  7316. 0 > b && (b = -b);
  7317. return a * b
  7318. },
  7319. enumerable: !0,
  7320. configurable: !0
  7321. });
  7322. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  7323. get: function() {
  7324. var a = 0,
  7325. a = this._layoutHeightExplicitlySet ? this._height : this._hasHeightSet ? this._explicitHeight :
  7326. this._measuredHeight,
  7327. b = this.scaleY;
  7328. 0 > b && (b = -b);
  7329. return a * b
  7330. },
  7331. enumerable: !0,
  7332. configurable: !0
  7333. });
  7334. return a
  7335. }(c.DisplayObjectContainer);
  7336. d.UIComponent = f;
  7337. f.prototype.__class__ = "egret.gui.UIComponent"
  7338. })(c.gui || (c.gui = {}))
  7339. })(egret || (egret = {}));
  7340. (function(c) {
  7341. (function(c) {
  7342. var f = function() {
  7343. function b() {}
  7344. b.DOWN = 40;
  7345. b.END = 35;
  7346. b.HOME = 36;
  7347. b.LEFT = 37;
  7348. b.PAGE_DOWN = 34;
  7349. b.PAGE_LEFT = 9111;
  7350. b.PAGE_RIGHT = 9112;
  7351. b.PAGE_UP = 33;
  7352. b.RIGHT = 39;
  7353. b.UP = 38;
  7354. return b
  7355. }();
  7356. c.NavigationUnit = f;
  7357. f.prototype.__class__ = "egret.gui.NavigationUnit"
  7358. })(c.gui || (c.gui = {}))
  7359. })(egret || (egret = {}));
  7360. __extends = this.__extends || function(c, d) {
  7361. function f() {
  7362. this.constructor = c
  7363. }
  7364. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  7365. f.prototype = d.prototype;
  7366. c.prototype = new f
  7367. };
  7368. (function(c) {
  7369. (function(d) {
  7370. var f = function(b) {
  7371. function a() {
  7372. b.call(this);
  7373. this.hostComponentKey = null;
  7374. this.stateIsDirty = this.skinLayoutEnabled = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  7375. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  7376. }
  7377. __extends(a, b);
  7378. Object.defineProperty(a.prototype, "skinName", {
  7379. get: function() {
  7380. return this._skinName
  7381. },
  7382. set: function(a) {
  7383. this._skinName != a && (this._skinName = a, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  7384. },
  7385. enumerable: !0,
  7386. configurable: !0
  7387. });
  7388. a.prototype.createChildren = function() {
  7389. b.prototype.createChildren.call(this);
  7390. this.parseSkinName();
  7391. this.createChildrenCalled = !0
  7392. };
  7393. a.prototype.parseSkinName = function() {
  7394. var b = a.skinAdapter;
  7395. b || (b = this.getSkinAdapter());
  7396. var d = this.hostComponentKey || c.getQualifiedClassName(this),
  7397. b = b.getSkin(this._skinName, d);
  7398. b || (d = a._defaultTheme) && (b = d.getDefaultSkin(this));
  7399. this._setSkin(b)
  7400. };
  7401. a.prototype.getSkinAdapter = function() {
  7402. var b;
  7403. try {
  7404. b = c.Injector.getInstance("egret.gui.ISkinAdapter")
  7405. } catch (f) {
  7406. b =
  7407. new d.DefaultSkinAdapter
  7408. }
  7409. return a.skinAdapter = b
  7410. };
  7411. Object.defineProperty(a.prototype, "skin", {
  7412. get: function() {
  7413. return this._skin
  7414. },
  7415. enumerable: !0,
  7416. configurable: !0
  7417. });
  7418. a.prototype._setSkin = function(a) {
  7419. var b = this._skin;
  7420. this.detachSkin(b);
  7421. b instanceof c.DisplayObject && this._removeFromDisplayList(b);
  7422. this._skin = a;
  7423. a instanceof c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  7424. this.attachSkin(a);
  7425. this.invalidateSkinState();
  7426. this.invalidateSize();
  7427. this.invalidateDisplayList();
  7428. this.hasEventListener(d.UIEvent.SKIN_CHANGED) &&
  7429. d.UIEvent.dispatchUIEvent(this, d.UIEvent.SKIN_CHANGED)
  7430. };
  7431. a.prototype.attachSkin = function(a) {
  7432. a && "hostComponent" in a && (a.hostComponent = this, this.findSkinParts());
  7433. this.skinLayoutEnabled = !a || a instanceof c.DisplayObject ? !1 : !0
  7434. };
  7435. a.prototype.findSkinParts = function() {
  7436. var a = this._skin;
  7437. if (a && "skinParts" in a)
  7438. for (var b = a.skinParts, c = b.length, d = 0; d < c; d++) {
  7439. var f = b[d];
  7440. if (f in a) try {
  7441. this[f] = a[f], this.partAdded(f, a[f])
  7442. } catch (h) {}
  7443. }
  7444. };
  7445. a.prototype.detachSkin = function(a) {
  7446. if (a && "skinParts" in a) {
  7447. for (var b = a.skinParts, c = b.length,
  7448. d = 0; d < c; d++) {
  7449. var f = b[d];
  7450. f in this && (null != this[f] && this.partRemoved(f, this[f]), this[f] = null)
  7451. }
  7452. a.hostComponent = null
  7453. }
  7454. };
  7455. a.prototype.partAdded = function(a, b) {
  7456. d.SkinPartEvent.dispatchSkinPartEvent(this, d.SkinPartEvent.PART_ADDED, a, b)
  7457. };
  7458. a.prototype.partRemoved = function(a, b) {
  7459. d.SkinPartEvent.dispatchSkinPartEvent(this, d.SkinPartEvent.PART_REMOVED, a, b)
  7460. };
  7461. a.prototype.invalidateSkinState = function() {
  7462. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  7463. };
  7464. a.prototype.validateSkinState = function() {
  7465. var a =
  7466. this.getCurrentSkinState(),
  7467. b = this._skin;
  7468. b && "currentState" in b && (b.currentState = a);
  7469. this.hasEventListener("stateChanged") && this.dispatchEventWith("stateChanged")
  7470. };
  7471. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  7472. get: function() {
  7473. return this._autoMouseEnabled
  7474. },
  7475. set: function(a) {
  7476. this._autoMouseEnabled != a && ((this._autoMouseEnabled = a) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren : !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled : !1) : (this._touchChildren = this.explicitMouseChildren,
  7477. this._touchEnabled = this.explicitMouseEnabled))
  7478. },
  7479. enumerable: !0,
  7480. configurable: !0
  7481. });
  7482. Object.defineProperty(a.prototype, "touchChildren", {
  7483. get: function() {
  7484. return this._touchChildren
  7485. },
  7486. set: function(a) {
  7487. this.enabled && (this._touchChildren = a);
  7488. this.explicitMouseChildren = a
  7489. },
  7490. enumerable: !0,
  7491. configurable: !0
  7492. });
  7493. Object.defineProperty(a.prototype, "touchEnabled", {
  7494. get: function() {
  7495. return this._touchEnabled
  7496. },
  7497. set: function(a) {
  7498. this.enabled && (this._touchEnabled = a);
  7499. this.explicitMouseEnabled = a
  7500. },
  7501. enumerable: !0,
  7502. configurable: !0
  7503. });
  7504. Object.defineProperty(a.prototype,
  7505. "enabled", {
  7506. get: function() {
  7507. return this._enabled
  7508. },
  7509. set: function(a) {
  7510. this._setEnabled(a)
  7511. },
  7512. enumerable: !0,
  7513. configurable: !0
  7514. });
  7515. a.prototype._setEnabled = function(a) {
  7516. this._enabled != a && (this._enabled = a, this._autoMouseEnabled && (this._touchChildren = a ? this.explicitMouseChildren : !1, this._touchEnabled = a ? this.explicitMouseEnabled : !1), this.invalidateSkinState())
  7517. };
  7518. a.prototype.getCurrentSkinState = function() {
  7519. return this.enabled ? "normal" : "disabled"
  7520. };
  7521. a.prototype.commitProperties = function() {
  7522. b.prototype.commitProperties.call(this);
  7523. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  7524. };
  7525. a.prototype._childXYChanged = function() {
  7526. this.skinLayoutEnabled && (this.invalidateSize(), this.invalidateDisplayList())
  7527. };
  7528. a.prototype.measure = function() {
  7529. b.prototype.measure.call(this);
  7530. var a = this._skin;
  7531. a && (this.skinLayoutEnabled ? (a.measure(), this.measuredWidth = a.preferredWidth, this.measuredHeight = a.preferredHeight) : "preferredWidth" in a ? (this.measuredWidth = a.preferredWidth, this.measuredHeight = a.preferredHeight) : (this.measuredWidth = a.width,
  7532. this.measuredHeight = a.height))
  7533. };
  7534. a.prototype.updateDisplayList = function(a, d) {
  7535. b.prototype.updateDisplayList.call(this, a, d);
  7536. var f = this._skin;
  7537. f && (this.skinLayoutEnabled ? f.updateDisplayList(a, d) : "setLayoutBoundsSize" in f ? f.setLayoutBoundsSize(a, d) : f instanceof c.DisplayObject && (f.scaleX = 0 == f.width ? 1 : a / f.width, f.scaleY = 0 == f.height ? 1 : d / f.height))
  7538. };
  7539. a.prototype.addChild = function(b) {
  7540. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  7541. };
  7542. a.prototype.addChildAt = function(b, c) {
  7543. throw Error("addChildAt()" +
  7544. a.errorStr + "addElementAt()\u4ee3\u66ff");
  7545. };
  7546. a.prototype.removeChild = function(b) {
  7547. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  7548. };
  7549. a.prototype.removeChildAt = function(b) {
  7550. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  7551. };
  7552. a.prototype.setChildIndex = function(b, c) {
  7553. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  7554. };
  7555. a.prototype.swapChildren = function(b, c) {
  7556. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  7557. };
  7558. a.prototype.swapChildrenAt =
  7559. function(b, c) {
  7560. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  7561. };
  7562. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  7563. return a
  7564. }(d.UIComponent);
  7565. d.SkinnableComponent = f;
  7566. f.prototype.__class__ = "egret.gui.SkinnableComponent"
  7567. })(c.gui || (c.gui = {}))
  7568. })(egret || (egret = {}));
  7569. (function(c) {
  7570. (function(d) {
  7571. var f = function() {
  7572. function b() {}
  7573. b.prototype.getSkin = function(a, b) {
  7574. if (!a) return null;
  7575. if (a.prototype) return new a;
  7576. if ("string" == typeof a) {
  7577. var d = c.getDefinitionByName(a);
  7578. return d ? new d : null
  7579. }
  7580. return a
  7581. };
  7582. return b
  7583. }();
  7584. d.DefaultSkinAdapter = f;
  7585. f.prototype.__class__ = "egret.gui.DefaultSkinAdapter"
  7586. })(c.gui || (c.gui = {}))
  7587. })(egret || (egret = {}));
  7588. (function(c) {
  7589. (function(d) {
  7590. var f = function() {
  7591. function b(a) {
  7592. this.delyList = [];
  7593. this.loadConfig(a)
  7594. }
  7595. b.load = function(a) {
  7596. this.initialized || (this.initialized = !0, d.SkinnableComponent._defaultTheme = new b(a))
  7597. };
  7598. b.prototype.loadConfig = function(a) {
  7599. var b = new c.URLLoader;
  7600. b.addEventListener(c.Event.COMPLETE, this.onLoadComplete, this);
  7601. b.addEventListener(c.IOErrorEvent.IO_ERROR, this.onLoadError, this);
  7602. b.dataFormat = c.URLLoaderDataFormat.TEXT;
  7603. b.load(new c.URLRequest(a))
  7604. };
  7605. b.prototype.onLoadComplete = function(a) {
  7606. a = a.target;
  7607. try {
  7608. this.skinMap = JSON.parse(a.data).skins
  7609. } catch (b) {
  7610. c.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a._request.url + "\ndata:" + a.data)
  7611. }
  7612. this.handleDelyList()
  7613. };
  7614. b.prototype.onLoadError = function(a) {
  7615. c.Logger.warning("\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: " + a.target._request.url);
  7616. this.handleDelyList()
  7617. };
  7618. b.prototype.handleDelyList = function() {
  7619. if (this.skinMap) {
  7620. var a = this.delyList;
  7621. this.delyList = [];
  7622. for (var b = a.length, c = 0; c < b; c++) {
  7623. var d = a[c];
  7624. if (!d._skin) {
  7625. var f = this.getDefaultSkin(d);
  7626. d._setSkin(f)
  7627. }
  7628. }
  7629. } else this.skinMap = {}, this.delyList = []
  7630. };
  7631. b.prototype.getDefaultSkin = function(a) {
  7632. var b = this.skinMap;
  7633. if (!b) return -1 == this.delyList.indexOf(a) && this.delyList.push(a), null;
  7634. var d, f = a.hostComponentKey;
  7635. if (f) d = b[f];
  7636. else
  7637. for (; a;) {
  7638. f = c.getQualifiedClassName(a);
  7639. if (d = b[f]) break;
  7640. a = c.getDefinitionByName(c.getQualifiedSuperclassName(a))
  7641. }
  7642. if (!d) return null;
  7643. b = c.getDefinitionByName(d);
  7644. return b ? new b : (c.Logger.warning("\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: " +
  7645. d), null)
  7646. };
  7647. b.initialized = !1;
  7648. return b
  7649. }();
  7650. d.Theme = f;
  7651. f.prototype.__class__ = "egret.gui.Theme"
  7652. })(c.gui || (c.gui = {}))
  7653. })(egret || (egret = {}));
  7654. __extends = this.__extends || function(c, d) {
  7655. function f() {
  7656. this.constructor = c
  7657. }
  7658. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  7659. f.prototype = d.prototype;
  7660. c.prototype = new f
  7661. };
  7662. (function(c) {
  7663. (function(d) {
  7664. var f = function(b) {
  7665. function a() {
  7666. b.call(this);
  7667. this._fontFamily = "SimSun";
  7668. this._size = 30;
  7669. this._focusEnabled = !0;
  7670. this._textAlign = c.HorizontalAlign.LEFT;
  7671. this._verticalAlign = c.VerticalAlign.TOP;
  7672. this._lineSpacing = 0;
  7673. this._textColor = 16777215;
  7674. this._text = ""
  7675. }
  7676. __extends(a, b);
  7677. Object.defineProperty(a.prototype, "fontFamily", {
  7678. get: function() {
  7679. return this._fontFamily
  7680. },
  7681. set: function(a) {
  7682. this._fontFamily != a && (this._fontFamily = a, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(),
  7683. this.invalidateDisplayList())
  7684. },
  7685. enumerable: !0,
  7686. configurable: !0
  7687. });
  7688. Object.defineProperty(a.prototype, "size", {
  7689. get: function() {
  7690. return this._getFontSize()
  7691. },
  7692. set: function(a) {
  7693. this._setFontSize(a)
  7694. },
  7695. enumerable: !0,
  7696. configurable: !0
  7697. });
  7698. a.prototype._getFontSize = function() {
  7699. return this._size
  7700. };
  7701. a.prototype._setFontSize = function(a) {
  7702. this._size != a && (this._size = a, this._sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7703. };
  7704. Object.defineProperty(a.prototype, "focusEnabled", {
  7705. get: function() {
  7706. return this._focusEnabled
  7707. },
  7708. set: function(a) {
  7709. this._focusEnabled = a
  7710. },
  7711. enumerable: !0,
  7712. configurable: !0
  7713. });
  7714. a.prototype.setFocus = function() {
  7715. !1 != this._focusEnabled && this._textField && this._textField.setFocus()
  7716. };
  7717. Object.defineProperty(a.prototype, "bold", {
  7718. get: function() {
  7719. return this._bold
  7720. },
  7721. set: function(a) {
  7722. this._bold != a && (this._bold = a, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7723. },
  7724. enumerable: !0,
  7725. configurable: !0
  7726. });
  7727. Object.defineProperty(a.prototype, "italic", {
  7728. get: function() {
  7729. return this._italic
  7730. },
  7731. set: function(a) {
  7732. this._italic != a && (this._italic = a, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7733. },
  7734. enumerable: !0,
  7735. configurable: !0
  7736. });
  7737. Object.defineProperty(a.prototype, "textAlign", {
  7738. get: function() {
  7739. return this._textAlign
  7740. },
  7741. set: function(a) {
  7742. this._textAlign != a && (this._textAlign = a, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7743. },
  7744. enumerable: !0,
  7745. configurable: !0
  7746. });
  7747. Object.defineProperty(a.prototype, "verticalAlign", {
  7748. get: function() {
  7749. return this._verticalAlign
  7750. },
  7751. set: function(a) {
  7752. this._verticalAlign != a && (this._verticalAlign = a, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7753. },
  7754. enumerable: !0,
  7755. configurable: !0
  7756. });
  7757. Object.defineProperty(a.prototype, "lineSpacing", {
  7758. get: function() {
  7759. return this._getLineSpacing()
  7760. },
  7761. set: function(a) {
  7762. this._setLineSpacing(a)
  7763. },
  7764. enumerable: !0,
  7765. configurable: !0
  7766. });
  7767. a.prototype._getLineSpacing = function() {
  7768. return this._lineSpacing
  7769. };
  7770. a.prototype._setLineSpacing =
  7771. function(a) {
  7772. this._lineSpacing != a && (this._lineSpacing = a, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7773. };
  7774. Object.defineProperty(a.prototype, "textColor", {
  7775. get: function() {
  7776. return this._textColor
  7777. },
  7778. set: function(a) {
  7779. this._textColor != a && (this._textColor = a, this.textColorChanged = !0, this.invalidateProperties())
  7780. },
  7781. enumerable: !0,
  7782. configurable: !0
  7783. });
  7784. Object.defineProperty(a.prototype, "text", {
  7785. get: function() {
  7786. return this._textField ? this._textField.text : this._text
  7787. },
  7788. set: function(a) {
  7789. a != this._text && (this._text = a, this._textChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7790. },
  7791. enumerable: !0,
  7792. configurable: !0
  7793. });
  7794. a.prototype.createChildren = function() {
  7795. b.prototype.createChildren.call(this);
  7796. this._textField || this.checkTextField()
  7797. };
  7798. a.prototype.commitProperties = function() {
  7799. b.prototype.commitProperties.call(this);
  7800. this._textField || this.checkTextField();
  7801. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7802. this._sizeChanged && (this._textField.size = this._size, this._sizeChanged = !1);
  7803. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7804. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7805. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7806. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7807. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7808. this.textColorChanged && (this._textField.textColor = this._textColor, this.textColorChanged = !1);
  7809. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7810. };
  7811. a.prototype.checkTextField = function() {
  7812. this._textField || (this._createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7813. };
  7814. a.prototype._createTextField = function() {
  7815. this._textField = new c.TextField;
  7816. this._textField.fontFamily = this._fontFamily;
  7817. this._textField.size = this._size;
  7818. this._textField.textAlign =
  7819. this._textAlign;
  7820. this._textField.verticalAlign = this._verticalAlign;
  7821. this._textField.lineSpacing = this._lineSpacing;
  7822. this._textField.textColor = this._textColor;
  7823. this._textField.multiline = !0;
  7824. this._addToDisplayList(this._textField)
  7825. };
  7826. a.prototype.measure = function() {
  7827. b.prototype.measure.call(this);
  7828. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7829. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7830. };
  7831. a.prototype.$updateDisplayList = function(a, c) {
  7832. b.prototype.updateDisplayList.call(this, a, c)
  7833. };
  7834. a.prototype.updateDisplayList = function(a,
  7835. c) {
  7836. b.prototype.updateDisplayList.call(this, a, c);
  7837. this._textField.width = a;
  7838. this._textField.height = c
  7839. };
  7840. a.prototype.dispatchPropertyChangeEvent = function(a, b, c) {
  7841. this.hasEventListener("propertyChange") && d.PropertyChangeEvent.dispatchPropertyChangeEvent(this, d.PropertyChangeEventKind.UPDATE, a, b, c, this)
  7842. };
  7843. a.DEFAULT_MEASURED_WIDTH = 160;
  7844. a.DEFAULT_MEASURED_HEIGHT = 22;
  7845. return a
  7846. }(d.UIComponent);
  7847. d.TextBase = f;
  7848. f.prototype.__class__ = "egret.gui.TextBase"
  7849. })(c.gui || (c.gui = {}))
  7850. })(egret || (egret = {}));
  7851. __extends = this.__extends || function(c, d) {
  7852. function f() {
  7853. this.constructor = c
  7854. }
  7855. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  7856. f.prototype = d.prototype;
  7857. c.prototype = new f
  7858. };
  7859. (function(c) {
  7860. (function(d) {
  7861. var f = function(b) {
  7862. function a() {
  7863. b.call(this);
  7864. this._contentHeight = this._contentWidth = 0;
  7865. this._clipAndEnableScrolling = !1;
  7866. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7867. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7868. }
  7869. __extends(a, b);
  7870. a.prototype.createChildren = function() {
  7871. b.prototype.createChildren.call(this);
  7872. this._layout || (this.layout = new d.BasicLayout)
  7873. };
  7874. Object.defineProperty(a.prototype, "contentWidth", {
  7875. get: function() {
  7876. return this._contentWidth
  7877. },
  7878. enumerable: !0,
  7879. configurable: !0
  7880. });
  7881. a.prototype.setContentWidth = function(a) {
  7882. if (a != this._contentWidth) {
  7883. var b = this._contentWidth;
  7884. this._contentWidth = a;
  7885. this.hasEventListener("propertyChange") && d.PropertyChangeEvent.dispatchPropertyChangeEvent(this, d.PropertyChangeEventKind.UPDATE, "contentWidth", b, a, this)
  7886. }
  7887. };
  7888. Object.defineProperty(a.prototype, "contentHeight", {
  7889. get: function() {
  7890. return this._contentHeight
  7891. },
  7892. enumerable: !0,
  7893. configurable: !0
  7894. });
  7895. a.prototype.setContentHeight = function(a) {
  7896. if (a != this._contentHeight) {
  7897. var b = this._contentHeight;
  7898. this._contentHeight = a;
  7899. this.hasEventListener("propertyChange") && d.PropertyChangeEvent.dispatchPropertyChangeEvent(this, d.PropertyChangeEventKind.UPDATE, "contentHeight", b, a, this)
  7900. }
  7901. };
  7902. a.prototype.setContentSize = function(a, b) {
  7903. if (a != this._contentWidth || b != this._contentHeight) this.setContentWidth(a), this.setContentHeight(b)
  7904. };
  7905. Object.defineProperty(a.prototype, "layout", {
  7906. get: function() {
  7907. return this._layout
  7908. },
  7909. set: function(a) {
  7910. this._setLayout(a)
  7911. },
  7912. enumerable: !0,
  7913. configurable: !0
  7914. });
  7915. a.prototype._setLayout = function(a) {
  7916. if (this._layout !=
  7917. a) {
  7918. this._layout && (this._layout.target = null);
  7919. if (this._layout = a) this._layout.target = this;
  7920. this.invalidateSize();
  7921. this.invalidateDisplayList();
  7922. this.dispatchEventWith("layoutChanged")
  7923. }
  7924. };
  7925. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7926. get: function() {
  7927. return this._clipAndEnableScrolling
  7928. },
  7929. set: function(a) {
  7930. a != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = a) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7931. },
  7932. enumerable: !0,
  7933. configurable: !0
  7934. });
  7935. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7936. get: function() {
  7937. return this._horizontalScrollPosition
  7938. },
  7939. set: function(a) {
  7940. if (a != this._horizontalScrollPosition) {
  7941. var b = this._horizontalScrollPosition;
  7942. this._horizontalScrollPosition = a;
  7943. this.scrollPositionChanged();
  7944. d.PropertyChangeEvent.dispatchPropertyChangeEvent(this, d.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", b, a, this)
  7945. }
  7946. },
  7947. enumerable: !0,
  7948. configurable: !0
  7949. });
  7950. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  7951. get: function() {
  7952. return this._verticalScrollPosition
  7953. },
  7954. set: function(a) {
  7955. if (a != this._verticalScrollPosition) {
  7956. var b = this._verticalScrollPosition;
  7957. this._verticalScrollPosition = a;
  7958. this.scrollPositionChanged();
  7959. d.PropertyChangeEvent.dispatchPropertyChangeEvent(this, d.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", b, a, this)
  7960. }
  7961. },
  7962. enumerable: !0,
  7963. configurable: !0
  7964. });
  7965. a.prototype.scrollPositionChanged = function() {
  7966. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(),
  7967. this._layout && this._layout.scrollPositionChanged())
  7968. };
  7969. a.prototype.updateScrollRect = function(a, b) {
  7970. var d = this._scrollRect;
  7971. this._clipAndEnableScrolling ? d ? (d.x = this._horizontalScrollPosition, d.y = this._verticalScrollPosition, d.width = a, d.height = b) : this._scrollRect = new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, a, b) : d && (this._scrollRect = null)
  7972. };
  7973. a.prototype.measure = function() {
  7974. this._layout && this._layoutInvalidateSizeFlag && (b.prototype.measure.call(this), this._layout.measure())
  7975. };
  7976. a.prototype._invalidateDisplayListExceptLayout = function() {
  7977. b.prototype.invalidateDisplayList.call(this)
  7978. };
  7979. a.prototype.invalidateDisplayList = function() {
  7980. b.prototype.invalidateDisplayList.call(this);
  7981. this._layoutInvalidateDisplayListFlag = !0
  7982. };
  7983. a.prototype._childXYChanged = function() {
  7984. this.invalidateSize();
  7985. this.invalidateDisplayList()
  7986. };
  7987. a.prototype._invalidateSizeExceptLayout = function() {
  7988. b.prototype.invalidateSize.call(this)
  7989. };
  7990. a.prototype.invalidateSize = function() {
  7991. b.prototype.invalidateSize.call(this);
  7992. this._layoutInvalidateSizeFlag = !0
  7993. };
  7994. a.prototype.updateDisplayList = function(a, c) {
  7995. b.prototype.updateDisplayList.call(this, a, c);
  7996. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(a, c), this.updateScrollRect(a, c))
  7997. };
  7998. Object.defineProperty(a.prototype, "numElements", {
  7999. get: function() {
  8000. return -1
  8001. },
  8002. enumerable: !0,
  8003. configurable: !0
  8004. });
  8005. a.prototype.getElementAt = function(a) {
  8006. return null
  8007. };
  8008. a.prototype.getElementIndex = function(a) {
  8009. return -1
  8010. };
  8011. a.prototype.getElementIndicesInView = function() {
  8012. var a =
  8013. [],
  8014. b;
  8015. if (this.scrollRect)
  8016. for (b = 0; b < this.numChildren; b++) {
  8017. var d = this.getChildAt(b);
  8018. if (d) {
  8019. var f = new c.Rectangle;
  8020. f.x = d.layoutBoundsX;
  8021. f.y = d.layoutBoundsY;
  8022. f.width = d.layoutBoundsWidth;
  8023. f.height = d.layoutBoundsHeight;
  8024. this.scrollRect.intersects(f) && a.push(b)
  8025. }
  8026. } else
  8027. for (b = 0; b < this.numChildren; b++) a.push(b);
  8028. return a
  8029. };
  8030. a.prototype.setVirtualElementIndicesInView = function(a, b) {};
  8031. a.prototype.getVirtualElementAt = function(a) {
  8032. return this.getElementAt(a)
  8033. };
  8034. return a
  8035. }(d.UIComponent);
  8036. d.GroupBase = f;
  8037. f.prototype.__class__ = "egret.gui.GroupBase"
  8038. })(c.gui ||
  8039. (c.gui = {}))
  8040. })(egret || (egret = {}));
  8041. __extends = this.__extends || function(c, d) {
  8042. function f() {
  8043. this.constructor = c
  8044. }
  8045. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  8046. f.prototype = d.prototype;
  8047. c.prototype = new f
  8048. };
  8049. (function(c) {
  8050. (function(d) {
  8051. var f = function(b) {
  8052. function a() {
  8053. b.call(this);
  8054. this._focusEnabled = !0;
  8055. this.textDisplayProperties = {};
  8056. this.focusEnabled = !0;
  8057. this.addEventListener("focus", this.focusInHandler, this);
  8058. this.addEventListener("blur", this.focusOutHandler, this)
  8059. }
  8060. __extends(a, b);
  8061. Object.defineProperty(a.prototype, "focusEnabled", {
  8062. get: function() {
  8063. return this._focusEnabled
  8064. },
  8065. set: function(a) {
  8066. this._focusEnabled = a
  8067. },
  8068. enumerable: !0,
  8069. configurable: !0
  8070. });
  8071. a.prototype.focusInHandler = function(a) {
  8072. a.target == this ? this.setFocus() :
  8073. this.invalidateSkinState()
  8074. };
  8075. a.prototype.focusOutHandler = function(a) {
  8076. a.target != this && this.invalidateSkinState()
  8077. };
  8078. Object.defineProperty(a.prototype, "prompt", {
  8079. get: function() {
  8080. return this._prompt
  8081. },
  8082. set: function(a) {
  8083. this._prompt != a && (this._prompt = a, this.promptDisplay && (this.promptDisplay.text = a), this.invalidateProperties(), this.invalidateSkinState())
  8084. },
  8085. enumerable: !0,
  8086. configurable: !0
  8087. });
  8088. Object.defineProperty(a.prototype, "maxWidth", {
  8089. get: function() {
  8090. if (this.textDisplay) return this.textDisplay.maxWidth;
  8091. var a = this.textDisplayProperties.maxWidth;
  8092. return void 0 === a ? b.prototype._getMaxWidth.call(this) : a
  8093. },
  8094. set: function(a) {
  8095. this.textDisplay ? (this.textDisplay.maxWidth = a, this.textDisplayProperties.maxWidth = !0) : this.textDisplayProperties.maxWidth = a;
  8096. this.invalidateProperties()
  8097. },
  8098. enumerable: !0,
  8099. configurable: !0
  8100. });
  8101. Object.defineProperty(a.prototype, "textColor", {
  8102. get: function() {
  8103. if (this.textDisplay) return this.textDisplay.textColor;
  8104. var a = this.textDisplayProperties.textColor;
  8105. return void 0 === a ? 0 : a
  8106. },
  8107. set: function(a) {
  8108. this.textDisplay ? (this.textDisplay.textColor =
  8109. a, this.textDisplayProperties.textColor = !0) : this.textDisplayProperties.textColor = a;
  8110. this.invalidateProperties()
  8111. },
  8112. enumerable: !0,
  8113. configurable: !0
  8114. });
  8115. Object.defineProperty(a.prototype, "displayAsPassword", {
  8116. get: function() {
  8117. if (this.textDisplay) return this.textDisplay.displayAsPassword;
  8118. var a = this.textDisplayProperties.displayAsPassword;
  8119. return void 0 === a ? !1 : a
  8120. },
  8121. set: function(a) {
  8122. this.textDisplay ? (this.textDisplay.displayAsPassword = a, this.textDisplayProperties.displayAsPassword = !0) : this.textDisplayProperties.displayAsPassword =
  8123. a;
  8124. this.invalidateProperties()
  8125. },
  8126. enumerable: !0,
  8127. configurable: !0
  8128. });
  8129. Object.defineProperty(a.prototype, "editable", {
  8130. get: function() {
  8131. if (this.textDisplay) return this.textDisplay.editable;
  8132. var a = this.textDisplayProperties.editable;
  8133. return void 0 === a ? !0 : a
  8134. },
  8135. set: function(a) {
  8136. this.textDisplay ? (this.textDisplay.editable = a, this.textDisplayProperties.editable = !0) : this.textDisplayProperties.editable = a;
  8137. this.invalidateProperties()
  8138. },
  8139. enumerable: !0,
  8140. configurable: !0
  8141. });
  8142. Object.defineProperty(a.prototype, "maxChars", {
  8143. get: function() {
  8144. if (this.textDisplay) return this.textDisplay.maxChars;
  8145. var a = this.textDisplayProperties.maxChars;
  8146. return void 0 === a ? 0 : a
  8147. },
  8148. set: function(a) {
  8149. this.textDisplay ? (this.textDisplay.maxChars = a, this.textDisplayProperties.maxChars = !0) : this.textDisplayProperties.maxChars = a;
  8150. this.invalidateProperties()
  8151. },
  8152. enumerable: !0,
  8153. configurable: !0
  8154. });
  8155. Object.defineProperty(a.prototype, "restrict", {
  8156. get: function() {
  8157. if (this.textDisplay) return this.textDisplay.restrict;
  8158. var a = this.textDisplayProperties.restrict;
  8159. return void 0 === a ? null : a
  8160. },
  8161. set: function(a) {
  8162. this.textDisplay ? (this.textDisplay.restrict =
  8163. a, this.textDisplayProperties.restrict = !0) : this.textDisplayProperties.restrict = a;
  8164. this.invalidateProperties()
  8165. },
  8166. enumerable: !0,
  8167. configurable: !0
  8168. });
  8169. Object.defineProperty(a.prototype, "selectable", {
  8170. get: function() {
  8171. if (this.textDisplay) return this.textDisplay.selectable;
  8172. var a = this.textDisplayProperties.selectable;
  8173. return void 0 === a ? !0 : a
  8174. },
  8175. set: function(a) {
  8176. this.textDisplay ? (this.textDisplay.selectable = a, this.textDisplayProperties.selectable = !0) : this.textDisplayProperties.selectable = a;
  8177. this.invalidateProperties()
  8178. },
  8179. enumerable: !0,
  8180. configurable: !0
  8181. });
  8182. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  8183. get: function() {
  8184. return this.textDisplay ? this.textDisplay.selectionBeginIndex : void 0 === this.textDisplayProperties.selectionBeginIndex ? -1 : this.textDisplayProperties.selectionBeginIndex
  8185. },
  8186. enumerable: !0,
  8187. configurable: !0
  8188. });
  8189. Object.defineProperty(a.prototype, "selectionEndIndex", {
  8190. get: function() {
  8191. return this.textDisplay ? this.textDisplay.selectionEndIndex : void 0 === this.textDisplayProperties.selectionEndIndex ? -1 : this.textDisplayProperties.selectionEndIndex
  8192. },
  8193. enumerable: !0,
  8194. configurable: !0
  8195. });
  8196. Object.defineProperty(a.prototype, "caretIndex", {
  8197. get: function() {
  8198. return this.textDisplay ? this.textDisplay.caretIndex : 0
  8199. },
  8200. enumerable: !0,
  8201. configurable: !0
  8202. });
  8203. a.prototype.setSelection = function(a, b) {
  8204. void 0 === b && (b = 0);
  8205. this.textDisplay ? this.textDisplay.setSelection(a, b) : (this.textDisplayProperties.selectionBeginIndex = a, this.textDisplayProperties.selectionEndIndex = b)
  8206. };
  8207. a.prototype.selectAll = function() {
  8208. this.textDisplay ? this.textDisplay.selectAll() : void 0 !== this.textDisplayProperties.text &&
  8209. this.setSelection(0, this.textDisplayProperties.text.length - 1)
  8210. };
  8211. Object.defineProperty(a.prototype, "text", {
  8212. get: function() {
  8213. return this._getText()
  8214. },
  8215. set: function(a) {
  8216. this._setText(a)
  8217. },
  8218. enumerable: !0,
  8219. configurable: !0
  8220. });
  8221. a.prototype._getText = function() {
  8222. if (this.textDisplay) return this.textDisplay.text;
  8223. var a = this.textDisplayProperties.text;
  8224. return void 0 === a ? "" : a
  8225. };
  8226. a.prototype._setText = function(a) {
  8227. this.textDisplay ? (this.textDisplay.text = a, this.textDisplayProperties.text = !0) : (this.textDisplayProperties.text = a, this.textDisplayProperties.selectionBeginIndex =
  8228. 0, this.textDisplayProperties.selectionEndIndex = 0);
  8229. this.invalidateProperties();
  8230. this.invalidateSkinState()
  8231. };
  8232. a.prototype._getWidthInChars = function() {
  8233. var a = this.textDisplay;
  8234. if (a) return a.widthInChars;
  8235. a = this.textDisplay ? void 0 : this.textDisplayProperties.widthInChars;
  8236. return void 0 === a ? NaN : a
  8237. };
  8238. a.prototype._setWidthInChars = function(a) {
  8239. if (this.textDisplay) {
  8240. var b = this.textDisplay;
  8241. b && (b.widthInChars = a);
  8242. this.textDisplayProperties.widthInChars = !0
  8243. } else this.textDisplayProperties.widthInChars = a;
  8244. this.invalidateProperties()
  8245. };
  8246. a.prototype._getHeightInLines = function() {
  8247. var a = this.textDisplay;
  8248. if (a) return a.heightInLines;
  8249. a = this.textDisplay ? void 0 : this.textDisplayProperties.heightInLines;
  8250. return void 0 === a ? NaN : a
  8251. };
  8252. a.prototype._setHeightInLines = function(a) {
  8253. if (this.textDisplay) {
  8254. var b = this.textDisplay;
  8255. b && (b.heightInLines = a);
  8256. this.textDisplayProperties.heightInLines = !0
  8257. } else this.textDisplayProperties.heightInLines = a;
  8258. this.invalidateProperties()
  8259. };
  8260. a.prototype.getCurrentSkinState = function() {
  8261. var a = d.UIGlobals.stage.focus,
  8262. c = this.skin;
  8263. if (this._prompt &&
  8264. !(a && this.contains(a) || "" != this.text)) {
  8265. if (this.enabled && c.hasState("normalWithPrompt")) return "normalWithPrompt";
  8266. if (!this.enabled && c.hasState("disabledWithPrompt")) return "disabledWithPrompt"
  8267. }
  8268. return b.prototype.getCurrentSkinState.call(this)
  8269. };
  8270. a.prototype.partAdded = function(a, d) {
  8271. b.prototype.partAdded.call(this, a, d);
  8272. d == this.textDisplay ? (this.textDisplayAdded(), this.textDisplay.addEventListener("input", this.textDisplay_changingHandler, this), this.textDisplay.addEventListener(c.Event.CHANGE, this.textDisplay_changeHandler,
  8273. this)) : d == this.promptDisplay && (this.promptDisplay.text = this._prompt)
  8274. };
  8275. a.prototype.partRemoved = function(a, d) {
  8276. b.prototype.partRemoved.call(this, a, d);
  8277. d == this.textDisplay && (this.textDisplayRemoved(), this.textDisplay.removeEventListener("input", this.textDisplay_changingHandler, this), this.textDisplay.removeEventListener(c.Event.CHANGE, this.textDisplay_changeHandler, this))
  8278. };
  8279. a.prototype.setFocus = function() {
  8280. !1 != this._focusEnabled && this.textDisplay && this.textDisplay.setFocus()
  8281. };
  8282. a.prototype._createTextDisplay =
  8283. function() {};
  8284. a.prototype._removeSkinParts = function() {
  8285. this.textDisplay && (this.partRemoved("textDisplay", this.textDisplay), this._removeFromDisplayList(this.textDisplay), this.textDisplay = null)
  8286. };
  8287. a.prototype.textDisplayAdded = function() {
  8288. var a = {},
  8289. b = this.textDisplay;
  8290. void 0 !== this.textDisplayProperties.displayAsPassword && (this.textDisplay.displayAsPassword = this.textDisplayProperties.displayAsPassword, a.displayAsPassword = !0);
  8291. void 0 !== this.textDisplayProperties.textColor && (this.textDisplay.textColor = this.textDisplayProperties.textColor,
  8292. a.textColor = !0);
  8293. void 0 !== this.textDisplayProperties.editable && (this.textDisplay.editable = this.textDisplayProperties.editable, a.editable = !0);
  8294. void 0 !== this.textDisplayProperties.maxChars && (this.textDisplay.maxChars = this.textDisplayProperties.maxChars, a.maxChars = !0);
  8295. void 0 !== this.textDisplayProperties.maxHeight && (this.textDisplay.maxHeight = this.textDisplayProperties.maxHeight, a.maxHeight = !0);
  8296. void 0 !== this.textDisplayProperties.maxWidth && (this.textDisplay.maxWidth = this.textDisplayProperties.maxWidth,
  8297. a.maxWidth = !0);
  8298. void 0 !== this.textDisplayProperties.restrict && (this.textDisplay.restrict = this.textDisplayProperties.restrict, a.restrict = !0);
  8299. void 0 !== this.textDisplayProperties.selectable && (this.textDisplay.selectable = this.textDisplayProperties.selectable, a.selectable = !0);
  8300. void 0 !== this.textDisplayProperties.text && (this.textDisplay.text = this.textDisplayProperties.text, a.text = !0);
  8301. void 0 !== this.textDisplayProperties.selectionBeginIndex && this.textDisplay.setSelection(this.textDisplayProperties.selectionBeginIndex,
  8302. this.textDisplayProperties.selectionEndIndex);
  8303. void 0 !== this.textDisplayProperties.widthInChars && b && (b.widthInChars = this.textDisplayProperties.widthInChars, a.widthInChars = !0);
  8304. void 0 !== this.textDisplayProperties.heightInLines && b && (b.heightInLines = this.textDisplayProperties.heightInLines, a.heightInLines = !0);
  8305. this.textDisplayProperties = a
  8306. };
  8307. a.prototype.textDisplayRemoved = function() {
  8308. var a = {},
  8309. b = this.textDisplay;
  8310. this.textDisplayProperties.displayAsPassword && (a.displayAsPassword = this.textDisplay.displayAsPassword);
  8311. this.textDisplayProperties.textColor && (a.textColor = this.textDisplay.textColor);
  8312. this.textDisplayProperties.editable && (a.editable = this.textDisplay.editable);
  8313. this.textDisplayProperties.maxChars && (a.maxChars = this.textDisplay.maxChars);
  8314. this.textDisplayProperties.maxHeight && (a.maxHeight = this.textDisplay.maxHeight);
  8315. this.textDisplayProperties.maxWidth && (a.maxWidth = this.textDisplay.maxWidth);
  8316. this.textDisplayProperties.restrict && (a.restrict = this.textDisplay.restrict);
  8317. this.textDisplayProperties.selectable &&
  8318. (a.selectable = this.textDisplay.selectable);
  8319. this.textDisplayProperties.text && (a.text = this.textDisplay.text);
  8320. this.textDisplayProperties.heightInLines && b && (a.heightInLines = b.heightInLines);
  8321. this.textDisplayProperties.widthInChars && b && (a.widthInChars = b.widthInChars);
  8322. this.textDisplayProperties = a
  8323. };
  8324. a.prototype.textDisplay_changeHandler = function(a) {
  8325. this.invalidateDisplayList();
  8326. this.dispatchEvent(a)
  8327. };
  8328. a.prototype.textDisplay_changingHandler = function(a) {
  8329. var b = new c.Event(a.type, !1, !0);
  8330. b.data = a.data;
  8331. this.dispatchEvent(b);
  8332. b.isDefaultPrevented() && a.preventDefault()
  8333. };
  8334. return a
  8335. }(d.SkinnableComponent);
  8336. d.SkinnableTextBase = f;
  8337. f.prototype.__class__ = "egret.gui.SkinnableTextBase"
  8338. })(c.gui || (c.gui = {}))
  8339. })(egret || (egret = {}));
  8340. __extends = this.__extends || function(c, d) {
  8341. function f() {
  8342. this.constructor = c
  8343. }
  8344. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  8345. f.prototype = d.prototype;
  8346. c.prototype = new f
  8347. };
  8348. (function(c) {
  8349. (function(d) {
  8350. var f = function(b) {
  8351. function a() {
  8352. b.call(this);
  8353. this._fillColor = 16777215;
  8354. this._fillAlpha = 1;
  8355. this._strokeColor = 4473924;
  8356. this._strokeAlpha = 0;
  8357. this._strokeWeight = 1;
  8358. this.touchChildren = !1
  8359. }
  8360. __extends(a, b);
  8361. Object.defineProperty(a.prototype, "graphics", {
  8362. get: function() {
  8363. this._graphics || (this._graphics = new c.Graphics);
  8364. return this._graphics
  8365. },
  8366. enumerable: !0,
  8367. configurable: !0
  8368. });
  8369. a.prototype._render = function(a) {
  8370. this._graphics && this._graphics._draw(a);
  8371. b.prototype._render.call(this, a)
  8372. };
  8373. Object.defineProperty(a.prototype,
  8374. "fillColor", {
  8375. get: function() {
  8376. return this._fillColor
  8377. },
  8378. set: function(a) {
  8379. this._fillColor != a && (this._fillColor = a, this.invalidateDisplayList())
  8380. },
  8381. enumerable: !0,
  8382. configurable: !0
  8383. });
  8384. Object.defineProperty(a.prototype, "fillAlpha", {
  8385. get: function() {
  8386. return this._fillAlpha
  8387. },
  8388. set: function(a) {
  8389. this._fillAlpha != a && (this._fillAlpha = a, this.invalidateDisplayList())
  8390. },
  8391. enumerable: !0,
  8392. configurable: !0
  8393. });
  8394. Object.defineProperty(a.prototype, "strokeColor", {
  8395. get: function() {
  8396. return this._strokeColor
  8397. },
  8398. set: function(a) {
  8399. this._strokeColor != a &&
  8400. (this._strokeColor = a, this.invalidateDisplayList())
  8401. },
  8402. enumerable: !0,
  8403. configurable: !0
  8404. });
  8405. Object.defineProperty(a.prototype, "strokeAlpha", {
  8406. get: function() {
  8407. return this._strokeAlpha
  8408. },
  8409. set: function(a) {
  8410. this._strokeAlpha != a && (this._strokeAlpha = a, this.invalidateDisplayList())
  8411. },
  8412. enumerable: !0,
  8413. configurable: !0
  8414. });
  8415. Object.defineProperty(a.prototype, "strokeWeight", {
  8416. get: function() {
  8417. return this._strokeWeight
  8418. },
  8419. set: function(a) {
  8420. this._strokeWeight != a && (this._strokeWeight = a, this.invalidateDisplayList())
  8421. },
  8422. enumerable: !0,
  8423. configurable: !0
  8424. });
  8425. a.prototype._measureBounds = function() {
  8426. var a = b.prototype._measureBounds.call(this),
  8427. c = this.width,
  8428. d = this.height;
  8429. 0 < a.x && (a.x = 0);
  8430. 0 < a.y && (a.y = 0);
  8431. 0 + c > a.right && (a.right = 0 + c);
  8432. 0 + d > a.bottom && (a.bottom = 0 + d);
  8433. return a
  8434. };
  8435. a.prototype.updateDisplayList = function(a, c) {
  8436. b.prototype.updateDisplayList.call(this, a, a);
  8437. var d = this.graphics;
  8438. d.clear();
  8439. d.beginFill(this._fillColor, this._fillAlpha);
  8440. 0 < this._strokeAlpha && d.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  8441. d.drawRect(0, 0,
  8442. a, c);
  8443. d.endFill()
  8444. };
  8445. return a
  8446. }(d.UIComponent);
  8447. d.Rect = f;
  8448. f.prototype.__class__ = "egret.gui.Rect"
  8449. })(c.gui || (c.gui = {}))
  8450. })(egret || (egret = {}));
  8451. __extends = this.__extends || function(c, d) {
  8452. function f() {
  8453. this.constructor = c
  8454. }
  8455. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  8456. f.prototype = d.prototype;
  8457. c.prototype = new f
  8458. };
  8459. (function(c) {
  8460. (function(d) {
  8461. var f = function(b) {
  8462. function a() {
  8463. b.call(this);
  8464. this.elementsContentChanged = this.createChildrenCalled = !1;
  8465. this._elementsContent = []
  8466. }
  8467. __extends(a, b);
  8468. a.prototype.createChildren = function() {
  8469. b.prototype.createChildren.call(this);
  8470. this.createChildrenCalled = !0;
  8471. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  8472. };
  8473. a.prototype._getElementsContent = function() {
  8474. return this._elementsContent
  8475. };
  8476. Object.defineProperty(a.prototype, "elementsContent", {
  8477. set: function(a) {
  8478. null == a && (a = []);
  8479. if (a != this._elementsContent)
  8480. if (this.createChildrenCalled) this.setElementsContent(a);
  8481. else {
  8482. this.elementsContentChanged = !0;
  8483. for (var b = this._elementsContent.length - 1; 0 <= b; b--) this._elementRemoved(this._elementsContent[b], b);
  8484. this._elementsContent = a
  8485. }
  8486. },
  8487. enumerable: !0,
  8488. configurable: !0
  8489. });
  8490. a.prototype.setElementsContent = function(a) {
  8491. var b;
  8492. for (b = this._elementsContent.length - 1; 0 <= b; b--) this._elementRemoved(this._elementsContent[b], b);
  8493. this._elementsContent = a.concat();
  8494. a = this._elementsContent.length;
  8495. for (b = 0; b < a; b++) {
  8496. var c = this._elementsContent[b];
  8497. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  8498. this._elementAdded(c, b)
  8499. }
  8500. };
  8501. Object.defineProperty(a.prototype, "numElements", {
  8502. get: function() {
  8503. return this._elementsContent.length
  8504. },
  8505. enumerable: !0,
  8506. configurable: !0
  8507. });
  8508. a.prototype.getElementAt = function(a) {
  8509. this.checkForRangeError(a);
  8510. return this._elementsContent[a]
  8511. };
  8512. a.prototype.checkForRangeError = function(a, b) {
  8513. void 0 === b && (b = !1);
  8514. var c = this._elementsContent.length -
  8515. 1;
  8516. b && c++;
  8517. if (0 > a || a > c) throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  8518. };
  8519. a.prototype.addElement = function(a) {
  8520. var b = this.numElements;
  8521. a.parent == this && (b = this.numElements - 1);
  8522. return this.addElementAt(a, b)
  8523. };
  8524. a.prototype.addElementAt = function(a, b) {
  8525. if (a == this) return a;
  8526. this.checkForRangeError(b, !0);
  8527. var c = a.owner;
  8528. if (c == this || a.parent == this) return this.setElementIndex(a, b), a;
  8529. c && "removeElement" in c && a.owner.removeElement(a);
  8530. this._elementsContent.splice(b,
  8531. 0, a);
  8532. this.elementsContentChanged || this._elementAdded(a, b);
  8533. return a
  8534. };
  8535. a.prototype.removeElement = function(a) {
  8536. return this.removeElementAt(this.getElementIndex(a))
  8537. };
  8538. a.prototype.removeElementAt = function(a) {
  8539. this.checkForRangeError(a);
  8540. var b = this._elementsContent[a];
  8541. this.elementsContentChanged || this._elementRemoved(b, a);
  8542. this._elementsContent.splice(a, 1);
  8543. return b
  8544. };
  8545. a.prototype.removeAllElements = function() {
  8546. for (var a = this.numElements - 1; 0 <= a; a--) this.removeElementAt(a)
  8547. };
  8548. a.prototype.getElementIndex = function(a) {
  8549. return this._elementsContent.indexOf(a)
  8550. };
  8551. a.prototype.setElementIndex = function(a, b) {
  8552. this.checkForRangeError(b);
  8553. var c = this.getElementIndex(a); - 1 != c && c != b && (this.elementsContentChanged || this._elementRemoved(a, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(b, 0, a), this.elementsContentChanged || this._elementAdded(a, b, !1))
  8554. };
  8555. a.prototype.swapElements = function(a, b) {
  8556. this.swapElementsAt(this.getElementIndex(a), this.getElementIndex(b))
  8557. };
  8558. a.prototype.swapElementsAt = function(a, b) {
  8559. this.checkForRangeError(a);
  8560. this.checkForRangeError(b);
  8561. if (a > b) {
  8562. var c = b;
  8563. b = a;
  8564. a = c
  8565. } else if (a == b) return;
  8566. var c = this._elementsContent,
  8567. d = c[a],
  8568. f = c[b];
  8569. this.elementsContentChanged || (this._elementRemoved(d, a, !1), this._elementRemoved(f, b, !1));
  8570. c[a] = f;
  8571. c[b] = d;
  8572. this.elementsContentChanged || (this._elementAdded(f, a, !1), this._elementAdded(d, b, !1))
  8573. };
  8574. a.prototype._elementAdded = function(a, b, f) {
  8575. void 0 === f && (f = !0);
  8576. a instanceof c.DisplayObject && this._addToDisplayListAt(a, b, f);
  8577. f && this.hasEventListener(d.ElementExistenceEvent.ELEMENT_ADD) && d.ElementExistenceEvent.dispatchElementExistenceEvent(this,
  8578. d.ElementExistenceEvent.ELEMENT_ADD, a, b);
  8579. this.invalidateSize();
  8580. this.invalidateDisplayList()
  8581. };
  8582. a.prototype._elementRemoved = function(a, b, f) {
  8583. void 0 === f && (f = !0);
  8584. f && this.hasEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE) && d.ElementExistenceEvent.dispatchElementExistenceEvent(this, d.ElementExistenceEvent.ELEMENT_REMOVE, a, b);
  8585. a instanceof c.DisplayObject && a.parent == this && this._removeFromDisplayList(a, f);
  8586. this.invalidateSize();
  8587. this.invalidateDisplayList()
  8588. };
  8589. a.prototype.addChild = function(b) {
  8590. throw Error("addChild()" +
  8591. a.errorStr + "addElement()\u4ee3\u66ff");
  8592. };
  8593. a.prototype.addChildAt = function(b, c) {
  8594. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  8595. };
  8596. a.prototype.removeChild = function(b) {
  8597. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  8598. };
  8599. a.prototype.removeChildAt = function(b) {
  8600. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  8601. };
  8602. a.prototype.setChildIndex = function(b, c) {
  8603. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  8604. };
  8605. a.prototype.swapChildren =
  8606. function(b, c) {
  8607. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  8608. };
  8609. a.prototype.swapChildrenAt = function(b, c) {
  8610. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  8611. };
  8612. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  8613. return a
  8614. }(d.GroupBase);
  8615. d.Group = f;
  8616. f.prototype.__class__ = "egret.gui.Group"
  8617. })(c.gui || (c.gui = {}))
  8618. })(egret || (egret = {}));
  8619. __extends = this.__extends || function(c, d) {
  8620. function f() {
  8621. this.constructor = c
  8622. }
  8623. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  8624. f.prototype = d.prototype;
  8625. c.prototype = new f
  8626. };
  8627. (function(c) {
  8628. (function(d) {
  8629. var f = function(b) {
  8630. function a() {
  8631. b.call(this);
  8632. this._selectable = !0;
  8633. this._displayAsPassword = !1;
  8634. this._editable = this.pendingEditable = this.displayAsPasswordChanged = !0;
  8635. this.editableChanged = !1;
  8636. this._maxChars = 0;
  8637. this.maxCharsChanged = !1;
  8638. this._multiline = !0;
  8639. this.multilineChanged = !1;
  8640. this._restrict = null;
  8641. this.restrictChanged = !1;
  8642. this._heightInLines = NaN;
  8643. this.heightInLinesChanged = !1;
  8644. this._widthInChars = NaN;
  8645. this.widthInCharsChanged = !1;
  8646. this._verticalScrollPosition = this._horizontalScrollPosition =
  8647. this._contentHeight = this._contentWidth = 0;
  8648. this._clipAndEnableScrolling = !1;
  8649. this.defaultWidth = this.defaultHeight = NaN;
  8650. this.isValidating = !1;
  8651. this.selectable = !0
  8652. }
  8653. __extends(a, b);
  8654. Object.defineProperty(a.prototype, "selectable", {
  8655. get: function() {
  8656. return this._selectable
  8657. },
  8658. set: function(a) {
  8659. this._selectable = a
  8660. },
  8661. enumerable: !0,
  8662. configurable: !0
  8663. });
  8664. Object.defineProperty(a.prototype, "displayAsPassword", {
  8665. get: function() {
  8666. return this._displayAsPassword
  8667. },
  8668. set: function(a) {
  8669. a != this._displayAsPassword && (this._displayAsPassword = a, this.displayAsPasswordChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  8670. },
  8671. enumerable: !0,
  8672. configurable: !0
  8673. });
  8674. Object.defineProperty(a.prototype, "editable", {
  8675. get: function() {
  8676. return this._enabled ? this._editable : this.pendingEditable
  8677. },
  8678. set: function(a) {
  8679. this._editable != a && (this._enabled ? (this._editable = a, this.editableChanged = !0, this.invalidateProperties()) : this.pendingEditable = a)
  8680. },
  8681. enumerable: !0,
  8682. configurable: !0
  8683. });
  8684. Object.defineProperty(a.prototype, "enabled", {
  8685. get: function() {
  8686. return this._editable
  8687. },
  8688. set: function(a) {
  8689. a !=
  8690. this._enabled && ((this._enabled = a) ? (this._editable != this.pendingEditable && (this.editableChanged = !0), this._editable = this.pendingEditable) : (this.editable && (this.editableChanged = !0), this.pendingEditable = this._editable, this._editable = !1), this.invalidateProperties())
  8691. },
  8692. enumerable: !0,
  8693. configurable: !0
  8694. });
  8695. Object.defineProperty(a.prototype, "maxChars", {
  8696. get: function() {
  8697. return this._maxChars
  8698. },
  8699. set: function(a) {
  8700. void 0 === a && (a = 0);
  8701. a != this._maxChars && (this._maxChars = a, this.maxCharsChanged = !0, this.invalidateProperties())
  8702. },
  8703. enumerable: !0,
  8704. configurable: !0
  8705. });
  8706. Object.defineProperty(a.prototype, "multiline", {
  8707. get: function() {
  8708. return this._multiline
  8709. },
  8710. set: function(a) {
  8711. a != this.multiline && (this._multiline = a, this.multilineChanged = !0, this.invalidateProperties())
  8712. },
  8713. enumerable: !0,
  8714. configurable: !0
  8715. });
  8716. Object.defineProperty(a.prototype, "restrict", {
  8717. get: function() {
  8718. return this._restrict
  8719. },
  8720. set: function(a) {
  8721. a != this._restrict && (this._restrict = a, this.restrictChanged = !0, this.invalidateProperties())
  8722. },
  8723. enumerable: !0,
  8724. configurable: !0
  8725. });
  8726. a.prototype._setFontSize =
  8727. function(a) {
  8728. void 0 === a && (a = 0);
  8729. this._size != a && (b.prototype._setFontSize.call(this, a), this.widthInCharsChanged = this.heightInLinesChanged = !0)
  8730. };
  8731. a.prototype._setLineSpacing = function(a) {
  8732. this._lineSpacing != a && (b.prototype._setLineSpacing.call(this, a), this.heightInLinesChanged = !0)
  8733. };
  8734. Object.defineProperty(a.prototype, "heightInLines", {
  8735. get: function() {
  8736. return this._heightInLines
  8737. },
  8738. set: function(a) {
  8739. this._heightInLines != a && (this._heightInLines = a, this.heightInLinesChanged = !0, this.invalidateProperties())
  8740. },
  8741. enumerable: !0,
  8742. configurable: !0
  8743. });
  8744. Object.defineProperty(a.prototype, "widthInChars", {
  8745. get: function() {
  8746. return this._widthInChars
  8747. },
  8748. set: function(a) {
  8749. this._widthInChars != a && (this._widthInChars = a, this.widthInCharsChanged = !0, this.invalidateProperties())
  8750. },
  8751. enumerable: !0,
  8752. configurable: !0
  8753. });
  8754. Object.defineProperty(a.prototype, "contentWidth", {
  8755. get: function() {
  8756. return this._contentWidth
  8757. },
  8758. enumerable: !0,
  8759. configurable: !0
  8760. });
  8761. a.prototype.setContentWidth = function(a) {
  8762. if (a != this._contentWidth) {
  8763. var b = this._contentWidth;
  8764. this._contentWidth = a;
  8765. this.dispatchPropertyChangeEvent("contentWidth",
  8766. b, a)
  8767. }
  8768. };
  8769. Object.defineProperty(a.prototype, "contentHeight", {
  8770. get: function() {
  8771. return this._contentHeight
  8772. },
  8773. enumerable: !0,
  8774. configurable: !0
  8775. });
  8776. a.prototype.setContentHeight = function(a) {
  8777. if (a != this._contentHeight) {
  8778. var b = this._contentHeight;
  8779. this._contentHeight = a;
  8780. this.dispatchPropertyChangeEvent("contentHeight", b, a)
  8781. }
  8782. };
  8783. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  8784. get: function() {
  8785. return this._horizontalScrollPosition
  8786. },
  8787. set: function(a) {
  8788. this._horizontalScrollPosition != a && (this._horizontalScrollPosition =
  8789. a)
  8790. },
  8791. enumerable: !0,
  8792. configurable: !0
  8793. });
  8794. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  8795. get: function() {
  8796. return this._verticalScrollPosition
  8797. },
  8798. set: function(a) {
  8799. this._verticalScrollPosition != a && (this._verticalScrollPosition = a = Math.round(a))
  8800. },
  8801. enumerable: !0,
  8802. configurable: !0
  8803. });
  8804. a.prototype.getScrollVByVertitcalPos = function(a) {
  8805. if (0 == this._textField.numLines) return 1;
  8806. var b = this._textField._getLineHeight();
  8807. return this._textField.height + (this.height - 4) % b - this.height == a ? this._textField.maxScrollV : parseInt((a -
  8808. 2) / b) + 1
  8809. };
  8810. a.prototype.getVerticalPosByScrollV = function(a) {
  8811. void 0 === a && (a = 0);
  8812. if (1 == a || 0 == this._textField.numLines) return 0;
  8813. var b = this._textField._getLineHeight();
  8814. return a == this._textField.maxScrollV ? this._textField.height + (this.height - 4) % b - this.height : b * (a - 1) + 2
  8815. };
  8816. a.prototype.getHorizontalScrollPositionDelta = function(a) {
  8817. void 0 === a && (a = 0);
  8818. var b = 0,
  8819. c = this._contentWidth - this._horizontalScrollPosition - this.width,
  8820. f = -this._horizontalScrollPosition;
  8821. switch (a) {
  8822. case d.NavigationUnit.LEFT:
  8823. b = 0 >= this._horizontalScrollPosition ?
  8824. 0 : Math.max(f, -this.size);
  8825. break;
  8826. case d.NavigationUnit.RIGHT:
  8827. b = this._horizontalScrollPosition + this.width >= this.contentWidth ? 0 : Math.min(c, this.size);
  8828. break;
  8829. case d.NavigationUnit.PAGE_LEFT:
  8830. b = Math.max(f, -this.width);
  8831. break;
  8832. case d.NavigationUnit.PAGE_RIGHT:
  8833. b = Math.min(c, this.width);
  8834. break;
  8835. case d.NavigationUnit.HOME:
  8836. b = f;
  8837. break;
  8838. case d.NavigationUnit.END:
  8839. b = c
  8840. }
  8841. return b
  8842. };
  8843. a.prototype.getVerticalScrollPositionDelta = function(a) {
  8844. void 0 === a && (a = 0);
  8845. var b = 0,
  8846. c = this._contentHeight - this._verticalScrollPosition - this.height,
  8847. f = -this._verticalScrollPosition;
  8848. switch (a) {
  8849. case d.NavigationUnit.UP:
  8850. b = this.getVScrollDelta(-1);
  8851. break;
  8852. case d.NavigationUnit.DOWN:
  8853. b = this.getVScrollDelta(1);
  8854. break;
  8855. case d.NavigationUnit.PAGE_UP:
  8856. b = Math.max(f, -this.width);
  8857. break;
  8858. case d.NavigationUnit.PAGE_DOWN:
  8859. b = Math.min(c, this.width);
  8860. break;
  8861. case d.NavigationUnit.HOME:
  8862. b = f;
  8863. break;
  8864. case d.NavigationUnit.END:
  8865. b = c
  8866. }
  8867. return b
  8868. };
  8869. a.prototype.getVScrollDelta = function(a) {
  8870. void 0 === a && (a = 0);
  8871. if (!this._textField) return 0;
  8872. a = this.getScrollVByVertitcalPos(this._verticalScrollPosition) +
  8873. a;
  8874. a = Math.max(1, Math.min(this._textField.maxScrollV, a));
  8875. return this.getVerticalPosByScrollV(a) - this._verticalScrollPosition
  8876. };
  8877. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  8878. get: function() {
  8879. return this._clipAndEnableScrolling
  8880. },
  8881. set: function(a) {
  8882. this._clipAndEnableScrolling != a && (this._clipAndEnableScrolling = a)
  8883. },
  8884. enumerable: !0,
  8885. configurable: !0
  8886. });
  8887. a.prototype.commitProperties = function() {
  8888. this._textField || (this.restrictChanged = this.multilineChanged = this.maxCharsChanged = this.displayAsPasswordChanged =
  8889. this.editableChanged = !0);
  8890. b.prototype.commitProperties.call(this);
  8891. this.editableChanged && (this._textField.type = this._editable ? c.TextFieldType.INPUT : c.TextFieldType.DYNAMIC, this.editableChanged = !1);
  8892. this.displayAsPasswordChanged && (this._textField.displayAsPassword = this._displayAsPassword, this.displayAsPasswordChanged = !1);
  8893. this.maxCharsChanged && (this._textField.maxChars = this._maxChars, this.maxCharsChanged = !1);
  8894. this.multilineChanged && (this._textField.multiline = this._multiline, this.multilineChanged = !1);
  8895. this.restrictChanged &&
  8896. (this.restrictChanged = !1);
  8897. if (this.heightInLinesChanged)
  8898. if (this.heightInLinesChanged = !1, isNaN(this._heightInLines)) this.defaultHeight = NaN;
  8899. else {
  8900. var a = parseInt(this.heightInLines),
  8901. d = 22;
  8902. 0 < this._textField._text.length ? d = this._textField._getLineHeight() : (this._textField._text = "M", d = this._textField._getLineHeight(), this._textField._text = "");
  8903. this.defaultHeight = a * d + 4
  8904. }
  8905. this.widthInCharsChanged && (this.widthInCharsChanged = !1, isNaN(this._widthInChars) ? this.defaultWidth = NaN : (a = parseInt(this._widthInChars), this.defaultWidth =
  8906. this.size * a + 5))
  8907. };
  8908. a.prototype.updateDisplayList = function(a, c) {
  8909. this.isValidating = !0;
  8910. b.prototype.updateDisplayList.call(this, a, c);
  8911. this.updateContentSize();
  8912. this.isValidating = !1
  8913. };
  8914. a.prototype.updateContentSize = function() {
  8915. if (this.clipAndEnableScrolling) {
  8916. this.setContentWidth(this._textField.width);
  8917. var a = 0;
  8918. 0 == this._textField.numLines ? a = 4 : (a = this._textField._getLineHeight(), a = this._textField.height + (this.height - 4) % a);
  8919. this.setContentHeight(a)
  8920. }
  8921. };
  8922. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  8923. get: function() {
  8924. this.validateProperties();
  8925. return this._textField ? this._textField.selectionBeginIndex : 0
  8926. },
  8927. enumerable: !0,
  8928. configurable: !0
  8929. });
  8930. Object.defineProperty(a.prototype, "selectionEndIndex", {
  8931. get: function() {
  8932. this.validateProperties();
  8933. return this._textField ? this._textField.selectionEndIndex : 0
  8934. },
  8935. enumerable: !0,
  8936. configurable: !0
  8937. });
  8938. Object.defineProperty(a.prototype, "caretIndex", {
  8939. get: function() {
  8940. this.validateProperties();
  8941. return this._textField ? this._textField.caretIndex : 0
  8942. },
  8943. enumerable: !0,
  8944. configurable: !0
  8945. });
  8946. a.prototype.setSelection = function(a, b) {
  8947. void 0 ===
  8948. b && (b = 0);
  8949. this.validateProperties();
  8950. this._textField && this._textField._setSelection(a, b)
  8951. };
  8952. a.prototype.selectAll = function() {
  8953. this.validateProperties();
  8954. this._textField && this._textField._setSelection(0, this._textField.text.length)
  8955. };
  8956. a.prototype.measure = function() {
  8957. this.measuredWidth = isNaN(this.defaultWidth) ? d.TextBase.DEFAULT_MEASURED_WIDTH : this.defaultWidth;
  8958. 0 != this._maxChars && (this.measuredWidth = Math.min(this.measuredWidth, this._textField.width));
  8959. this.measuredHeight = this._multiline ? isNaN(this.defaultHeight) ?
  8960. 2 * d.TextBase.DEFAULT_MEASURED_HEIGHT : this.defaultHeight : this._textField.height
  8961. };
  8962. a.prototype._createTextField = function() {
  8963. b.prototype._createTextField.call(this);
  8964. this._textField.type = this._editable ? c.TextFieldType.INPUT : c.TextFieldType.DYNAMIC;
  8965. this._textField.multiline = this._multiline;
  8966. this._textField.addEventListener(c.Event.CHANGE, this.textField_changeHandler, this);
  8967. this._textField.addEventListener("scroll", this.textField_scrollHandler, this);
  8968. this._textField.addEventListener("input", this.textField_textInputHandler,
  8969. this)
  8970. };
  8971. a.prototype.textField_changeHandler = function(a) {
  8972. a.stopImmediatePropagation();
  8973. this.dispatchEvent(new c.Event(c.Event.CHANGE));
  8974. this.invalidateSize();
  8975. this.invalidateDisplayList();
  8976. this.updateContentSize()
  8977. };
  8978. a.prototype.textField_scrollHandler = function(a) {};
  8979. a.prototype.textField_textInputHandler = function(a) {
  8980. a.stopImmediatePropagation();
  8981. var b = new c.Event(a.type, !1, !0);
  8982. b.data = a.data;
  8983. this.dispatchEvent(b);
  8984. b.isDefaultPrevented() && a.preventDefault()
  8985. };
  8986. return a
  8987. }(d.TextBase);
  8988. d.EditableText = f;
  8989. f.prototype.__class__ =
  8990. "egret.gui.EditableText"
  8991. })(c.gui || (c.gui = {}))
  8992. })(egret || (egret = {}));
  8993. __extends = this.__extends || function(c, d) {
  8994. function f() {
  8995. this.constructor = c
  8996. }
  8997. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  8998. f.prototype = d.prototype;
  8999. c.prototype = new f
  9000. };
  9001. (function(c) {
  9002. (function(d) {
  9003. var f = function(b) {
  9004. function a() {
  9005. b.call(this)
  9006. }
  9007. __extends(a, b);
  9008. Object.defineProperty(a.prototype, "widthInChars", {
  9009. get: function() {
  9010. return b.prototype._getWidthInChars.call(this)
  9011. },
  9012. set: function(a) {
  9013. b.prototype._setWidthInChars.call(this, a)
  9014. },
  9015. enumerable: !0,
  9016. configurable: !0
  9017. });
  9018. a.prototype._setText = function(a) {
  9019. b.prototype._setText.call(this, a);
  9020. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  9021. };
  9022. a.prototype.partAdded = function(a, c) {
  9023. b.prototype.partAdded.call(this, a, c);
  9024. c == this.textDisplay && (this.textDisplay.multiline = !1)
  9025. };
  9026. a.prototype.createSkinParts = function() {
  9027. this.textDisplay = new d.EditableText;
  9028. this.textDisplay.widthInChars = 10;
  9029. this.textDisplay.multiline = !1;
  9030. this.textDisplay.left = 1;
  9031. this.textDisplay.right = 1;
  9032. this.textDisplay.top = 1;
  9033. this.textDisplay.bottom = 1;
  9034. this._addToDisplayList(this.textDisplay);
  9035. this.partAdded("textDisplay", this.textDisplay)
  9036. };
  9037. return a
  9038. }(d.SkinnableTextBase);
  9039. d.TextInput = f;
  9040. f.prototype.__class__ = "egret.gui.TextInput"
  9041. })(c.gui || (c.gui = {}))
  9042. })(egret || (egret = {}));
  9043. __extends = this.__extends || function(c, d) {
  9044. function f() {
  9045. this.constructor = c
  9046. }
  9047. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9048. f.prototype = d.prototype;
  9049. c.prototype = new f
  9050. };
  9051. (function(c) {
  9052. (function(d) {
  9053. var f = function(b) {
  9054. function a(a, c, d) {
  9055. void 0 === c && (c = !1);
  9056. void 0 === d && (d = !1);
  9057. b.call(this, a, c, d)
  9058. }
  9059. __extends(a, b);
  9060. a.dispatchUIEvent = function(b, d) {
  9061. c.Event._dispatchByTarget(a, b, d)
  9062. };
  9063. a.INITIALIZE = "initialize";
  9064. a.CREATION_COMPLETE = "creationComplete";
  9065. a.UPDATE_COMPLETE = "updateComplete";
  9066. a.BUTTON_DOWN = "buttonDown";
  9067. a.CHANGE_END = "changeEnd";
  9068. a.CHANGE_START = "changeStart";
  9069. a.CHANGING = "changing";
  9070. a.VALUE_COMMIT = "valueCommit";
  9071. a.SKIN_CHANGED = "skinChanged";
  9072. a.CONTENT_CHANGED = "contentChanged";
  9073. a.OPEN =
  9074. "open";
  9075. a.CLOSE = "close";
  9076. a.PLAY_COMPLETE = "playComplete";
  9077. return a
  9078. }(c.Event);
  9079. d.UIEvent = f;
  9080. f.prototype.__class__ = "egret.gui.UIEvent"
  9081. })(c.gui || (c.gui = {}))
  9082. })(egret || (egret = {}));
  9083. __extends = this.__extends || function(c, d) {
  9084. function f() {
  9085. this.constructor = c
  9086. }
  9087. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9088. f.prototype = d.prototype;
  9089. c.prototype = new f
  9090. };
  9091. (function(c) {
  9092. (function(d) {
  9093. var f = function(b) {
  9094. function a(a, c, d, f, g, h, m, k) {
  9095. void 0 === c && (c = !1);
  9096. void 0 === d && (d = !1);
  9097. void 0 === f && (f = null);
  9098. void 0 === g && (g = null);
  9099. void 0 === h && (h = null);
  9100. void 0 === m && (m = null);
  9101. void 0 === k && (k = null);
  9102. b.call(this, a, c, d);
  9103. this.kind = f;
  9104. this.property = g;
  9105. this.oldValue = h;
  9106. this.newValue = m;
  9107. this.source = k
  9108. }
  9109. __extends(a, b);
  9110. a.dispatchPropertyChangeEvent = function(b, d, f, n, g, h) {
  9111. void 0 === d && (d = null);
  9112. void 0 === f && (f = null);
  9113. void 0 === n && (n = null);
  9114. void 0 === g && (g = null);
  9115. void 0 === h && (h = null);
  9116. var m = c.Event._getPropertyData(a);
  9117. m.kind = d;
  9118. m.property = f;
  9119. m.oldValue = n;
  9120. m.newValue = g;
  9121. m.source = h;
  9122. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, m)
  9123. };
  9124. a.PROPERTY_CHANGE = "propertyChange";
  9125. return a
  9126. }(c.Event);
  9127. d.PropertyChangeEvent = f;
  9128. f.prototype.__class__ = "egret.gui.PropertyChangeEvent"
  9129. })(c.gui || (c.gui = {}))
  9130. })(egret || (egret = {}));
  9131. (function(c) {
  9132. (function(c) {
  9133. var f = function() {
  9134. function b() {}
  9135. b.UPDATE = "update";
  9136. b.DELETE = "delete";
  9137. return b
  9138. }();
  9139. c.PropertyChangeEventKind = f;
  9140. f.prototype.__class__ = "egret.gui.PropertyChangeEventKind"
  9141. })(c.gui || (c.gui = {}))
  9142. })(egret || (egret = {}));
  9143. __extends = this.__extends || function(c, d) {
  9144. function f() {
  9145. this.constructor = c
  9146. }
  9147. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9148. f.prototype = d.prototype;
  9149. c.prototype = new f
  9150. };
  9151. (function(c) {
  9152. (function(d) {
  9153. var f = function(b) {
  9154. function a(a, c, d, f, g) {
  9155. void 0 === c && (c = NaN);
  9156. void 0 === d && (d = NaN);
  9157. void 0 === f && (f = !1);
  9158. void 0 === g && (g = !1);
  9159. b.call(this, a, f, g);
  9160. this.oldX = c;
  9161. this.oldY = d
  9162. }
  9163. __extends(a, b);
  9164. a.dispatchMoveEvent = function(b, d, f) {
  9165. void 0 === d && (d = NaN);
  9166. void 0 === f && (f = NaN);
  9167. var n = c.Event._getPropertyData(a);
  9168. n.oldX = d;
  9169. n.oldY = f;
  9170. c.Event._dispatchByTarget(a, b, a.MOVE, n)
  9171. };
  9172. a.MOVE = "move";
  9173. return a
  9174. }(c.Event);
  9175. d.MoveEvent = f;
  9176. f.prototype.__class__ = "egret.gui.MoveEvent"
  9177. })(c.gui || (c.gui = {}))
  9178. })(egret || (egret = {}));
  9179. __extends = this.__extends || function(c, d) {
  9180. function f() {
  9181. this.constructor = c
  9182. }
  9183. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9184. f.prototype = d.prototype;
  9185. c.prototype = new f
  9186. };
  9187. (function(c) {
  9188. (function(d) {
  9189. var f = function(b) {
  9190. function a(a, c, d, f, g) {
  9191. void 0 === c && (c = NaN);
  9192. void 0 === d && (d = NaN);
  9193. void 0 === f && (f = !1);
  9194. void 0 === g && (g = !1);
  9195. b.call(this, a, f, g);
  9196. this.oldWidth = c;
  9197. this.oldHeight = d
  9198. }
  9199. __extends(a, b);
  9200. a.dispatchResizeEvent = function(b, d, f) {
  9201. void 0 === d && (d = NaN);
  9202. void 0 === f && (f = NaN);
  9203. var n = c.Event._getPropertyData(a);
  9204. n.oldWidth = d;
  9205. n.oldHeight = f;
  9206. c.Event._dispatchByTarget(a, b, a.RESIZE, n)
  9207. };
  9208. a.RESIZE = "resize";
  9209. return a
  9210. }(c.Event);
  9211. d.ResizeEvent = f;
  9212. f.prototype.__class__ = "egret.gui.ResizeEvent"
  9213. })(c.gui ||
  9214. (c.gui = {}))
  9215. })(egret || (egret = {}));
  9216. __extends = this.__extends || function(c, d) {
  9217. function f() {
  9218. this.constructor = c
  9219. }
  9220. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9221. f.prototype = d.prototype;
  9222. c.prototype = new f
  9223. };
  9224. (function(c) {
  9225. (function(d) {
  9226. var f = function(b) {
  9227. function a(a, c, d, f, g) {
  9228. void 0 === c && (c = !1);
  9229. void 0 === d && (d = !1);
  9230. void 0 === f && (f = null);
  9231. void 0 === g && (g = null);
  9232. b.call(this, a, c, d);
  9233. this.partName = f;
  9234. this.instance = g
  9235. }
  9236. __extends(a, b);
  9237. a.dispatchSkinPartEvent = function(b, d, f, n) {
  9238. void 0 === f && (f = null);
  9239. void 0 === n && (n = null);
  9240. var g = c.Event._getPropertyData(a);
  9241. g.partName = f;
  9242. g.instance = n;
  9243. c.Event._dispatchByTarget(a, b, d, g)
  9244. };
  9245. a.PART_ADDED = "partAdded";
  9246. a.PART_REMOVED = "partRemoved";
  9247. return a
  9248. }(c.Event);
  9249. d.SkinPartEvent = f;
  9250. f.prototype.__class__ =
  9251. "egret.gui.SkinPartEvent"
  9252. })(c.gui || (c.gui = {}))
  9253. })(egret || (egret = {}));
  9254. __extends = this.__extends || function(c, d) {
  9255. function f() {
  9256. this.constructor = c
  9257. }
  9258. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9259. f.prototype = d.prototype;
  9260. c.prototype = new f
  9261. };
  9262. (function(c) {
  9263. (function(d) {
  9264. var f = function(b) {
  9265. function a(a, c, d, f, g) {
  9266. void 0 === c && (c = !1);
  9267. void 0 === d && (d = !1);
  9268. void 0 === f && (f = null);
  9269. void 0 === g && (g = -1);
  9270. b.call(this, a, c, d);
  9271. this.element = f;
  9272. this.index = g
  9273. }
  9274. __extends(a, b);
  9275. a.dispatchElementExistenceEvent = function(b, d, f, n) {
  9276. void 0 === f && (f = null);
  9277. void 0 === n && (n = -1);
  9278. var g = c.Event._getPropertyData(a);
  9279. g.element = f;
  9280. g.index = n;
  9281. c.Event._dispatchByTarget(a, b, d, g)
  9282. };
  9283. a.ELEMENT_ADD = "elementAdd";
  9284. a.ELEMENT_REMOVE = "elementRemove";
  9285. return a
  9286. }(c.Event);
  9287. d.ElementExistenceEvent = f;
  9288. f.prototype.__class__ =
  9289. "egret.gui.ElementExistenceEvent"
  9290. })(c.gui || (c.gui = {}))
  9291. })(egret || (egret = {}));
  9292. __extends = this.__extends || function(c, d) {
  9293. function f() {
  9294. this.constructor = c
  9295. }
  9296. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9297. f.prototype = d.prototype;
  9298. c.prototype = new f
  9299. };
  9300. (function(c) {
  9301. (function(d) {
  9302. var f = function(b) {
  9303. function a(a, c, d, f, g) {
  9304. void 0 === c && (c = !1);
  9305. void 0 === d && (d = !1);
  9306. void 0 === f && (f = null);
  9307. void 0 === g && (g = !1);
  9308. b.call(this, a, c, d);
  9309. this.popUp = f;
  9310. this.modal = g
  9311. }
  9312. __extends(a, b);
  9313. a.dispatchPopUpEvent = function(b, d, f, n) {
  9314. void 0 === f && (f = null);
  9315. void 0 === n && (n = !1);
  9316. var g = c.Event._getPropertyData(a);
  9317. g.popUp = f;
  9318. g.modal = n;
  9319. c.Event._dispatchByTarget(a, b, d, g)
  9320. };
  9321. a.ADD_POPUP = "addPopUp";
  9322. a.REMOVE_POPUP = "removePopUp";
  9323. a.BRING_TO_FRONT = "bringToFront";
  9324. return a
  9325. }(c.Event);
  9326. d.PopUpEvent = f;
  9327. f.prototype.__class__ =
  9328. "egret.gui.PopUpEvent"
  9329. })(c.gui || (c.gui = {}))
  9330. })(egret || (egret = {}));
  9331. __extends = this.__extends || function(c, d) {
  9332. function f() {
  9333. this.constructor = c
  9334. }
  9335. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9336. f.prototype = d.prototype;
  9337. c.prototype = new f
  9338. };
  9339. (function(c) {
  9340. (function(d) {
  9341. var f = function(b) {
  9342. function a() {
  9343. b.call(this);
  9344. this._useVirtualLayout = !1
  9345. }
  9346. __extends(a, b);
  9347. Object.defineProperty(a.prototype, "target", {
  9348. get: function() {
  9349. return this._target
  9350. },
  9351. set: function(a) {
  9352. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  9353. },
  9354. enumerable: !0,
  9355. configurable: !0
  9356. });
  9357. Object.defineProperty(a.prototype, "useVirtualLayout", {
  9358. get: function() {
  9359. return this._useVirtualLayout
  9360. },
  9361. set: function(a) {
  9362. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"),
  9363. this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  9364. },
  9365. enumerable: !0,
  9366. configurable: !0
  9367. });
  9368. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  9369. get: function() {
  9370. return this._typicalLayoutRect
  9371. },
  9372. set: function(a) {
  9373. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  9374. },
  9375. enumerable: !0,
  9376. configurable: !0
  9377. });
  9378. a.prototype.scrollPositionChanged = function() {};
  9379. a.prototype.clearVirtualLayoutCache = function() {};
  9380. a.prototype.elementAdded =
  9381. function(a) {};
  9382. a.prototype.elementRemoved = function(a) {};
  9383. a.prototype.measure = function() {};
  9384. a.prototype.updateDisplayList = function(a, b) {};
  9385. return a
  9386. }(c.EventDispatcher);
  9387. d.LayoutBase = f;
  9388. f.prototype.__class__ = "egret.gui.LayoutBase"
  9389. })(c.gui || (c.gui = {}))
  9390. })(egret || (egret = {}));
  9391. __extends = this.__extends || function(c, d) {
  9392. function f() {
  9393. this.constructor = c
  9394. }
  9395. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9396. f.prototype = d.prototype;
  9397. c.prototype = new f
  9398. };
  9399. (function(c) {
  9400. (function(d) {
  9401. var f = function(b) {
  9402. function a() {
  9403. b.call(this);
  9404. this._mouseWheelSpeed = 20
  9405. }
  9406. __extends(a, b);
  9407. Object.defineProperty(a.prototype, "useVirtualLayout", {
  9408. set: function(a) {},
  9409. enumerable: !0,
  9410. configurable: !0
  9411. });
  9412. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  9413. get: function() {
  9414. return this._mouseWheelSpeed
  9415. },
  9416. set: function(a) {
  9417. 0 == a && (a = 1);
  9418. this._mouseWheelSpeed = a
  9419. },
  9420. enumerable: !0,
  9421. configurable: !0
  9422. });
  9423. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  9424. var b = new c.Rectangle;
  9425. b.x = a.x - this._mouseWheelSpeed;
  9426. b.right = a.x;
  9427. return b
  9428. };
  9429. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  9430. var b = new c.Rectangle;
  9431. b.x = a.right;
  9432. b.right = a.right + this._mouseWheelSpeed;
  9433. return b
  9434. };
  9435. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  9436. var b = new c.Rectangle;
  9437. b.y = a.y - this._mouseWheelSpeed;
  9438. b.bottom = a.y;
  9439. return b
  9440. };
  9441. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  9442. var b = new c.Rectangle;
  9443. b.y = a.bottom;
  9444. b.bottom = a.bottom + this._mouseWheelSpeed;
  9445. return b
  9446. };
  9447. a.prototype.measure = function() {
  9448. b.prototype.measure.call(this);
  9449. if (null !=
  9450. this.target) {
  9451. for (var a = 0, c = 0, d = this.target.numElements, f = 0; f < d; f++) {
  9452. var g = this.target.getElementAt(f);
  9453. if (g && g.includeInLayout) {
  9454. var h = g.horizontalCenter,
  9455. m = g.verticalCenter,
  9456. k = g.left,
  9457. p = g.right,
  9458. r = g.top,
  9459. s = g.bottom;
  9460. isNaN(k) || isNaN(p) ? isNaN(h) ? isNaN(k) && isNaN(p) ? h = g.preferredX : (h = isNaN(k) ? 0 : k, h += isNaN(p) ? 0 : p) : h = 2 * Math.abs(h) : h = k + p;
  9461. isNaN(r) || isNaN(s) ? isNaN(m) ? isNaN(r) && isNaN(s) ? m = g.preferredY : (m = isNaN(r) ? 0 : r, m += isNaN(s) ? 0 : s) : m = 2 * Math.abs(m) : m = r + s;
  9462. s = g.preferredHeight;
  9463. a = Math.ceil(Math.max(a, h + g.preferredWidth));
  9464. c = Math.ceil(Math.max(c, m + s))
  9465. }
  9466. }
  9467. this.target.measuredWidth = a;
  9468. this.target.measuredHeight = c
  9469. }
  9470. };
  9471. a.prototype.updateDisplayList = function(a, c) {
  9472. b.prototype.updateDisplayList.call(this, a, c);
  9473. if (null != this.target) {
  9474. for (var d = this.target.numElements, f = 0, g = 0, h = 0; h < d; h++) {
  9475. var m = this.target.getElementAt(h);
  9476. if (null != m && m.includeInLayout) {
  9477. var k = m.horizontalCenter,
  9478. p = m.verticalCenter,
  9479. r = m.left,
  9480. s = m.right,
  9481. t = m.top,
  9482. v = m.bottom,
  9483. x = m.percentWidth,
  9484. A = m.percentHeight,
  9485. z = NaN,
  9486. y = NaN;
  9487. isNaN(r) || isNaN(s) ? isNaN(x) || (z = Math.round(a * Math.min(0.01 *
  9488. x, 1))) : z = a - s - r;
  9489. isNaN(t) || isNaN(v) ? isNaN(A) || (y = Math.round(c * Math.min(0.01 * A, 1))) : y = c - v - t;
  9490. m.setLayoutBoundsSize(z, y);
  9491. x = m.layoutBoundsWidth;
  9492. A = m.layoutBoundsHeight;
  9493. y = z = NaN;
  9494. z = isNaN(k) ? isNaN(r) ? isNaN(s) ? m.layoutBoundsX : a - x - s : r : Math.round((a - x) / 2 + k);
  9495. y = isNaN(p) ? isNaN(t) ? isNaN(v) ? m.layoutBoundsY : c - A - v : t : Math.round((c - A) / 2 + p);
  9496. m.setLayoutBoundsPosition(z, y);
  9497. f = Math.max(f, z + x);
  9498. g = Math.max(g, y + A)
  9499. }
  9500. }
  9501. this.target.setContentSize(f, g)
  9502. }
  9503. };
  9504. return a
  9505. }(d.LayoutBase);
  9506. d.BasicLayout = f;
  9507. f.prototype.__class__ = "egret.gui.BasicLayout"
  9508. })(c.gui ||
  9509. (c.gui = {}))
  9510. })(egret || (egret = {}));
  9511. (function(c) {
  9512. (function(c) {
  9513. var f = function() {
  9514. function b(a, b, c) {
  9515. this.raw_getElementAt = "raw_getElementAt";
  9516. this.raw_addElementAt = "raw_addElementAt";
  9517. this.raw_getElementIndex = "raw_getElementIndex";
  9518. this.raw_removeElement = "raw_removeElement";
  9519. this.raw_removeElementAt = "raw_removeElementAt";
  9520. this.raw_setElementIndex = "raw_setElementIndex";
  9521. this.owner = a;
  9522. this.lowerBoundReference = b;
  9523. this.upperBoundReference = c
  9524. }
  9525. Object.defineProperty(b.prototype, "numElements", {
  9526. get: function() {
  9527. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  9528. },
  9529. enumerable: !0,
  9530. configurable: !0
  9531. });
  9532. b.prototype.getElementAt = function(a) {
  9533. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  9534. };
  9535. b.prototype.addElement = function(a) {
  9536. var b = this.owner[this.upperBoundReference];
  9537. a.parent === this.owner && b--;
  9538. this.owner[this.upperBoundReference] ++;
  9539. this.owner[this.raw_addElementAt](a, b);
  9540. a.ownerChanged(this);
  9541. return a
  9542. };
  9543. b.prototype.addElementAt = function(a, b) {
  9544. this.owner[this.upperBoundReference] ++;
  9545. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] +
  9546. b);
  9547. a.ownerChanged(this);
  9548. return a
  9549. };
  9550. b.prototype.removeElement = function(a) {
  9551. var b = this.owner[this.raw_getElementIndex](a);
  9552. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference] --);
  9553. a.ownerChanged(null);
  9554. return a
  9555. };
  9556. b.prototype.removeElementAt = function(a) {
  9557. a += this.owner[this.lowerBoundReference];
  9558. var b;
  9559. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a),
  9560. this.owner[this.upperBoundReference] --);
  9561. b.ownerChanged(null);
  9562. return b
  9563. };
  9564. b.prototype.getElementIndex = function(a) {
  9565. a = this.owner[this.raw_getElementIndex](a);
  9566. return a -= this.owner[this.lowerBoundReference]
  9567. };
  9568. b.prototype.setElementIndex = function(a, b) {
  9569. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  9570. };
  9571. return b
  9572. }();
  9573. c.UILayer = f;
  9574. f.prototype.__class__ = "egret.gui.UILayer"
  9575. })(c.gui || (c.gui = {}))
  9576. })(egret || (egret = {}));
  9577. __extends = this.__extends || function(c, d) {
  9578. function f() {
  9579. this.constructor = c
  9580. }
  9581. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9582. f.prototype = d.prototype;
  9583. c.prototype = new f
  9584. };
  9585. (function(c) {
  9586. (function(d) {
  9587. var f = function(b) {
  9588. function a() {
  9589. b.call(this);
  9590. this._autoResize = !0;
  9591. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  9592. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9593. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  9594. }
  9595. __extends(a, b);
  9596. a.prototype.onAddToStage = function(a) {
  9597. if (d.UIGlobals._uiStage) throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");
  9598. d.UIGlobals._uiStage = this;
  9599. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  9600. };
  9601. a.prototype.onRemoveFromStage = function(a) {
  9602. d.UIGlobals._uiStage = null;
  9603. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  9604. };
  9605. a.prototype.onResize = function(a) {
  9606. this._setWidth(this.stage.stageWidth);
  9607. this._setHeight(this.stage.stageHeight)
  9608. };
  9609. Object.defineProperty(a.prototype, "autoResize", {
  9610. get: function() {
  9611. return this._autoResize
  9612. },
  9613. set: function(a) {
  9614. this._autoResize !=
  9615. a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)))
  9616. },
  9617. enumerable: !0,
  9618. configurable: !0
  9619. });
  9620. Object.defineProperty(a.prototype, "x", {
  9621. get: function() {
  9622. return this._x
  9623. },
  9624. set: function(a) {
  9625. this._autoResize || (this._x = a)
  9626. },
  9627. enumerable: !0,
  9628. configurable: !0
  9629. });
  9630. Object.defineProperty(a.prototype, "y", {
  9631. get: function() {
  9632. return this._y
  9633. },
  9634. set: function(a) {
  9635. this._autoResize || (this._y = a)
  9636. },
  9637. enumerable: !0,
  9638. configurable: !0
  9639. });
  9640. Object.defineProperty(a.prototype, "width", {
  9641. get: function() {
  9642. return this._width
  9643. },
  9644. set: function(a) {
  9645. this._autoResize || this._setWidth(a)
  9646. },
  9647. enumerable: !0,
  9648. configurable: !0
  9649. });
  9650. Object.defineProperty(a.prototype, "height", {
  9651. get: function() {
  9652. return this._height
  9653. },
  9654. set: function(a) {
  9655. this._autoResize || this._setHeight(a)
  9656. },
  9657. enumerable: !0,
  9658. configurable: !0
  9659. });
  9660. Object.defineProperty(a.prototype, "scaleX", {
  9661. get: function() {
  9662. return this._scaleX
  9663. },
  9664. set: function(a) {
  9665. this._autoResize || this._setScaleX(a)
  9666. },
  9667. enumerable: !0,
  9668. configurable: !0
  9669. });
  9670. Object.defineProperty(a.prototype, "scaleY", {
  9671. get: function() {
  9672. return this._scaleY
  9673. },
  9674. set: function(a) {
  9675. this._autoResize || this._setScaleY(a)
  9676. },
  9677. enumerable: !0,
  9678. configurable: !0
  9679. });
  9680. a.prototype.setActualSize = function(a, c) {
  9681. this._autoResize || b.prototype.setActualSize.call(this, a, c)
  9682. };
  9683. a.prototype.setLayoutBoundsPosition = function(a, c) {
  9684. this._autoResize || b.prototype.setLayoutBoundsPosition.call(this, a, c)
  9685. };
  9686. a.prototype.setLayoutBoundsSize = function(a, c) {
  9687. this._autoResize || b.prototype.setLayoutBoundsSize.call(this,
  9688. a, c)
  9689. };
  9690. Object.defineProperty(a.prototype, "layout", {
  9691. get: function() {
  9692. return this._layout
  9693. },
  9694. set: function(a) {
  9695. a instanceof d.BasicLayout && this._setLayout(a)
  9696. },
  9697. enumerable: !0,
  9698. configurable: !0
  9699. });
  9700. Object.defineProperty(a.prototype, "popUpContainer", {
  9701. get: function() {
  9702. this._popUpContainer || (this._popUpContainer = new d.UILayer(this, "noTopMostIndex", "topMostIndex"));
  9703. return this._popUpContainer
  9704. },
  9705. enumerable: !0,
  9706. configurable: !0
  9707. });
  9708. Object.defineProperty(a.prototype, "toolTipContainer", {
  9709. get: function() {
  9710. this._toolTipContainer || (this._toolTipContainer =
  9711. new d.UILayer(this, "topMostIndex", "toolTipIndex"));
  9712. return this._toolTipContainer
  9713. },
  9714. enumerable: !0,
  9715. configurable: !0
  9716. });
  9717. Object.defineProperty(a.prototype, "cursorContainer", {
  9718. get: function() {
  9719. this._cursorContainer || (this._cursorContainer = new d.UILayer(this, "toolTipIndex", "cursorIndex"));
  9720. return this._cursorContainer
  9721. },
  9722. enumerable: !0,
  9723. configurable: !0
  9724. });
  9725. Object.defineProperty(a.prototype, "noTopMostIndex", {
  9726. get: function() {
  9727. return this._noTopMostIndex
  9728. },
  9729. set: function(a) {
  9730. var b = a - this._noTopMostIndex;
  9731. this._noTopMostIndex =
  9732. a;
  9733. this.topMostIndex += b
  9734. },
  9735. enumerable: !0,
  9736. configurable: !0
  9737. });
  9738. Object.defineProperty(a.prototype, "topMostIndex", {
  9739. get: function() {
  9740. return this._topMostIndex
  9741. },
  9742. set: function(a) {
  9743. var b = a - this._topMostIndex;
  9744. this._topMostIndex = a;
  9745. this.toolTipIndex += b
  9746. },
  9747. enumerable: !0,
  9748. configurable: !0
  9749. });
  9750. Object.defineProperty(a.prototype, "toolTipIndex", {
  9751. get: function() {
  9752. return this._toolTipIndex
  9753. },
  9754. set: function(a) {
  9755. var b = a - this._toolTipIndex;
  9756. this._toolTipIndex = a;
  9757. this.cursorIndex += b
  9758. },
  9759. enumerable: !0,
  9760. configurable: !0
  9761. });
  9762. Object.defineProperty(a.prototype,
  9763. "cursorIndex", {
  9764. get: function() {
  9765. return this._cursorIndex
  9766. },
  9767. set: function(a) {
  9768. this._cursorIndex = a
  9769. },
  9770. enumerable: !0,
  9771. configurable: !0
  9772. });
  9773. a.prototype.addElement = function(a) {
  9774. var b = this._noTopMostIndex;
  9775. a.parent == this && b--;
  9776. return this.addElementAt(a, b)
  9777. };
  9778. a.prototype.addElementAt = function(a, c) {
  9779. if (a.parent == this) {
  9780. var d = this.getElementIndex(a);
  9781. d < this._noTopMostIndex ? this.noTopMostIndex-- : d >= this._noTopMostIndex && d < this._topMostIndex ? this.topMostIndex-- : d >= this._topMostIndex && d < this._toolTipIndex ? this.toolTipIndex-- :
  9782. this.cursorIndex--
  9783. }
  9784. c <= this._noTopMostIndex ? this.noTopMostIndex++ : c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++ : c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++ : this.cursorIndex++;
  9785. return b.prototype.addElementAt.call(this, a, c)
  9786. };
  9787. a.prototype.removeElement = function(a) {
  9788. return this.removeElementAt(b.prototype.getElementIndex.call(this, a))
  9789. };
  9790. a.prototype.removeElementAt = function(a) {
  9791. var c = b.prototype.removeElementAt.call(this, a);
  9792. a < this._noTopMostIndex ? this.noTopMostIndex-- :
  9793. a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex-- : a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--;
  9794. return c
  9795. };
  9796. a.prototype.removeAllElements = function() {
  9797. for (; 0 < this._noTopMostIndex;) b.prototype.removeElementAt.call(this, 0), this.noTopMostIndex--
  9798. };
  9799. a.prototype._elementRemoved = function(a, d, f) {
  9800. void 0 === f && (f = !0);
  9801. f && c.Event.dispatchEvent(a, "removeFromUIStage");
  9802. b.prototype._elementRemoved.call(this, a, d, f)
  9803. };
  9804. a.prototype.raw_getElementAt = function(a) {
  9805. return b.prototype.getElementAt.call(this,
  9806. a)
  9807. };
  9808. a.prototype.raw_addElement = function(a) {
  9809. var b = this.numElements;
  9810. a.parent == this && b--;
  9811. return this.raw_addElementAt(a, b)
  9812. };
  9813. a.prototype.raw_addElementAt = function(a, c) {
  9814. if (a.parent == this) {
  9815. var d = this.getElementIndex(a);
  9816. d < this._noTopMostIndex ? this.noTopMostIndex-- : d >= this._noTopMostIndex && d < this._topMostIndex ? this.topMostIndex-- : d >= this._topMostIndex && d < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  9817. }
  9818. return b.prototype.addElementAt.call(this, a, c)
  9819. };
  9820. a.prototype.raw_removeElement = function(a) {
  9821. return b.prototype.removeElementAt.call(this,
  9822. b.prototype.getElementIndex.call(this, a))
  9823. };
  9824. a.prototype.raw_removeElementAt = function(a) {
  9825. return b.prototype.removeElementAt.call(this, a)
  9826. };
  9827. a.prototype.raw_removeAllElements = function() {
  9828. for (; 0 < this.numElements;) b.prototype.removeElementAt.call(this, 0)
  9829. };
  9830. a.prototype.raw_getElementIndex = function(a) {
  9831. return b.prototype.getElementIndex.call(this, a)
  9832. };
  9833. a.prototype.raw_setElementIndex = function(a, c) {
  9834. b.prototype.setElementIndex.call(this, a, c)
  9835. };
  9836. a.prototype.raw_swapElements = function(a, c) {
  9837. b.prototype.swapElementsAt.call(this,
  9838. b.prototype.getElementIndex.call(this, a), b.prototype.getElementIndex.call(this, c))
  9839. };
  9840. a.prototype.raw_swapElementsAt = function(a, c) {
  9841. b.prototype.swapElementsAt.call(this, a, c)
  9842. };
  9843. return a
  9844. }(d.Group);
  9845. d.UIStage = f;
  9846. f.prototype.__class__ = "egret.gui.UIStage"
  9847. })(c.gui || (c.gui = {}))
  9848. })(egret || (egret = {}));
  9849. __extends = this.__extends || function(c, d) {
  9850. function f() {
  9851. this.constructor = c
  9852. }
  9853. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  9854. f.prototype = d.prototype;
  9855. c.prototype = new f
  9856. };
  9857. (function(c) {
  9858. (function(d) {
  9859. var f = function(a) {
  9860. function e() {
  9861. a.call(this);
  9862. this._popUpList = [];
  9863. this.popUpDataList = [];
  9864. this._modalColor = 0;
  9865. this._modalAlpha = 0.5;
  9866. this.invalidateModalFlag = !1
  9867. }
  9868. __extends(e, a);
  9869. Object.defineProperty(e.prototype, "popUpList", {
  9870. get: function() {
  9871. return this._popUpList.concat()
  9872. },
  9873. enumerable: !0,
  9874. configurable: !0
  9875. });
  9876. e.prototype.findPopUpData = function(a) {
  9877. for (var b = this.popUpDataList, c = b.length, d = 0; d < c; d++) {
  9878. var e = b[d];
  9879. if (e.popUp == a) return e
  9880. }
  9881. return null
  9882. };
  9883. e.prototype.addPopUp = function(a, c, f) {
  9884. void 0 ===
  9885. c && (c = !1);
  9886. void 0 === f && (f = !0);
  9887. var g = d.UIGlobals.uiStage,
  9888. h = this.findPopUpData(a);
  9889. h ? (h.modal = c, a.removeEventListener(e.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (h = new b(a, c), this.popUpDataList.push(h), this._popUpList.push(a));
  9890. g.popUpContainer.addElement(a);
  9891. f && this.centerPopUp(a);
  9892. "isPopUp" in a && (a.isPopUp = !0);
  9893. c && this.invalidateModal();
  9894. a.addEventListener(e.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  9895. };
  9896. e.prototype.onRemoved = function(a) {
  9897. for (var b = 0, c = this.popUpDataList, d = c.length, f = 0; f < d; f++) {
  9898. var m = c[f];
  9899. if (m.popUp ==
  9900. a.target) {
  9901. "isPopUp" in m.popUp && (m.popUp.isPopUp = !1);
  9902. m.popUp.removeEventListener(e.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  9903. this.popUpDataList.splice(b, 1);
  9904. this._popUpList.splice(b, 1);
  9905. this.invalidateModal();
  9906. break
  9907. }
  9908. b++
  9909. }
  9910. };
  9911. Object.defineProperty(e.prototype, "modalColor", {
  9912. get: function() {
  9913. return this._modalColor
  9914. },
  9915. set: function(a) {
  9916. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  9917. },
  9918. enumerable: !0,
  9919. configurable: !0
  9920. });
  9921. Object.defineProperty(e.prototype, "modalAlpha", {
  9922. get: function() {
  9923. return this._modalAlpha
  9924. },
  9925. set: function(a) {
  9926. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  9927. },
  9928. enumerable: !0,
  9929. configurable: !0
  9930. });
  9931. e.prototype.invalidateModal = function() {
  9932. this.invalidateModalFlag || (this.invalidateModalFlag = !0, d.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.validateModal, this), d.UIGlobals.stage.addEventListener(c.Event.RENDER, this.validateModal, this), d.UIGlobals.stage.invalidate())
  9933. };
  9934. e.prototype.validateModal = function(a) {
  9935. this.invalidateModalFlag = !1;
  9936. d.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  9937. this.validateModal, this);
  9938. d.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  9939. this.updateModal(d.UIGlobals.uiStage)
  9940. };
  9941. e.prototype.updateModal = function(a) {
  9942. for (var b = a.popUpContainer, c = !1, e = b.numElements - 1; 0 <= e; e--) {
  9943. var f = b.getElementAt(e);
  9944. if ((f = this.findPopUpData(f)) && f.modal) {
  9945. c = !0;
  9946. break
  9947. }
  9948. }
  9949. c ? (this.modalMask || (this.modalMask = new d.Rect, this.modalMask.touchEnabled = !0, this.modalMask.top = this.modalMask.left = this.modalMask.right = this.modalMask.bottom = 0), this.modalMask.fillColor = this._modalColor,
  9950. this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < e && e--, b.setElementIndex(this.modalMask, e)) : b.addElementAt(this.modalMask, e)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  9951. };
  9952. e.prototype.removePopUp = function(a) {
  9953. a && a.parent && this.findPopUpData(a) && ("removeElement" in a.parent ? a.parent.removeElement(a) : a.parent instanceof d.UIComponent ? a.parent._removeFromDisplayList(a) : a instanceof c.DisplayObject && a.parent.removeChild(a))
  9954. };
  9955. e.prototype.centerPopUp = function(a) {
  9956. a.top = a.bottom = a.left = a.right = NaN;
  9957. a.verticalCenter = a.horizontalCenter = 0;
  9958. var b = a.parent;
  9959. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  9960. };
  9961. e.prototype.bringToFront = function(a) {
  9962. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  9963. var b = a.parent;
  9964. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  9965. this.invalidateModal()
  9966. }
  9967. };
  9968. e.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  9969. return e
  9970. }(c.EventDispatcher);
  9971. d.PopUpManagerImpl = f;
  9972. f.prototype.__class__ = "egret.gui.PopUpManagerImpl";
  9973. var b = function() {
  9974. return function(a, b) {
  9975. this.popUp = a;
  9976. this.modal = b
  9977. }
  9978. }();
  9979. b.prototype.__class__ = "egret.gui.PopUpData"
  9980. })(c.gui || (c.gui = {}))
  9981. })(egret || (egret = {}));
  9982. (function(c) {
  9983. (function(d) {
  9984. var f = function() {
  9985. function b() {}
  9986. b.getImpl = function() {
  9987. if (!b._impl) try {
  9988. b._impl = c.Injector.getInstance("egret.gui.IPopUpManager")
  9989. } catch (a) {
  9990. b._impl = new d.PopUpManagerImpl
  9991. }
  9992. return b._impl
  9993. };
  9994. Object.defineProperty(b.prototype, "modalColor", {
  9995. get: function() {
  9996. return b.getImpl().modalColor
  9997. },
  9998. set: function(a) {
  9999. b.getImpl().modalColor = a
  10000. },
  10001. enumerable: !0,
  10002. configurable: !0
  10003. });
  10004. Object.defineProperty(b.prototype, "modalAlpha", {
  10005. get: function() {
  10006. return b.getImpl().modalAlpha
  10007. },
  10008. set: function(a) {
  10009. b.getImpl().modalAlpha =
  10010. a
  10011. },
  10012. enumerable: !0,
  10013. configurable: !0
  10014. });
  10015. b.addPopUp = function(a, c, f) {
  10016. void 0 === c && (c = !1);
  10017. void 0 === f && (f = !0);
  10018. b.getImpl().addPopUp(a, c, f);
  10019. d.PopUpEvent.dispatchPopUpEvent(b.getImpl(), d.PopUpEvent.ADD_POPUP, a, c)
  10020. };
  10021. b.removePopUp = function(a) {
  10022. b.getImpl().removePopUp(a);
  10023. d.PopUpEvent.dispatchPopUpEvent(b.getImpl(), d.PopUpEvent.REMOVE_POPUP, a)
  10024. };
  10025. b.centerPopUp = function(a) {
  10026. b.getImpl().centerPopUp(a)
  10027. };
  10028. b.bringToFront = function(a) {
  10029. b.getImpl().bringToFront(a);
  10030. d.PopUpEvent.dispatchPopUpEvent(b.getImpl(), d.PopUpEvent.BRING_TO_FRONT,
  10031. a)
  10032. };
  10033. Object.defineProperty(b, "popUpList", {
  10034. get: function() {
  10035. return b.getImpl().popUpList
  10036. },
  10037. enumerable: !0,
  10038. configurable: !0
  10039. });
  10040. b.addEventListener = function(a, c, d, f, n) {
  10041. void 0 === f && (f = !1);
  10042. void 0 === n && (n = 0);
  10043. b.getImpl().addEventListener(a, c, this, f, n)
  10044. };
  10045. b.removeEventListener = function(a, c, d, f) {
  10046. void 0 === f && (f = !1);
  10047. b.getImpl().removeEventListener(a, c, d, f)
  10048. };
  10049. return b
  10050. }();
  10051. d.PopUpManager = f;
  10052. f.prototype.__class__ = "egret.gui.PopUpManager"
  10053. })(c.gui || (c.gui = {}))
  10054. })(egret || (egret = {}));
  10055. var __extends = this.__extends || function(c, d) {
  10056. function f() {
  10057. this.constructor = c
  10058. }
  10059. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  10060. f.prototype = d.prototype;
  10061. c.prototype = new f
  10062. },
  10063. dragonBones;
  10064. (function(c) {
  10065. var d;
  10066. (function(a) {
  10067. var b = function() {
  10068. function a(b, c) {
  10069. void 0 === b && (b = 0);
  10070. void 0 === c && (c = 0);
  10071. this.x = b;
  10072. this.y = c
  10073. }
  10074. a.prototype.toString = function() {
  10075. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  10076. };
  10077. return a
  10078. }();
  10079. a.Point = b;
  10080. b.prototype.__class__ = "dragonBones.geom.Point";
  10081. b = function() {
  10082. return function(a, b, c, d) {
  10083. void 0 === a && (a = 0);
  10084. void 0 === b && (b = 0);
  10085. void 0 === c && (c = 0);
  10086. void 0 === d && (d = 0);
  10087. this.x = a;
  10088. this.y = b;
  10089. this.width = c;
  10090. this.height = d
  10091. }
  10092. }();
  10093. a.Rectangle = b;
  10094. b.prototype.__class__ = "dragonBones.geom.Rectangle";
  10095. b = function() {
  10096. function a() {
  10097. this.a =
  10098. 1;
  10099. this.c = this.b = 0;
  10100. this.d = 1;
  10101. this.ty = this.tx = 0
  10102. }
  10103. a.prototype.invert = function() {
  10104. var a = this.a,
  10105. b = this.b,
  10106. c = this.c,
  10107. d = this.d,
  10108. e = this.tx,
  10109. f = a * d - b * c;
  10110. this.a = d / f;
  10111. this.b = -b / f;
  10112. this.c = -c / f;
  10113. this.d = a / f;
  10114. this.tx = (c * this.ty - d * e) / f;
  10115. this.ty = -(a * this.ty - b * e) / f
  10116. };
  10117. return a
  10118. }();
  10119. a.Matrix = b;
  10120. b.prototype.__class__ = "dragonBones.geom.Matrix";
  10121. b = function() {
  10122. return function() {
  10123. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  10124. }
  10125. }();
  10126. a.ColorTransform =
  10127. b;
  10128. b.prototype.__class__ = "dragonBones.geom.ColorTransform"
  10129. })(d = c.geom || (c.geom = {}));
  10130. var f;
  10131. (function(a) {
  10132. var b = function() {
  10133. return function(a) {
  10134. this.type = a
  10135. }
  10136. }();
  10137. a.Event = b;
  10138. b.prototype.__class__ = "dragonBones.events.Event";
  10139. var c = function(a) {
  10140. function b(c) {
  10141. a.call(this, c)
  10142. }
  10143. __extends(b, a);
  10144. b.FADE_IN = "fadeIn";
  10145. b.FADE_OUT = "fadeOut";
  10146. b.START = "start";
  10147. b.COMPLETE = "complete";
  10148. b.LOOP_COMPLETE = "loopComplete";
  10149. b.FADE_IN_COMPLETE = "fadeInComplete";
  10150. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  10151. return b
  10152. }(b);
  10153. a.AnimationEvent = c;
  10154. c.prototype.__class__ =
  10155. "dragonBones.events.AnimationEvent";
  10156. c = function(a) {
  10157. function b(c) {
  10158. a.call(this, c)
  10159. }
  10160. __extends(b, a);
  10161. b.Z_ORDER_UPDATED = "zOrderUpdated";
  10162. return b
  10163. }(b);
  10164. a.ArmatureEvent = c;
  10165. c.prototype.__class__ = "dragonBones.events.ArmatureEvent";
  10166. c = function(a) {
  10167. function b(c) {
  10168. a.call(this, c)
  10169. }
  10170. __extends(b, a);
  10171. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  10172. b.BONE_FRAME_EVENT = "boneFrameEvent";
  10173. return b
  10174. }(b);
  10175. a.FrameEvent = c;
  10176. c.prototype.__class__ = "dragonBones.events.FrameEvent";
  10177. b = function(a) {
  10178. function b(c) {
  10179. a.call(this, c)
  10180. }
  10181. __extends(b, a);
  10182. b.SOUND =
  10183. "sound";
  10184. b.BONE_FRAME_EVENT = "boneFrameEvent";
  10185. return b
  10186. }(b);
  10187. a.SoundEvent = b;
  10188. b.prototype.__class__ = "dragonBones.events.SoundEvent";
  10189. b = function() {
  10190. function a() {}
  10191. a.prototype.hasEventListener = function(a) {
  10192. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  10193. };
  10194. a.prototype.addEventListener = function(a, b) {
  10195. if (a && b) {
  10196. this._listenersMap || (this._listenersMap = {});
  10197. var c = this._listenersMap[a];
  10198. c && this.removeEventListener(a, b);
  10199. c ? c.push(b) : this._listenersMap[a] = [b]
  10200. }
  10201. };
  10202. a.prototype.removeEventListener = function(a, b) {
  10203. if (this._listenersMap &&
  10204. a && b) {
  10205. var c = this._listenersMap[a];
  10206. if (c)
  10207. for (var d = c.length, e = 0; e < d; e++) c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  10208. }
  10209. };
  10210. a.prototype.removeAllEventListeners = function(a) {
  10211. a ? delete this._listenersMap[a] : this._listenersMap = null
  10212. };
  10213. a.prototype.dispatchEvent = function(a) {
  10214. if (a) {
  10215. var b = this._listenersMap[a.type];
  10216. if (b) {
  10217. a.target = this;
  10218. for (var c = b.concat(), b = b.length, d = 0; d < b; d++) c[d](a)
  10219. }
  10220. }
  10221. };
  10222. return a
  10223. }();
  10224. a.EventDispatcher = b;
  10225. b.prototype.__class__ = "dragonBones.events.EventDispatcher";
  10226. b = function(a) {
  10227. function b() {
  10228. a.call(this);
  10229. if (b._instance) throw Error("Singleton already constructed!");
  10230. }
  10231. __extends(b, a);
  10232. b.getInstance = function() {
  10233. b._instance || (b._instance = new b);
  10234. return b._instance
  10235. };
  10236. return b
  10237. }(b);
  10238. a.SoundEventManager = b;
  10239. b.prototype.__class__ = "dragonBones.events.SoundEventManager"
  10240. })(f = c.events || (c.events = {}));
  10241. var b;
  10242. (function(b) {
  10243. var c = function() {
  10244. function a() {
  10245. this.timeScale = 1;
  10246. this.time = 0.001 * (new Date).getTime();
  10247. this._animatableList = []
  10248. }
  10249. a.prototype.contains = function(a) {
  10250. return 0 <= this._animatableList.indexOf(a)
  10251. };
  10252. a.prototype.add = function(a) {
  10253. a &&
  10254. -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  10255. };
  10256. a.prototype.remove = function(a) {
  10257. a = this._animatableList.indexOf(a);
  10258. 0 <= a && (this._animatableList[a] = null)
  10259. };
  10260. a.prototype.clear = function() {
  10261. this._animatableList.length = 0
  10262. };
  10263. a.prototype.advanceTime = function(a) {
  10264. if (0 > a) {
  10265. var b = 0.001 * (new Date).getTime();
  10266. a = b - this.time;
  10267. this.time = b
  10268. }
  10269. a *= this.timeScale;
  10270. b = this._animatableList.length;
  10271. if (0 != b) {
  10272. for (var c = 0, d = 0; d < b; d++) {
  10273. var e = this._animatableList[d];
  10274. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] =
  10275. null), e.advanceTime(a), c++)
  10276. }
  10277. if (c != d) {
  10278. for (b = this._animatableList.length; d < b;) this._animatableList[c++] = this._animatableList[d++];
  10279. this._animatableList.length = c
  10280. }
  10281. }
  10282. };
  10283. a.clock = new a;
  10284. return a
  10285. }();
  10286. b.WorldClock = c;
  10287. c.prototype.__class__ = "dragonBones.animation.WorldClock";
  10288. var k = function() {
  10289. function b() {
  10290. this.transform = new a.DBTransform;
  10291. this.pivot = new d.Point;
  10292. this._durationTransform = new a.DBTransform;
  10293. this._durationPivot = new d.Point;
  10294. this._durationColor = new d.ColorTransform
  10295. }
  10296. b._borrowObject = function() {
  10297. return 0 == b._pool.length ?
  10298. new b : b._pool.pop()
  10299. };
  10300. b._returnObject = function(a) {
  10301. 0 > b._pool.indexOf(a) && (b._pool[b._pool.length] = a);
  10302. a.clear()
  10303. };
  10304. b._clear = function() {
  10305. for (var a = b._pool.length; a--;) b._pool[a].clear();
  10306. b._pool.length = 0
  10307. };
  10308. b.getEaseValue = function(a, c) {
  10309. if (1 < c) {
  10310. var d = 0.5 * (1 - Math.cos(a * Math.PI)) - a;
  10311. c -= 1
  10312. } else 0 < c ? d = Math.sin(a * b.HALF_PI) - a : 0 > c && (d = 1 - Math.cos(a * b.HALF_PI) - a, c *= -1);
  10313. return d * c + a
  10314. };
  10315. b.prototype.fadeIn = function(a, b, c) {
  10316. this._bone = a;
  10317. this._animationState = b;
  10318. this._timeline = c;
  10319. this._originTransform = this._timeline.originTransform;
  10320. this._originPivot = this._timeline.originPivot;
  10321. this._tweenColor = this._tweenTransform = !1;
  10322. this._totalTime = this._animationState.totalTime;
  10323. this.transform.x = 0;
  10324. this.transform.y = 0;
  10325. this.transform.scaleX = 0;
  10326. this.transform.scaleY = 0;
  10327. this.transform.skewX = 0;
  10328. this.transform.skewY = 0;
  10329. this.pivot.x = 0;
  10330. this.pivot.y = 0;
  10331. this._durationTransform.x = 0;
  10332. this._durationTransform.y = 0;
  10333. this._durationTransform.scaleX = 0;
  10334. this._durationTransform.scaleY = 0;
  10335. this._durationTransform.skewX = 0;
  10336. this._durationTransform.skewY = 0;
  10337. this._durationPivot.x =
  10338. 0;
  10339. this._durationPivot.y = 0;
  10340. this._currentFrame = null;
  10341. switch (this._timeline.getFrameList().length) {
  10342. case 0:
  10343. this._bone._arriveAtFrame(null, this, this._animationState, !1);
  10344. this._updateState = 0;
  10345. break;
  10346. case 1:
  10347. this._updateState = -1;
  10348. break;
  10349. default:
  10350. this._updateState = 1
  10351. }
  10352. };
  10353. b.prototype.fadeOut = function() {
  10354. this.transform.skewX = e.TransformUtil.formatRadian(this.transform.skewX);
  10355. this.transform.skewY = e.TransformUtil.formatRadian(this.transform.skewY)
  10356. };
  10357. b.prototype.update = function(a) {
  10358. if (this._updateState)
  10359. if (0 < this._updateState) {
  10360. a =
  10361. 0 == this._timeline.scale ? 1 : a / this._timeline.scale;
  10362. 1 == a && (a = 0.99999999);
  10363. a += this._timeline.offset;
  10364. var c = Math.floor(a);
  10365. a -= c;
  10366. for (var d = this._totalTime * a, f = !1, k; !this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;) f && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0), f = !0, this._currentFrame ? (k = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, k >= this._timeline.getFrameList().length && (k = 0), this._currentFrame = this._timeline.getFrameList()[k]) :
  10367. (k = 0, this._currentFrame = this._timeline.getFrameList()[0]), this._currentFrameDuration = this._currentFrame.duration, this._currentFramePosition = this._currentFrame.position;
  10368. f && (this.tweenActive = 0 <= this._currentFrame.displayIndex, k++, k >= this._timeline.getFrameList().length && (k = 0), f = this._timeline.getFrameList()[k], 0 == k && this._animationState.loop && this._animationState.loopCount >= Math.abs(this._animationState.loop) - 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + c - this._timeline.offset) *
  10369. this._timeline.scale ? (this._updateState = 0, this._tweenEasing = NaN) : 0 > this._currentFrame.displayIndex || 0 > f.displayIndex || !this._animationState.tweenEnabled ? this._tweenEasing = NaN : isNaN(this._animationState.clip.tweenEasing) ? this._tweenEasing = this._currentFrame.tweenEasing : this._tweenEasing = this._animationState.clip.tweenEasing, isNaN(this._tweenEasing) ? this._tweenColor = this._tweenTransform = !1 : (this._durationTransform.x = f.transform.x - this._currentFrame.transform.x, this._durationTransform.y = f.transform.y -
  10370. this._currentFrame.transform.y, this._durationTransform.skewX = f.transform.skewX - this._currentFrame.transform.skewX, this._durationTransform.skewY = f.transform.skewY - this._currentFrame.transform.skewY, this._durationTransform.scaleX = f.transform.scaleX - this._currentFrame.transform.scaleX, this._durationTransform.scaleY = f.transform.scaleY - this._currentFrame.transform.scaleY, 0 == k && (this._durationTransform.skewX = e.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = e.TransformUtil.formatRadian(this._durationTransform.skewY)),
  10371. this._durationPivot.x = f.pivot.x - this._currentFrame.pivot.x, this._durationPivot.y = f.pivot.y - this._currentFrame.pivot.y, this._tweenTransform = 0 != this._durationTransform.x || 0 != this._durationTransform.y || 0 != this._durationTransform.skewX || 0 != this._durationTransform.skewY || 0 != this._durationTransform.scaleX || 0 != this._durationTransform.scaleY || 0 != this._durationPivot.x || 0 != this._durationPivot.y ? !0 : !1, this._currentFrame.color && f.color ? (this._durationColor.alphaOffset = f.color.alphaOffset - this._currentFrame.color.alphaOffset,
  10372. this._durationColor.redOffset = f.color.redOffset - this._currentFrame.color.redOffset, this._durationColor.greenOffset = f.color.greenOffset - this._currentFrame.color.greenOffset, this._durationColor.blueOffset = f.color.blueOffset - this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = f.color.alphaMultiplier - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = f.color.redMultiplier - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = f.color.greenMultiplier -
  10373. this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier = f.color.blueMultiplier - this._currentFrame.color.blueMultiplier, this._tweenColor = 0 != this._durationColor.alphaOffset || 0 != this._durationColor.redOffset || 0 != this._durationColor.greenOffset || 0 != this._durationColor.blueOffset || 0 != this._durationColor.alphaMultiplier || 0 != this._durationColor.redMultiplier || 0 != this._durationColor.greenMultiplier || 0 != this._durationColor.blueMultiplier ? !0 : !1) : this._currentFrame.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = -this._currentFrame.color.alphaOffset, this._durationColor.redOffset = -this._currentFrame.color.redOffset, this._durationColor.greenOffset = -this._currentFrame.color.greenOffset, this._durationColor.blueOffset = -this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = 1 - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = 1 - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = 1 - this._currentFrame.color.greenMultiplier,
  10374. this._durationColor.blueMultiplier = 1 - this._currentFrame.color.blueMultiplier) : f.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = f.color.alphaOffset, this._durationColor.redOffset = f.color.redOffset, this._durationColor.greenOffset = f.color.greenOffset, this._durationColor.blueOffset = f.color.blueOffset, this._durationColor.alphaMultiplier = f.color.alphaMultiplier - 1, this._durationColor.redMultiplier = f.color.redMultiplier - 1, this._durationColor.greenMultiplier = f.color.greenMultiplier - 1, this._durationColor.blueMultiplier =
  10375. f.color.blueMultiplier - 1) : this._tweenColor = !1), this._tweenTransform || (this._animationState.blend ? (this.transform.x = this._originTransform.x + this._currentFrame.transform.x, this.transform.y = this._originTransform.y + this._currentFrame.transform.y, this.transform.skewX = this._originTransform.skewX + this._currentFrame.transform.skewX, this.transform.skewY = this._originTransform.skewY + this._currentFrame.transform.skewY, this.transform.scaleX = this._originTransform.scaleX + this._currentFrame.transform.scaleX, this.transform.scaleY =
  10376. this._originTransform.scaleY + this._currentFrame.transform.scaleY, this.pivot.x = this._originPivot.x + this._currentFrame.pivot.x, this.pivot.y = this._originPivot.y + this._currentFrame.pivot.y) : (this.transform.x = this._currentFrame.transform.x, this.transform.y = this._currentFrame.transform.y, this.transform.skewX = this._currentFrame.transform.skewX, this.transform.skewY = this._currentFrame.transform.skewY, this.transform.scaleX = this._currentFrame.transform.scaleX, this.transform.scaleY = this._currentFrame.transform.scaleY,
  10377. this.pivot.x = this._currentFrame.pivot.x, this.pivot.y = this._currentFrame.pivot.y)), this._tweenColor || (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._isColorChanged && this._bone._updateColor(0,
  10378. 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1));
  10379. if (this._tweenTransform || this._tweenColor) a = (d - this._currentFramePosition) / this._currentFrameDuration, this._tweenEasing && (a = b.getEaseValue(a, this._tweenEasing));
  10380. this._tweenTransform && (c = this._currentFrame.transform, d = this._currentFrame.pivot, this._animationState.blend ? (this.transform.x = this._originTransform.x + c.x + this._durationTransform.x * a, this.transform.y = this._originTransform.y + c.y + this._durationTransform.y *
  10381. a, this.transform.skewX = this._originTransform.skewX + c.skewX + this._durationTransform.skewX * a, this.transform.skewY = this._originTransform.skewY + c.skewY + this._durationTransform.skewY * a, this.transform.scaleX = this._originTransform.scaleX + c.scaleX + this._durationTransform.scaleX * a, this.transform.scaleY = this._originTransform.scaleY + c.scaleY + this._durationTransform.scaleY * a, this.pivot.x = this._originPivot.x + d.x + this._durationPivot.x * a, this.pivot.y = this._originPivot.y + d.y + this._durationPivot.y * a) : (this.transform.x =
  10382. c.x + this._durationTransform.x * a, this.transform.y = c.y + this._durationTransform.y * a, this.transform.skewX = c.skewX + this._durationTransform.skewX * a, this.transform.skewY = c.skewY + this._durationTransform.skewY * a, this.transform.scaleX = c.scaleX + this._durationTransform.scaleX * a, this.transform.scaleY = c.scaleY + this._durationTransform.scaleY * a, this.pivot.x = d.x + this._durationPivot.x * a, this.pivot.y = d.y + this._durationPivot.y * a));
  10383. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset +
  10384. this._durationColor.alphaOffset * a, this._currentFrame.color.redOffset + this._durationColor.redOffset * a, this._currentFrame.color.greenOffset + this._durationColor.greenOffset * a, this._currentFrame.color.blueOffset + this._durationColor.blueOffset * a, this._currentFrame.color.alphaMultiplier + this._durationColor.alphaMultiplier * a, this._currentFrame.color.redMultiplier + this._durationColor.redMultiplier * a, this._currentFrame.color.greenMultiplier + this._durationColor.greenMultiplier * a, this._currentFrame.color.blueMultiplier +
  10385. this._durationColor.blueMultiplier * a, !0) : this._bone._updateColor(this._durationColor.alphaOffset * a, this._durationColor.redOffset * a, this._durationColor.greenOffset * a, this._durationColor.blueOffset * a, 1 + this._durationColor.alphaMultiplier * a, 1 + this._durationColor.redMultiplier * a, 1 + this._durationColor.greenMultiplier * a, 1 + this._durationColor.blueMultiplier * a, !0))
  10386. } else this._updateState = 0, this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y =
  10387. this._originPivot.y) : (this.transform.x = this.transform.y = this.transform.skewX = this.transform.skewY = this.transform.scaleX = this.transform.scaleY = 0, this.pivot.x = 0, this.pivot.y = 0), this._currentFrame = this._timeline.getFrameList()[0], this.tweenActive = 0 <= this._currentFrame.displayIndex, this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier,
  10388. this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  10389. };
  10390. b.prototype.clear = function() {
  10391. this._updateState = 0;
  10392. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  10393. };
  10394. b.HALF_PI = 0.5 * Math.PI;
  10395. b._pool = [];
  10396. return b
  10397. }();
  10398. b.TimelineState = k;
  10399. k.prototype.__class__ = "dragonBones.animation.TimelineState";
  10400. var l = function() {
  10401. function a() {
  10402. this.layer = this.loop = 0;
  10403. this._timelineStates = {}
  10404. }
  10405. a._borrowObject = function() {
  10406. return 0 == a._pool.length ? new a : a._pool.pop()
  10407. };
  10408. a._returnObject = function(b) {
  10409. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  10410. b.clear()
  10411. };
  10412. a._clear = function() {
  10413. for (var b = a._pool.length; b--;) a._pool[b].clear();
  10414. a._pool.length = 0
  10415. };
  10416. a.prototype.fadeIn = function(a, b, c, d, e, f, k, l) {
  10417. this.layer = f;
  10418. this.clip = b;
  10419. this.name = this.clip.name;
  10420. this.totalTime = this.clip.duration;
  10421. this._armature = a;
  10422. 2 > Math.round(this.clip.duration *
  10423. this.clip.frameRate) || Infinity == d ? (this.timeScale = 1, this.currentTime = this.totalTime, this.loop = 0 <= this.loop ? 1 : -1) : (this.timeScale = d, this.currentTime = 0, this.loop = e);
  10424. this._pauseBeforeFadeInComplete = l;
  10425. this._fadeInTime = c * this.timeScale;
  10426. this._fadeState = 1;
  10427. this._fadeOutBeginTime = 0;
  10428. this._fadeOutWeight = -1;
  10429. this._fadeWeight = 0;
  10430. this._fadeIn = !0;
  10431. this._fadeOut = !1;
  10432. this.loopCount = -1;
  10433. this.displayControl = k;
  10434. this.isPlaying = !0;
  10435. this.isComplete = !1;
  10436. this.weight = 1;
  10437. this.tweenEnabled = this.enabled = this.blend = !0;
  10438. this.updateTimelineStates()
  10439. };
  10440. a.prototype.fadeOut = function(a, b) {
  10441. void 0 === b && (b = !1);
  10442. if (this._armature && !(0 <= this._fadeOutWeight)) {
  10443. this._fadeState = -1;
  10444. this._fadeOutWeight = this._fadeWeight;
  10445. this._fadeOutTime = a * this.timeScale;
  10446. this._fadeOutBeginTime = this.currentTime;
  10447. this._fadeOut = !0;
  10448. this.isPlaying = !b;
  10449. this.displayControl = !1;
  10450. for (var c in this._timelineStates) this._timelineStates[c].fadeOut();
  10451. this.enabled = !0
  10452. }
  10453. };
  10454. a.prototype.play = function() {
  10455. this.isPlaying = !0
  10456. };
  10457. a.prototype.stop = function() {
  10458. this.isPlaying = !1
  10459. };
  10460. a.prototype.getMixingTransform = function(a) {
  10461. return this._mixingTransforms ?
  10462. Number(this._mixingTransforms[a]) : -1
  10463. };
  10464. a.prototype.addMixingTransform = function(a, b, c) {
  10465. void 0 === b && (b = 2);
  10466. void 0 === c && (c = !0);
  10467. if (this.clip && this.clip.getTimeline(a)) {
  10468. this._mixingTransforms || (this._mixingTransforms = {});
  10469. if (c) {
  10470. c = this._armature._boneList.length;
  10471. for (var d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  10472. } else this._mixingTransforms[a] = b;
  10473. this.updateTimelineStates()
  10474. } else throw Error();
  10475. };
  10476. a.prototype.removeMixingTransform = function(a,
  10477. b) {
  10478. void 0 === a && (a = null);
  10479. void 0 === b && (b = !0);
  10480. if (a) {
  10481. if (b)
  10482. for (var c = this._armature._boneList.length, d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  10483. else delete this._mixingTransforms[a];
  10484. for (var f in this._mixingTransforms) {
  10485. var k = !0;
  10486. break
  10487. }
  10488. k || (this._mixingTransforms = null)
  10489. } else this._mixingTransforms = null;
  10490. this.updateTimelineStates()
  10491. };
  10492. a.prototype.advanceTime = function(a) {
  10493. if (!this.enabled) return !1;
  10494. var b, c;
  10495. this._fadeIn && (this._fadeIn = !1,
  10496. this._armature.hasEventListener(f.AnimationEvent.FADE_IN) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_IN), b.animationState = this, this._armature._eventList.push(b)));
  10497. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(f.AnimationEvent.FADE_OUT) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_OUT), b.animationState = this, this._armature._eventList.push(b)));
  10498. this.currentTime += a * this.timeScale;
  10499. if (this.isPlaying && !this.isComplete) {
  10500. var d;
  10501. if (this._pauseBeforeFadeInComplete) this.isPlaying = this._pauseBeforeFadeInComplete = !1, a = 0, d = Math.floor(a);
  10502. else if (a = this.currentTime / this.totalTime, d = Math.floor(a), d != this.loopCount && (-1 == this.loopCount && this._armature.hasEventListener(f.AnimationEvent.START) && (b = new f.AnimationEvent(f.AnimationEvent.START), b.animationState = this, this._armature._eventList.push(b)), this.loopCount = d)) this.loop && this.loopCount * this.loopCount >= this.loop * this.loop - 1 ? (c = !0, a = 1, d = 0, this._armature.hasEventListener(f.AnimationEvent.COMPLETE) && (b = new f.AnimationEvent(f.AnimationEvent.COMPLETE), b.animationState =
  10503. this, this._armature._eventList.push(b))) : this._armature.hasEventListener(f.AnimationEvent.LOOP_COMPLETE) && (b = new f.AnimationEvent(f.AnimationEvent.LOOP_COMPLETE), b.animationState = this, this._armature._eventList.push(b));
  10504. for (var e in this._timelineStates) this._timelineStates[e].update(a);
  10505. b = this.clip.getFrameList();
  10506. if (0 < b.length) {
  10507. a = this.totalTime * (a - d);
  10508. for (d = !1; !this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position;) d && this._armature._arriveAtFrame(this._currentFrame,
  10509. null, this, !0), d = !0, this._currentFrame ? (e = b.indexOf(this._currentFrame), e++, e >= b.length && (e = 0), this._currentFrame = b[e]) : this._currentFrame = b[0];
  10510. d && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  10511. }
  10512. }
  10513. if (0 < this._fadeState) 0 == this._fadeInTime ? (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying = !0, this._armature.hasEventListener(f.AnimationEvent.FADE_IN_COMPLETE) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : (this._fadeWeight =
  10514. this.currentTime / this._fadeInTime, 1 <= this._fadeWeight && (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying || (this.currentTime -= this._fadeInTime), this.isPlaying = !0, this._armature.hasEventListener(f.AnimationEvent.FADE_IN_COMPLETE) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))));
  10515. else if (0 > this._fadeState) {
  10516. if (0 == this._fadeOutTime) return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(f.AnimationEvent.FADE_OUT_COMPLETE) &&
  10517. (b = new f.AnimationEvent(f.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)), !0;
  10518. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  10519. if (0 >= this._fadeWeight) return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(f.AnimationEvent.FADE_OUT_COMPLETE) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)), !0
  10520. }
  10521. c && (this.isComplete = !0, 0 > this.loop &&
  10522. this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  10523. return !1
  10524. };
  10525. a.prototype.updateTimelineStates = function() {
  10526. if (this._mixingTransforms) {
  10527. for (var a in this._timelineStates) null == this._mixingTransforms[a] && this.removeTimelineState(a);
  10528. for (a in this._mixingTransforms) this._timelineStates[a] || this.addTimelineState(a)
  10529. } else
  10530. for (a in this.clip.getTimelines()) this._timelineStates[a] || this.addTimelineState(a)
  10531. };
  10532. a.prototype.addTimelineState = function(a) {
  10533. var b = this._armature.getBone(a);
  10534. if (b) {
  10535. var c =
  10536. k._borrowObject(),
  10537. d = this.clip.getTimeline(a);
  10538. c.fadeIn(b, this, d);
  10539. this._timelineStates[a] = c
  10540. }
  10541. };
  10542. a.prototype.removeTimelineState = function(a) {
  10543. k._returnObject(this._timelineStates[a]);
  10544. delete this._timelineStates[a]
  10545. };
  10546. a.prototype.clear = function() {
  10547. this.clip = null;
  10548. this.enabled = !1;
  10549. this._mixingTransforms = this._currentFrame = this._armature = null;
  10550. for (var a in this._timelineStates) this.removeTimelineState(a)
  10551. };
  10552. a._pool = [];
  10553. return a
  10554. }();
  10555. b.AnimationState = l;
  10556. l.prototype.__class__ = "dragonBones.animation.AnimationState";
  10557. c = function() {
  10558. function a(b) {
  10559. this._armature =
  10560. b;
  10561. this._animationLayer = [];
  10562. this._isPlaying = !1;
  10563. this.animationNameList = [];
  10564. this.tweenEnabled = !0;
  10565. this.timeScale = 1
  10566. }
  10567. a.prototype.getLastAnimationName = function() {
  10568. return this._lastAnimationState ? this._lastAnimationState.name : null
  10569. };
  10570. a.prototype.getLastAnimationState = function() {
  10571. return this._lastAnimationState
  10572. };
  10573. a.prototype.getAnimationDataList = function() {
  10574. return this._animationDataList
  10575. };
  10576. a.prototype.setAnimationDataList = function(a) {
  10577. this._animationDataList = a;
  10578. this.animationNameList.length = 0;
  10579. for (var b in this._animationDataList) this.animationNameList[this.animationNameList.length] =
  10580. this._animationDataList[b].name
  10581. };
  10582. a.prototype.getIsPlaying = function() {
  10583. return this._isPlaying && !this.getIsComplete()
  10584. };
  10585. a.prototype.getIsComplete = function() {
  10586. if (this._lastAnimationState) {
  10587. if (!this._lastAnimationState.isComplete) return !1;
  10588. for (var a = this._animationLayer.length; a--;)
  10589. for (var b = this._animationLayer[a], c = b.length; c--;)
  10590. if (!b[c].isComplete) return !1;
  10591. return !0
  10592. }
  10593. return !1
  10594. };
  10595. a.prototype.dispose = function() {
  10596. if (this._armature) {
  10597. this.stop();
  10598. for (var a = this._animationLayer.length; a--;) {
  10599. for (var b = this._animationLayer[a],
  10600. c = b.length; c--;) l._returnObject(b[c]);
  10601. b.length = 0
  10602. }
  10603. this._animationLayer.length = 0;
  10604. this.animationNameList.length = 0;
  10605. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  10606. }
  10607. };
  10608. a.prototype.gotoAndPlay = function(b, c, d, e, f, k, g, h, m, q) {
  10609. void 0 === c && (c = -1);
  10610. void 0 === d && (d = -1);
  10611. void 0 === e && (e = NaN);
  10612. void 0 === f && (f = 0);
  10613. void 0 === k && (k = null);
  10614. void 0 === g && (g = a.SAME_LAYER_AND_GROUP);
  10615. void 0 === h && (h = !0);
  10616. void 0 === m && (m = !0);
  10617. void 0 === q && (q = !0);
  10618. if (!this._animationDataList) return null;
  10619. for (var n = this._animationDataList.length,
  10620. w; n--;)
  10621. if (this._animationDataList[n].name == b) {
  10622. w = this._animationDataList[n];
  10623. break
  10624. }
  10625. if (!w) return null;
  10626. this._isPlaying = !0;
  10627. c = 0 > c ? 0 > w.fadeInTime ? 0.3 : w.fadeInTime : c;
  10628. d = 0 > d ? 0 > w.scale ? 1 : w.scale : d / w.duration;
  10629. e = isNaN(e) ? w.loop : e;
  10630. f = this.addLayer(f);
  10631. var u;
  10632. switch (g) {
  10633. case a.NONE:
  10634. break;
  10635. case a.SAME_LAYER:
  10636. u = this._animationLayer[f];
  10637. for (n = u.length; n--;) g = u[n], g.fadeOut(c, m);
  10638. break;
  10639. case a.SAME_GROUP:
  10640. for (F = this._animationLayer.length; F--;)
  10641. for (u = this._animationLayer[F], n = u.length; n--;) g = u[n], g.group == k && g.fadeOut(c, m);
  10642. break;
  10643. case a.ALL:
  10644. for (var F = this._animationLayer.length; F--;)
  10645. for (u = this._animationLayer[F], n = u.length; n--;) g = u[n], g.fadeOut(c, m);
  10646. break;
  10647. default:
  10648. for (u = this._animationLayer[f], n = u.length; n--;) g = u[n], g.group == k && g.fadeOut(c, m)
  10649. }
  10650. this._lastAnimationState = l._borrowObject();
  10651. this._lastAnimationState.group = k;
  10652. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  10653. this._lastAnimationState.fadeIn(this._armature, w, c, 1 / d, e, f, h, q);
  10654. this.addState(this._lastAnimationState);
  10655. e = this._armature._slotList;
  10656. for (n = e.length; n--;) f =
  10657. e[n], (f = f.getChildArmature()) && f.animation.gotoAndPlay(b, c);
  10658. return this._lastAnimationState
  10659. };
  10660. a.prototype.play = function() {
  10661. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  10662. };
  10663. a.prototype.stop = function() {
  10664. this._isPlaying = !1
  10665. };
  10666. a.prototype.getState = function(a, b) {
  10667. void 0 === b && (b = 0);
  10668. var c = this._animationLayer.length;
  10669. if (0 == c) return null;
  10670. b >= c &&
  10671. (b = c - 1);
  10672. c = this._animationLayer[b];
  10673. if (!c) return null;
  10674. for (var d = c.length; d--;)
  10675. if (c[d].name == a) return c[d];
  10676. return null
  10677. };
  10678. a.prototype.hasAnimation = function(a) {
  10679. for (var b = this._animationDataList.length; b--;)
  10680. if (this._animationDataList[b].name == a) return !0;
  10681. return !1
  10682. };
  10683. a.prototype.advanceTime = function(a) {
  10684. if (this._isPlaying) {
  10685. a *= this.timeScale;
  10686. var b = this._armature._boneList.length,
  10687. c, d, e = b,
  10688. f, k, l, g, h, p, m, q, r, n, G, I, K, M, B, E, D;
  10689. for (b--; e--;) {
  10690. k = this._armature._boneList[e];
  10691. l = k.name;
  10692. g = 1;
  10693. I = G = n = r = q = m = p = h = 0;
  10694. for (c = this._animationLayer.length; c--;) {
  10695. K =
  10696. 0;
  10697. M = this._animationLayer[c];
  10698. f = M.length;
  10699. for (d = 0; d < f; d++) B = M[d], e == b && B.advanceTime(a) ? (this.removeState(B), d--, f--) : (E = B._timelineStates[l]) && E.tweenActive && (B = B._fadeWeight * B.weight * g, D = E.transform, E = E.pivot, h += D.x * B, p += D.y * B, m += D.skewX * B, q += D.skewY * B, r += D.scaleX * B, n += D.scaleY * B, G += E.x * B, I += E.y * B, K += B);
  10700. if (K >= g) break;
  10701. else g -= K
  10702. }
  10703. D = k.tween;
  10704. E = k._tweenPivot;
  10705. D.x = h;
  10706. D.y = p;
  10707. D.skewX = m;
  10708. D.skewY = q;
  10709. D.scaleX = r;
  10710. D.scaleY = n;
  10711. E.x = G;
  10712. E.y = I
  10713. }
  10714. }
  10715. };
  10716. a.prototype.addLayer = function(a) {
  10717. a >= this._animationLayer.length && (a = this._animationLayer.length,
  10718. this._animationLayer[a] = []);
  10719. return a
  10720. };
  10721. a.prototype.addState = function(a) {
  10722. this._animationLayer[a.layer].push(a)
  10723. };
  10724. a.prototype.removeState = function(a) {
  10725. var b = a.layer,
  10726. c = this._animationLayer[b];
  10727. c.splice(c.indexOf(a), 1);
  10728. l._returnObject(a);
  10729. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  10730. };
  10731. a.NONE = "none";
  10732. a.SAME_LAYER = "sameLayer";
  10733. a.SAME_GROUP = "sameGroup";
  10734. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  10735. a.ALL = "all";
  10736. return a
  10737. }();
  10738. b.Animation = c;
  10739. c.prototype.__class__ = "dragonBones.animation.Animation"
  10740. })(b =
  10741. c.animation || (c.animation = {}));
  10742. var a;
  10743. (function(a) {
  10744. var b = function() {
  10745. function a() {
  10746. this.skewY = this.skewX = this.y = this.x = 0;
  10747. this.scaleY = this.scaleX = 1
  10748. }
  10749. a.prototype.getRotation = function() {
  10750. return this.skewX
  10751. };
  10752. a.prototype.setRotation = function(a) {
  10753. this.skewX = this.skewY = a
  10754. };
  10755. a.prototype.copy = function(a) {
  10756. this.x = a.x;
  10757. this.y = a.y;
  10758. this.skewX = a.skewX;
  10759. this.skewY = a.skewY;
  10760. this.scaleX = a.scaleX;
  10761. this.scaleY = a.scaleY
  10762. };
  10763. a.prototype.toString = function() {
  10764. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY +
  10765. " scaleX=" + this.scaleX + " scaleY=" + this.scaleY + ")]"
  10766. };
  10767. return a
  10768. }();
  10769. a.DBTransform = b;
  10770. b.prototype.__class__ = "dragonBones.objects.DBTransform";
  10771. var c = function() {
  10772. function a() {
  10773. this.duration = this.position = 0
  10774. }
  10775. a.prototype.dispose = function() {};
  10776. return a
  10777. }();
  10778. a.Frame = c;
  10779. c.prototype.__class__ = "dragonBones.objects.Frame";
  10780. var f = function(a) {
  10781. function c() {
  10782. a.call(this);
  10783. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  10784. this.zOrder = NaN;
  10785. this.visible = !0;
  10786. this.global = new b;
  10787. this.transform = new b;
  10788. this.pivot = new d.Point
  10789. }
  10790. __extends(c,
  10791. a);
  10792. c.prototype.dispose = function() {
  10793. a.prototype.dispose.call(this);
  10794. this.color = this.pivot = this.transform = this.global = null
  10795. };
  10796. return c
  10797. }(c);
  10798. a.TransformFrame = f;
  10799. f.prototype.__class__ = "dragonBones.objects.TransformFrame";
  10800. var l = function() {
  10801. function a() {
  10802. this._frameList = [];
  10803. this.duration = 0;
  10804. this.scale = 1
  10805. }
  10806. a.prototype.getFrameList = function() {
  10807. return this._frameList
  10808. };
  10809. a.prototype.dispose = function() {
  10810. for (var a = this._frameList.length; a--;) this._frameList[a].dispose();
  10811. this._frameList.length = 0;
  10812. this._frameList = null
  10813. };
  10814. a.prototype.addFrame =
  10815. function(a) {
  10816. if (!a) throw Error();
  10817. if (0 > this._frameList.indexOf(a)) this._frameList[this._frameList.length] = a;
  10818. else throw Error();
  10819. };
  10820. return a
  10821. }();
  10822. a.Timeline = l;
  10823. l.prototype.__class__ = "dragonBones.objects.Timeline";
  10824. var g = function(a) {
  10825. function c() {
  10826. a.call(this);
  10827. this.originTransform = new b;
  10828. this.originPivot = new d.Point;
  10829. this.offset = 0;
  10830. this.transformed = !1
  10831. }
  10832. __extends(c, a);
  10833. c.prototype.dispose = function() {
  10834. this != c.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  10835. };
  10836. c.HIDE_TIMELINE =
  10837. new c;
  10838. return c
  10839. }(l);
  10840. a.TransformTimeline = g;
  10841. g.prototype.__class__ = "dragonBones.objects.TransformTimeline";
  10842. var q = function(a) {
  10843. function b() {
  10844. a.call(this);
  10845. this.loop = this.frameRate = 0;
  10846. this.tweenEasing = NaN;
  10847. this.fadeInTime = 0;
  10848. this._timelines = {}
  10849. }
  10850. __extends(b, a);
  10851. b.prototype.getTimelines = function() {
  10852. return this._timelines
  10853. };
  10854. b.prototype.dispose = function() {
  10855. a.prototype.dispose.call(this);
  10856. for (var b in this._timelines) this._timelines[b].dispose();
  10857. this._timelines = null
  10858. };
  10859. b.prototype.getTimeline = function(a) {
  10860. return this._timelines[a]
  10861. };
  10862. b.prototype.addTimeline = function(a, b) {
  10863. if (!a) throw Error();
  10864. this._timelines[b] = a
  10865. };
  10866. return b
  10867. }(l);
  10868. a.AnimationData = q;
  10869. q.prototype.__class__ = "dragonBones.objects.AnimationData";
  10870. var n = function() {
  10871. function a() {
  10872. this.transform = new b
  10873. }
  10874. a.prototype.dispose = function() {
  10875. this.pivot = this.transform = null
  10876. };
  10877. a.ARMATURE = "armature";
  10878. a.IMAGE = "image";
  10879. return a
  10880. }();
  10881. a.DisplayData = n;
  10882. n.prototype.__class__ = "dragonBones.objects.DisplayData";
  10883. var x = function() {
  10884. function a() {
  10885. this._displayDataList = [];
  10886. this.zOrder = 0;
  10887. this.blendMode = "normal"
  10888. }
  10889. a.prototype.getDisplayDataList =
  10890. function() {
  10891. return this._displayDataList
  10892. };
  10893. a.prototype.dispose = function() {
  10894. for (var a = this._displayDataList.length; a--;) this._displayDataList[a].dispose();
  10895. this._displayDataList.length = 0;
  10896. this._displayDataList = null
  10897. };
  10898. a.prototype.addDisplayData = function(a) {
  10899. if (!a) throw Error();
  10900. if (0 > this._displayDataList.indexOf(a)) this._displayDataList[this._displayDataList.length] = a;
  10901. else throw Error();
  10902. };
  10903. a.prototype.getDisplayData = function(a) {
  10904. for (var b = this._displayDataList.length; b--;)
  10905. if (this._displayDataList[b].name == a) return this._displayDataList[b];
  10906. return null
  10907. };
  10908. return a
  10909. }();
  10910. a.SlotData = x;
  10911. x.prototype.__class__ = "dragonBones.objects.SlotData";
  10912. var A = function() {
  10913. function a() {
  10914. this.length = 0;
  10915. this.global = new b;
  10916. this.transform = new b;
  10917. this.scaleMode = 1;
  10918. this.fixedRotation = !1
  10919. }
  10920. a.prototype.dispose = function() {
  10921. this.transform = this.global = null
  10922. };
  10923. return a
  10924. }();
  10925. a.BoneData = A;
  10926. A.prototype.__class__ = "dragonBones.objects.BoneData";
  10927. var z = function() {
  10928. function a() {
  10929. this._slotDataList = []
  10930. }
  10931. a.prototype.getSlotDataList = function() {
  10932. return this._slotDataList
  10933. };
  10934. a.prototype.dispose = function() {
  10935. for (var a =
  10936. this._slotDataList.length; a--;) this._slotDataList[a].dispose();
  10937. this._slotDataList.length = 0;
  10938. this._slotDataList = null
  10939. };
  10940. a.prototype.getSlotData = function(a) {
  10941. for (var b = this._slotDataList.length; b--;)
  10942. if (this._slotDataList[b].name == a) return this._slotDataList[b];
  10943. return null
  10944. };
  10945. a.prototype.addSlotData = function(a) {
  10946. if (!a) throw Error();
  10947. if (0 > this._slotDataList.indexOf(a)) this._slotDataList[this._slotDataList.length] = a;
  10948. else throw Error();
  10949. };
  10950. return a
  10951. }();
  10952. a.SkinData = z;
  10953. z.prototype.__class__ = "dragonBones.objects.SkinData";
  10954. var y = function() {
  10955. function a() {
  10956. this._boneDataList = [];
  10957. this._skinDataList = [];
  10958. this._animationDataList = []
  10959. }
  10960. a.prototype.getBoneDataList = function() {
  10961. return this._boneDataList
  10962. };
  10963. a.prototype.getSkinDataList = function() {
  10964. return this._skinDataList
  10965. };
  10966. a.prototype.getAnimationDataList = function() {
  10967. return this._animationDataList
  10968. };
  10969. a.prototype.dispose = function() {
  10970. for (var a = this._boneDataList.length; a--;) this._boneDataList[a].dispose();
  10971. for (a = this._skinDataList.length; a--;) this._skinDataList[a].dispose();
  10972. for (a = this._animationDataList.length; a--;) this._animationDataList[a].dispose();
  10973. this._boneDataList.length = 0;
  10974. this._skinDataList.length = 0;
  10975. this._animationDataList.length = 0;
  10976. this._animationDataList = this._skinDataList = this._boneDataList = null
  10977. };
  10978. a.prototype.getBoneData = function(a) {
  10979. for (var b = this._boneDataList.length; b--;)
  10980. if (this._boneDataList[b].name == a) return this._boneDataList[b];
  10981. return null
  10982. };
  10983. a.prototype.getSkinData = function(a) {
  10984. if (!a) return this._skinDataList[0];
  10985. for (var b = this._skinDataList.length; b--;)
  10986. if (this._skinDataList[b].name == a) return this._skinDataList[b];
  10987. return null
  10988. };
  10989. a.prototype.getAnimationData =
  10990. function(a) {
  10991. for (var b = this._animationDataList.length; b--;)
  10992. if (this._animationDataList[b].name == a) return this._animationDataList[b];
  10993. return null
  10994. };
  10995. a.prototype.addBoneData = function(a) {
  10996. if (!a) throw Error();
  10997. if (0 > this._boneDataList.indexOf(a)) this._boneDataList[this._boneDataList.length] = a;
  10998. else throw Error();
  10999. };
  11000. a.prototype.addSkinData = function(a) {
  11001. if (!a) throw Error();
  11002. if (0 > this._skinDataList.indexOf(a)) this._skinDataList[this._skinDataList.length] = a;
  11003. else throw Error();
  11004. };
  11005. a.prototype.addAnimationData = function(a) {
  11006. if (!a) throw Error();
  11007. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  11008. };
  11009. a.prototype.sortBoneDataList = function() {
  11010. var a = this._boneDataList.length;
  11011. if (0 != a) {
  11012. for (var b = []; a--;) {
  11013. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;) d++, e = this.getBoneData(e.parent);
  11014. b[a] = {
  11015. level: d,
  11016. boneData: c
  11017. }
  11018. }
  11019. b.sort(this.sortBoneData);
  11020. for (a = b.length; a--;) this._boneDataList[a] = b[a].boneData
  11021. }
  11022. };
  11023. a.prototype.sortBoneData = function(a, b) {
  11024. return a.level > b.level ? 1 : -1
  11025. };
  11026. return a
  11027. }();
  11028. a.ArmatureData = y;
  11029. y.prototype.__class__ =
  11030. "dragonBones.objects.ArmatureData";
  11031. var H = function() {
  11032. function a() {
  11033. this._armatureDataList = [];
  11034. this._subTexturePivots = {}
  11035. }
  11036. a.prototype.getArmatureNames = function() {
  11037. var a = [],
  11038. b;
  11039. for (b in this._armatureDataList) a[a.length] = this._armatureDataList[b].name;
  11040. return a
  11041. };
  11042. a.prototype.getArmatureDataList = function() {
  11043. return this._armatureDataList
  11044. };
  11045. a.prototype.dispose = function() {
  11046. for (var a in this._armatureDataList) this._armatureDataList[a].dispose();
  11047. this._armatureDataList.length = 0;
  11048. this._subTexturePivots = this._armatureDataList =
  11049. null
  11050. };
  11051. a.prototype.getArmatureData = function(a) {
  11052. for (var b = this._armatureDataList.length; b--;)
  11053. if (this._armatureDataList[b].name == a) return this._armatureDataList[b];
  11054. return null
  11055. };
  11056. a.prototype.addArmatureData = function(a) {
  11057. if (!a) throw Error();
  11058. if (0 > this._armatureDataList.indexOf(a)) this._armatureDataList[this._armatureDataList.length] = a;
  11059. else throw Error();
  11060. };
  11061. a.prototype.removeArmatureData = function(a) {
  11062. a = this._armatureDataList.indexOf(a);
  11063. 0 <= a && this._armatureDataList.splice(a, 1)
  11064. };
  11065. a.prototype.removeArmatureDataByName =
  11066. function(a) {
  11067. for (var b = this._armatureDataList.length; b--;) this._armatureDataList[b].name == a && this._armatureDataList.splice(b, 1)
  11068. };
  11069. a.prototype.getSubTexturePivot = function(a) {
  11070. return this._subTexturePivots[a]
  11071. };
  11072. a.prototype.addSubTexturePivot = function(a, b, c) {
  11073. var e = this._subTexturePivots[c];
  11074. e ? (e.x = a, e.y = b) : this._subTexturePivots[c] = e = new d.Point(a, b);
  11075. return e
  11076. };
  11077. a.prototype.removeSubTexturePivot = function(a) {
  11078. if (a) delete this._subTexturePivots[a];
  11079. else
  11080. for (a in this._subTexturePivots) delete this._subTexturePivots[a]
  11081. };
  11082. return a
  11083. }();
  11084. a.SkeletonData = H;
  11085. H.prototype.__class__ = "dragonBones.objects.SkeletonData";
  11086. l = function() {
  11087. function a() {}
  11088. a.parseTextureAtlasData = function(a, b) {
  11089. void 0 === b && (b = 1);
  11090. if (!a) throw Error();
  11091. var c = {};
  11092. c.__name = a[e.ConstValues.A_NAME];
  11093. var f = a[e.ConstValues.SUB_TEXTURE],
  11094. k;
  11095. for (k in f) {
  11096. var l = f[k],
  11097. g = l[e.ConstValues.A_NAME],
  11098. l = new d.Rectangle(Number(l[e.ConstValues.A_X]) / b, Number(l[e.ConstValues.A_Y]) / b, Number(l[e.ConstValues.A_WIDTH]) / b, Number(l[e.ConstValues.A_HEIGHT]) / b);
  11099. c[g] = l
  11100. }
  11101. return c
  11102. };
  11103. a.parseSkeletonData =
  11104. function(b) {
  11105. if (!b) throw Error();
  11106. var c = Number(b[e.ConstValues.A_FRAME_RATE]),
  11107. d = new H;
  11108. d.name = b[e.ConstValues.A_NAME];
  11109. b = b[e.ConstValues.ARMATURE];
  11110. for (var f in b) d.addArmatureData(a.parseArmatureData(b[f], d, c));
  11111. return d
  11112. };
  11113. a.parseArmatureData = function(b, c, d) {
  11114. var f = new y;
  11115. f.name = b[e.ConstValues.A_NAME];
  11116. var k = b[e.ConstValues.BONE],
  11117. l;
  11118. for (l in k) f.addBoneData(a.parseBoneData(k[l]));
  11119. k = b[e.ConstValues.SKIN];
  11120. for (l in k) f.addSkinData(a.parseSkinData(k[l], c));
  11121. e.DBDataUtil.transformArmatureData(f);
  11122. f.sortBoneDataList();
  11123. b = b[e.ConstValues.ANIMATION];
  11124. for (l in b) f.addAnimationData(a.parseAnimationData(b[l], f, d));
  11125. return f
  11126. };
  11127. a.parseBoneData = function(b) {
  11128. var c = new A;
  11129. c.name = b[e.ConstValues.A_NAME];
  11130. c.parent = b[e.ConstValues.A_PARENT];
  11131. c.length = Number(b[e.ConstValues.A_LENGTH]) || 0;
  11132. var d = Number(b[e.ConstValues.A_SCALE_MODE]);
  11133. !isNaN(d) && d && (c.scaleMode = d);
  11134. if (d = b[e.ConstValues.A_FIXED_ROTATION]) c.fixedRotation = d;
  11135. a.parseTransform(b[e.ConstValues.TRANSFORM], c.global);
  11136. c.transform.copy(c.global);
  11137. return c
  11138. };
  11139. a.parseSkinData = function(b,
  11140. c) {
  11141. var d = new z;
  11142. d.name = b[e.ConstValues.A_NAME];
  11143. var f = b[e.ConstValues.SLOT],
  11144. k;
  11145. for (k in f) d.addSlotData(a.parseSlotData(f[k], c));
  11146. return d
  11147. };
  11148. a.parseSlotData = function(b, c) {
  11149. var d = new x;
  11150. d.name = b[e.ConstValues.A_NAME];
  11151. d.parent = b[e.ConstValues.A_PARENT];
  11152. d.zOrder = Number(b[e.ConstValues.A_Z_ORDER]);
  11153. d.blendMode = b[e.ConstValues.A_BLENDMODE];
  11154. d.blendMode || (d.blendMode = "normal");
  11155. var f = b[e.ConstValues.DISPLAY],
  11156. k;
  11157. for (k in f) d.addDisplayData(a.parseDisplayData(f[k], c));
  11158. return d
  11159. };
  11160. a.parseDisplayData = function(b, c) {
  11161. var d =
  11162. new n;
  11163. d.name = b[e.ConstValues.A_NAME];
  11164. d.type = b[e.ConstValues.A_TYPE];
  11165. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  11166. a.parseTransform(b[e.ConstValues.TRANSFORM], d.transform, d.pivot);
  11167. return d
  11168. };
  11169. a.parseAnimationData = function(b, c, d) {
  11170. var f = new q;
  11171. f.name = b[e.ConstValues.A_NAME];
  11172. f.frameRate = d;
  11173. f.loop = Number(b[e.ConstValues.A_LOOP]) || 0;
  11174. f.fadeInTime = Number(b[e.ConstValues.A_FADE_IN_TIME]);
  11175. f.duration = Number(b[e.ConstValues.A_DURATION]) / d;
  11176. f.scale = Number(b[e.ConstValues.A_SCALE]);
  11177. if (b.hasOwnProperty(e.ConstValues.A_TWEEN_EASING)) {
  11178. var k =
  11179. b[e.ConstValues.A_TWEEN_EASING];
  11180. f.tweenEasing = void 0 == k || null == k ? NaN : Number(k)
  11181. } else f.tweenEasing = NaN;
  11182. a.parseTimeline(b, f, a.parseMainFrame, d);
  11183. var l, k = b[e.ConstValues.TIMELINE],
  11184. g;
  11185. for (g in k) l = k[g], b = a.parseTransformTimeline(l, f.duration, d), l = l[e.ConstValues.A_NAME], f.addTimeline(b, l);
  11186. e.DBDataUtil.addHideTimeline(f, c);
  11187. e.DBDataUtil.transformAnimationData(f, c);
  11188. return f
  11189. };
  11190. a.parseTimeline = function(a, b, c, d) {
  11191. var f = 0,
  11192. k;
  11193. a = a[e.ConstValues.FRAME];
  11194. for (var l in a) k = c(a[l], d), k.position = f, b.addFrame(k), f += k.duration;
  11195. k && (k.duration = b.duration - k.position)
  11196. };
  11197. a.parseTransformTimeline = function(b, c, d) {
  11198. var f = new g;
  11199. f.duration = c;
  11200. a.parseTimeline(b, f, a.parseTransformFrame, d);
  11201. f.scale = Number(b[e.ConstValues.A_SCALE]);
  11202. f.offset = Number(b[e.ConstValues.A_OFFSET]);
  11203. return f
  11204. };
  11205. a.parseFrame = function(a, b, c) {
  11206. b.duration = Number(a[e.ConstValues.A_DURATION]) / c;
  11207. b.action = a[e.ConstValues.A_ACTION];
  11208. b.event = a[e.ConstValues.A_EVENT];
  11209. b.sound = a[e.ConstValues.A_SOUND]
  11210. };
  11211. a.parseMainFrame = function(b, d) {
  11212. var e = new c;
  11213. a.parseFrame(b, e, d);
  11214. return e
  11215. };
  11216. a.parseTransformFrame =
  11217. function(b, c) {
  11218. var k = new f;
  11219. a.parseFrame(b, k, c);
  11220. k.visible = 1 != Number(b[e.ConstValues.A_HIDE]);
  11221. if (b.hasOwnProperty(e.ConstValues.A_TWEEN_EASING)) {
  11222. var l = b[e.ConstValues.A_TWEEN_EASING];
  11223. k.tweenEasing = void 0 == l || null == l ? NaN : Number(l)
  11224. } else k.tweenEasing = 0;
  11225. k.tweenRotate = Number(b[e.ConstValues.A_TWEEN_ROTATE]) || 0;
  11226. k.displayIndex = Number(b[e.ConstValues.A_DISPLAY_INDEX]) || 0;
  11227. k.zOrder = Number(b[e.ConstValues.A_Z_ORDER]) || 0;
  11228. a.parseTransform(b[e.ConstValues.TRANSFORM], k.global, k.pivot);
  11229. k.transform.copy(k.global);
  11230. if (l =
  11231. b[e.ConstValues.COLOR_TRANSFORM]) k.color = new d.ColorTransform, k.color.alphaOffset = Number(l[e.ConstValues.A_ALPHA_OFFSET]), k.color.redOffset = Number(l[e.ConstValues.A_RED_OFFSET]), k.color.greenOffset = Number(l[e.ConstValues.A_GREEN_OFFSET]), k.color.blueOffset = Number(l[e.ConstValues.A_BLUE_OFFSET]), k.color.alphaMultiplier = 0.01 * Number(l[e.ConstValues.A_ALPHA_MULTIPLIER]), k.color.redMultiplier = 0.01 * Number(l[e.ConstValues.A_RED_MULTIPLIER]), k.color.greenMultiplier = 0.01 * Number(l[e.ConstValues.A_GREEN_MULTIPLIER]),
  11232. k.color.blueMultiplier = 0.01 * Number(l[e.ConstValues.A_BLUE_MULTIPLIER]);
  11233. return k
  11234. };
  11235. a.parseTransform = function(a, b, c) {
  11236. void 0 === c && (c = null);
  11237. a && (b && (b.x = Number(a[e.ConstValues.A_X]), b.y = Number(a[e.ConstValues.A_Y]), b.skewX = Number(a[e.ConstValues.A_SKEW_X]) * e.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[e.ConstValues.A_SKEW_Y]) * e.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[e.ConstValues.A_SCALE_X]), b.scaleY = Number(a[e.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[e.ConstValues.A_PIVOT_X]), c.y = Number(a[e.ConstValues.A_PIVOT_Y])))
  11238. };
  11239. return a
  11240. }();
  11241. a.DataParser = l;
  11242. l.prototype.__class__ = "dragonBones.objects.DataParser"
  11243. })(a = c.objects || (c.objects = {}));
  11244. (function(b) {
  11245. var c = function(b) {
  11246. function c() {
  11247. b.call(this);
  11248. this._dataDic = {};
  11249. this._textureAtlasDic = {};
  11250. this._textureAtlasLoadingDic = {}
  11251. }
  11252. __extends(c, b);
  11253. c.prototype.getSkeletonData = function(a) {
  11254. return this._dataDic[a]
  11255. };
  11256. c.prototype.addSkeletonData = function(a, b) {
  11257. void 0 === b && (b = null);
  11258. if (!a) throw Error();
  11259. b = b || a.name;
  11260. if (!b) throw Error("Unnamed data!");
  11261. this._dataDic[b] = a
  11262. };
  11263. c.prototype.removeSkeletonData =
  11264. function(a) {
  11265. delete this._dataDic[a]
  11266. };
  11267. c.prototype.getTextureAtlas = function(a) {
  11268. return this._textureAtlasDic[a]
  11269. };
  11270. c.prototype.addTextureAtlas = function(a, b) {
  11271. void 0 === b && (b = null);
  11272. if (!a) throw Error();
  11273. b = b || a.name;
  11274. if (!b) throw Error("Unnamed data!");
  11275. this._textureAtlasDic[b] = a
  11276. };
  11277. c.prototype.removeTextureAtlas = function(a) {
  11278. delete this._textureAtlasDic[a]
  11279. };
  11280. c.prototype.dispose = function(a) {
  11281. void 0 === a && (a = !0);
  11282. if (a) {
  11283. for (var b in this._dataDic) this._dataDic[b].dispose();
  11284. for (b in this._textureAtlasDic) this._textureAtlasDic[b].dispose()
  11285. }
  11286. this._currentTextureAtlasName =
  11287. this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  11288. };
  11289. c.prototype.buildArmature = function(b, c, d, e, f) {
  11290. if (d) {
  11291. var k = this._dataDic[d];
  11292. if (k) var l = k.getArmatureData(b)
  11293. } else
  11294. for (d in this._dataDic)
  11295. if (k = this._dataDic[d], l = k.getArmatureData(b)) break; if (!l) return null;
  11296. this._currentDataName = d;
  11297. this._currentTextureAtlasName = e || d;
  11298. e = this._generateArmature();
  11299. e.name = b;
  11300. var g, h, p = l.getBoneDataList(),
  11301. q;
  11302. for (q in p) h = p[q], g = new n, g.name = h.name, g.fixedRotation = h.fixedRotation, g.scaleMode =
  11303. h.scaleMode, g.origin.copy(h.transform), l.getBoneData(h.parent) ? e.addChild(g, h.parent) : e.addChild(g, null);
  11304. if (c && c != b) {
  11305. var m = k.getArmatureData(c);
  11306. if (!m)
  11307. for (d in this._dataDic)
  11308. if (k = this._dataDic[d], m = k.getArmatureData(c)) break
  11309. }
  11310. m ? e.animation.setAnimationDataList(m.getAnimationDataList()) : e.animation.setAnimationDataList(l.getAnimationDataList());
  11311. g = l.getSkinData(f);
  11312. if (!g) throw Error();
  11313. b = [];
  11314. d = g.getSlotDataList();
  11315. for (q in d)
  11316. if (k = d[q], g = e.getBone(k.parent)) {
  11317. f = k.getDisplayDataList();
  11318. c = this._generateSlot();
  11319. c.name = k.name;
  11320. c._blendMode = k.blendMode;
  11321. c._originZOrder = k.zOrder;
  11322. c._dislayDataList = f;
  11323. b.length = 0;
  11324. for (k = f.length; k--;) switch (l = f[k], l.type) {
  11325. case a.DisplayData.ARMATURE:
  11326. (l = this.buildArmature(l.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (b[k] = l);
  11327. break;
  11328. default:
  11329. b[k] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], l.name, l.pivot.x, l.pivot.y)
  11330. }
  11331. c.setDisplayList(b);
  11332. c._changeDisplay(0);
  11333. g.addChild(c)
  11334. }
  11335. e._slotsZOrderChanged = !0;
  11336. e.advanceTime(0);
  11337. return e
  11338. };
  11339. c.prototype.getTextureDisplay =
  11340. function(a, b, c, d) {
  11341. if (b) var e = this._textureAtlasDic[b];
  11342. if (!e && !b)
  11343. for (b in this._textureAtlasDic) {
  11344. e = this._textureAtlasDic[b];
  11345. if (e.getRegion(a)) break;
  11346. e = null
  11347. }
  11348. if (e) {
  11349. if (isNaN(c) || isNaN(d))
  11350. if (b = this._dataDic[b])
  11351. if (b = b.getSubTexturePivot(a)) c = b.x, d = b.y;
  11352. return this._generateDisplay(e, a, c, d)
  11353. }
  11354. return null
  11355. };
  11356. c.prototype._generateArmature = function() {
  11357. return null
  11358. };
  11359. c.prototype._generateSlot = function() {
  11360. return null
  11361. };
  11362. c.prototype._generateDisplay = function(a, b, c, d) {
  11363. return null
  11364. };
  11365. return c
  11366. }(f.EventDispatcher);
  11367. b.BaseFactory =
  11368. c;
  11369. c.prototype.__class__ = "dragonBones.factorys.BaseFactory"
  11370. })(c.factorys || (c.factorys = {}));
  11371. var e;
  11372. (function(c) {
  11373. var e = function() {
  11374. function a() {}
  11375. a.ANGLE_TO_RADIAN = Math.PI / 180;
  11376. a.DRAGON_BONES = "dragonBones";
  11377. a.ARMATURE = "armature";
  11378. a.SKIN = "skin";
  11379. a.BONE = "bone";
  11380. a.SLOT = "slot";
  11381. a.DISPLAY = "display";
  11382. a.ANIMATION = "animation";
  11383. a.TIMELINE = "timeline";
  11384. a.FRAME = "frame";
  11385. a.TRANSFORM = "transform";
  11386. a.COLOR_TRANSFORM = "colorTransform";
  11387. a.TEXTURE_ATLAS = "TextureAtlas";
  11388. a.SUB_TEXTURE = "SubTexture";
  11389. a.A_VERSION = "version";
  11390. a.A_IMAGE_PATH = "imagePath";
  11391. a.A_FRAME_RATE = "frameRate";
  11392. a.A_NAME = "name";
  11393. a.A_PARENT = "parent";
  11394. a.A_LENGTH = "length";
  11395. a.A_TYPE = "type";
  11396. a.A_FADE_IN_TIME = "fadeInTime";
  11397. a.A_DURATION = "duration";
  11398. a.A_SCALE = "scale";
  11399. a.A_OFFSET = "offset";
  11400. a.A_LOOP = "loop";
  11401. a.A_EVENT = "event";
  11402. a.A_SOUND = "sound";
  11403. a.A_ACTION = "action";
  11404. a.A_HIDE = "hide";
  11405. a.A_TWEEN_EASING = "tweenEasing";
  11406. a.A_TWEEN_ROTATE = "tweenRotate";
  11407. a.A_DISPLAY_INDEX = "displayIndex";
  11408. a.A_Z_ORDER = "z";
  11409. a.A_BLENDMODE = "blendMode";
  11410. a.A_WIDTH = "width";
  11411. a.A_HEIGHT = "height";
  11412. a.A_SCALE_MODE = "scaleMode";
  11413. a.A_FIXED_ROTATION = "fixedRotation";
  11414. a.A_X = "x";
  11415. a.A_Y = "y";
  11416. a.A_SKEW_X = "skX";
  11417. a.A_SKEW_Y = "skY";
  11418. a.A_SCALE_X = "scX";
  11419. a.A_SCALE_Y = "scY";
  11420. a.A_PIVOT_X = "pX";
  11421. a.A_PIVOT_Y = "pY";
  11422. a.A_ALPHA_OFFSET = "aO";
  11423. a.A_RED_OFFSET = "rO";
  11424. a.A_GREEN_OFFSET = "gO";
  11425. a.A_BLUE_OFFSET = "bO";
  11426. a.A_ALPHA_MULTIPLIER = "aM";
  11427. a.A_RED_MULTIPLIER = "rM";
  11428. a.A_GREEN_MULTIPLIER = "gM";
  11429. a.A_BLUE_MULTIPLIER = "bM";
  11430. return a
  11431. }();
  11432. c.ConstValues = e;
  11433. e.prototype.__class__ = "dragonBones.utils.ConstValues";
  11434. var f = function() {
  11435. function a() {}
  11436. a.transformPointWithParent = function(b, c) {
  11437. var d = a._helpMatrix;
  11438. a.transformToMatrix(c,
  11439. d);
  11440. d.invert();
  11441. var e = b.x,
  11442. f = b.y;
  11443. b.x = d.a * e + d.c * f + d.tx;
  11444. b.y = d.d * f + d.b * e + d.ty;
  11445. b.skewX = a.formatRadian(b.skewX - c.skewX);
  11446. b.skewY = a.formatRadian(b.skewY - c.skewY)
  11447. };
  11448. a.transformToMatrix = function(a, b) {
  11449. b.a = a.scaleX * Math.cos(a.skewY);
  11450. b.b = a.scaleX * Math.sin(a.skewY);
  11451. b.c = -a.scaleY * Math.sin(a.skewX);
  11452. b.d = a.scaleY * Math.cos(a.skewX);
  11453. b.tx = a.x;
  11454. b.ty = a.y
  11455. };
  11456. a.formatRadian = function(b) {
  11457. b %= a.DOUBLE_PI;
  11458. b > Math.PI && (b -= a.DOUBLE_PI);
  11459. b < -Math.PI && (b += a.DOUBLE_PI);
  11460. return b
  11461. };
  11462. a.DOUBLE_PI = 2 * Math.PI;
  11463. a._helpMatrix = new d.Matrix;
  11464. return a
  11465. }();
  11466. c.TransformUtil = f;
  11467. f.prototype.__class__ = "dragonBones.utils.TransformUtil";
  11468. e = function() {
  11469. function c() {}
  11470. c.transformArmatureData = function(a) {
  11471. for (var b = a.getBoneDataList(), c = b.length, d, e; c--;)
  11472. if (d = b[c], d.parent && (e = a.getBoneData(d.parent))) d.transform.copy(d.global), f.transformPointWithParent(d.transform, e.global)
  11473. };
  11474. c.transformArmatureDataAnimations = function(a) {
  11475. for (var b = a.getAnimationDataList(), d = b.length; d--;) c.transformAnimationData(b[d], a)
  11476. };
  11477. c.transformAnimationData = function(a, b) {
  11478. for (var d = b.getSkinData(null),
  11479. e = b.getBoneDataList(), d = d.getSlotDataList(), l = e.length, g, h, q, m, n, C, J, w, u, F; l--;)
  11480. if (g = e[l], h = a.getTimeline(g.name)) {
  11481. q = null;
  11482. for (var N in d)
  11483. if (q = d[N], q.parent == g.name) break;
  11484. m = g.parent ? a.getTimeline(g.parent) : null;
  11485. n = h.getFrameList();
  11486. w = J = C = null;
  11487. F = n.length;
  11488. for (var G = 0; G < F; G++) {
  11489. u = n[G];
  11490. m ? (c._helpTransform1.copy(u.global), c.getTimelineTransform(m, u.position, c._helpTransform2), f.transformPointWithParent(c._helpTransform1, c._helpTransform2), u.transform.copy(c._helpTransform1)) : u.transform.copy(u.global);
  11491. u.transform.x -=
  11492. g.transform.x;
  11493. u.transform.y -= g.transform.y;
  11494. u.transform.skewX -= g.transform.skewX;
  11495. u.transform.skewY -= g.transform.skewY;
  11496. u.transform.scaleX -= g.transform.scaleX;
  11497. u.transform.scaleY -= g.transform.scaleY;
  11498. !h.transformed && q && (u.zOrder -= q.zOrder);
  11499. C || (C = h.originTransform, C.copy(u.transform), C.skewX = f.formatRadian(C.skewX), C.skewY = f.formatRadian(C.skewY), J = h.originPivot, J.x = u.pivot.x, J.y = u.pivot.y);
  11500. u.transform.x -= C.x;
  11501. u.transform.y -= C.y;
  11502. u.transform.skewX = f.formatRadian(u.transform.skewX - C.skewX);
  11503. u.transform.skewY =
  11504. f.formatRadian(u.transform.skewY - C.skewY);
  11505. u.transform.scaleX -= C.scaleX;
  11506. u.transform.scaleY -= C.scaleY;
  11507. h.transformed || (u.pivot.x -= J.x, u.pivot.y -= J.y);
  11508. if (w) {
  11509. var I = u.transform.skewX - w.transform.skewX;
  11510. w.tweenRotate ? 0 < w.tweenRotate ? (0 > I && (u.transform.skewX += 2 * Math.PI, u.transform.skewY += 2 * Math.PI), 1 < w.tweenRotate && (u.transform.skewX += 2 * Math.PI * (w.tweenRotate - 1), u.transform.skewY += 2 * Math.PI * (w.tweenRotate - 1))) : (0 < I && (u.transform.skewX -= 2 * Math.PI, u.transform.skewY -= 2 * Math.PI), 1 > w.tweenRotate && (u.transform.skewX +=
  11511. 2 * Math.PI * (w.tweenRotate + 1), u.transform.skewY += 2 * Math.PI * (w.tweenRotate + 1))) : (u.transform.skewX = w.transform.skewX + f.formatRadian(u.transform.skewX - w.transform.skewX), u.transform.skewY = w.transform.skewY + f.formatRadian(u.transform.skewY - w.transform.skewY))
  11512. }
  11513. w = u
  11514. }
  11515. h.transformed = !0
  11516. }
  11517. };
  11518. c.getTimelineTransform = function(a, c, d) {
  11519. for (var e = a.getFrameList(), l = e.length, g; l--;)
  11520. if (a = e[l], a.position <= c && a.position + a.duration > c) {
  11521. g = a.tweenEasing;
  11522. l == e.length - 1 || isNaN(g) || c == a.position ? d.copy(a.global) : (c = (c - a.position) /
  11523. a.duration, g && (c = b.TimelineState.getEaseValue(c, g)), e = e[l + 1], d.x = a.global.x + (e.global.x - a.global.x) * c, d.y = a.global.y + (e.global.y - a.global.y) * c, d.skewX = f.formatRadian(a.global.skewX + (e.global.skewX - a.global.skewX) * c), d.skewY = f.formatRadian(a.global.skewY + (e.global.skewY - a.global.skewY) * c), d.scaleX = a.global.scaleX + (e.global.scaleX - a.global.scaleX) * c, d.scaleY = a.global.scaleY + (e.global.scaleY - a.global.scaleY) * c);
  11524. break
  11525. }
  11526. };
  11527. c.addHideTimeline = function(b, c) {
  11528. for (var d = c.getBoneDataList(), e = d.length, f; e--;) f =
  11529. d[e], f = f.name, b.getTimeline(f) || b.addTimeline(a.TransformTimeline.HIDE_TIMELINE, f)
  11530. };
  11531. c._helpTransform1 = new a.DBTransform;
  11532. c._helpTransform2 = new a.DBTransform;
  11533. return c
  11534. }();
  11535. c.DBDataUtil = e;
  11536. e.prototype.__class__ = "dragonBones.utils.DBDataUtil"
  11537. })(e = c.utils || (c.utils = {}));
  11538. var l = function() {
  11539. function b() {
  11540. this.global = new a.DBTransform;
  11541. this.origin = new a.DBTransform;
  11542. this.offset = new a.DBTransform;
  11543. this.tween = new a.DBTransform;
  11544. this.tween.scaleX = this.tween.scaleY = 0;
  11545. this._globalTransformMatrix = new d.Matrix;
  11546. this._visible = !0;
  11547. this._isDisplayOnStage = this._isColorChanged = !1;
  11548. this._scaleType = 0;
  11549. this.fixedRotation = !1
  11550. }
  11551. b.prototype.getVisible = function() {
  11552. return this._visible
  11553. };
  11554. b.prototype.setVisible = function(a) {
  11555. this._visible = a
  11556. };
  11557. b.prototype._setParent = function(a) {
  11558. this.parent = a
  11559. };
  11560. b.prototype._setArmature = function(a) {
  11561. this.armature && this.armature._removeDBObject(this);
  11562. (this.armature = a) && this.armature._addDBObject(this)
  11563. };
  11564. b.prototype.dispose = function() {
  11565. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature =
  11566. this.parent = null
  11567. };
  11568. b.prototype._update = function() {
  11569. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  11570. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  11571. if (this.parent) {
  11572. var a = this.origin.x + this.offset.x + this.tween.x,
  11573. b = this.origin.y + this.offset.y + this.tween.y,
  11574. c = this.parent._globalTransformMatrix;
  11575. this._globalTransformMatrix.tx = this.global.x = c.a * a + c.c * b + c.tx;
  11576. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  11577. this.fixedRotation ? (this.global.skewX =
  11578. this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY) : (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX + this.parent.global.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY + this.parent.global.skewY);
  11579. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX, this.global.scaleY *= this.parent.global.scaleY)
  11580. } else this._globalTransformMatrix.tx = this.global.x =
  11581. this.origin.x + this.offset.x + this.tween.x, this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y, this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  11582. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  11583. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  11584. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  11585. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  11586. };
  11587. return b
  11588. }();
  11589. c.DBObject = l;
  11590. l.prototype.__class__ = "dragonBones.DBObject";
  11591. var q = function(a) {
  11592. function b(c) {
  11593. a.call(this);
  11594. this._displayBridge = c;
  11595. this._displayList = [];
  11596. this._displayIndex = -1;
  11597. this._scaleType = 1;
  11598. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  11599. this._isHideDisplay = this._isDisplayOnStage = !1;
  11600. this._blendMode = "normal";
  11601. this._displayBridge.updateBlendMode(this._blendMode)
  11602. }
  11603. __extends(b, a);
  11604. b.prototype.getZOrder = function() {
  11605. return this._originZOrder +
  11606. this._tweenZorder + this._offsetZOrder
  11607. };
  11608. b.prototype.setZOrder = function(a) {
  11609. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  11610. };
  11611. b.prototype.getDisplay = function() {
  11612. var a = this._displayList[this._displayIndex];
  11613. return a instanceof g ? a.getDisplay() : a
  11614. };
  11615. b.prototype.setDisplay = function(a) {
  11616. this._displayList[this._displayIndex] = a;
  11617. this._setDisplay(a)
  11618. };
  11619. b.prototype.getBlendMode = function() {
  11620. return this._blendMode
  11621. };
  11622. b.prototype.setBlendMode =
  11623. function(a) {
  11624. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  11625. };
  11626. b.prototype.getChildArmature = function() {
  11627. var a = this._displayList[this._displayIndex];
  11628. return a instanceof g ? a : null
  11629. };
  11630. b.prototype.setChildArmature = function(a) {
  11631. (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  11632. };
  11633. b.prototype.getDisplayList = function() {
  11634. return this._displayList
  11635. };
  11636. b.prototype.setDisplayList = function(a) {
  11637. if (!a) throw Error();
  11638. for (var b =
  11639. this._displayList.length = a.length; b--;) this._displayList[b] = a[b];
  11640. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  11641. };
  11642. b.prototype._setDisplay = function(a) {
  11643. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  11644. this.updateChildArmatureAnimation();
  11645. a && this._displayBridge.updateBlendMode(this._blendMode);
  11646. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  11647. };
  11648. b.prototype._changeDisplay = function(a) {
  11649. if (0 > a) this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  11650. else {
  11651. if (this._isHideDisplay) {
  11652. this._isHideDisplay = !1;
  11653. var b = !0;
  11654. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  11655. }
  11656. var c = this._displayList.length;
  11657. a >= c && 0 < c && (a = c - 1);
  11658. this._displayIndex !=
  11659. a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof g ? this._setDisplay(a.getDisplay()) : this._setDisplay(a), this._dislayDataList && this._displayIndex <= this._dislayDataList.length && this.origin.copy(this._dislayDataList[this._displayIndex].transform)) : b && this.updateChildArmatureAnimation()
  11660. }!this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  11661. };
  11662. b.prototype.setVisible = function(a) {
  11663. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  11664. };
  11665. b.prototype._setArmature = function(b) {
  11666. a.prototype._setArmature.call(this, b);
  11667. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  11668. };
  11669. b.prototype.dispose = function() {
  11670. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  11671. };
  11672. b.prototype._update = function() {
  11673. a.prototype._update.call(this);
  11674. if (this._isDisplayOnStage) {
  11675. var b =
  11676. this.parent._tweenPivot.x,
  11677. c = this.parent._tweenPivot.y;
  11678. if (b || c) {
  11679. var d = this.parent._globalTransformMatrix;
  11680. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  11681. this._globalTransformMatrix.ty += d.b * b + d.d * c
  11682. }
  11683. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  11684. }
  11685. };
  11686. b.prototype._updateVisible = function(a) {
  11687. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  11688. };
  11689. b.prototype.updateChildArmatureAnimation = function() {
  11690. var a = this.getChildArmature();
  11691. if (a)
  11692. if (this._isHideDisplay) a.animation.stop(),
  11693. a.animation._lastAnimationState = null;
  11694. else {
  11695. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  11696. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  11697. }
  11698. };
  11699. return b
  11700. }(l);
  11701. c.Slot = q;
  11702. q.prototype.__class__ = "dragonBones.Slot";
  11703. var n = function(a) {
  11704. function b() {
  11705. a.call(this);
  11706. this._children = [];
  11707. this._scaleType = 2;
  11708. this._tweenPivot = new d.Point;
  11709. this.scaleMode = 1
  11710. }
  11711. __extends(b, a);
  11712. b.prototype.setVisible = function(a) {
  11713. if (this._visible != a)
  11714. for (this._visible = a, a = this._children.length; a--;) {
  11715. var b =
  11716. this._children[a];
  11717. b instanceof q && b._updateVisible(this._visible)
  11718. }
  11719. };
  11720. b.prototype._setArmature = function(b) {
  11721. a.prototype._setArmature.call(this, b);
  11722. for (b = this._children.length; b--;) this._children[b]._setArmature(this.armature)
  11723. };
  11724. b.prototype.dispose = function() {
  11725. if (this._children) {
  11726. a.prototype.dispose.call(this);
  11727. for (var b = this._children.length; b--;) this._children[b].dispose();
  11728. this._children.length = 0;
  11729. this.slot = this._tweenPivot = this._children = null
  11730. }
  11731. };
  11732. b.prototype.contains = function(a) {
  11733. if (!a) throw Error();
  11734. if (a ==
  11735. this) return !1;
  11736. for (; a != this && null != a;) a = a.parent;
  11737. return a == this
  11738. };
  11739. b.prototype.addChild = function(a) {
  11740. if (!a) throw Error();
  11741. if (a == this || a instanceof b && a.contains(this)) throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");
  11742. a.parent && a.parent.removeChild(a);
  11743. this._children[this._children.length] = a;
  11744. a._setParent(this);
  11745. a._setArmature(this.armature);
  11746. !this.slot && a instanceof q && (this.slot = a)
  11747. };
  11748. b.prototype.removeChild = function(a) {
  11749. if (!a) throw Error();
  11750. var b =
  11751. this._children.indexOf(a);
  11752. if (0 <= b) this._children.splice(b, 1), a._setParent(null), a._setArmature(null), a == this.slot && (this.slot = null);
  11753. else throw Error();
  11754. };
  11755. b.prototype.getSlots = function() {
  11756. for (var a = [], b = this._children.length; b--;) this._children[b] instanceof q && a.unshift(this._children[b]);
  11757. return a
  11758. };
  11759. b.prototype._arriveAtFrame = function(a, c, d, e) {
  11760. if (a) {
  11761. if (c = d.getMixingTransform(this.name), !d.displayControl || 2 != c && -1 != c || this.displayController && this.displayController != d.name || !this.slot || (c = a.displayIndex,
  11762. 0 <= c && !isNaN(a.zOrder) && a.zOrder != this.slot._tweenZorder && (this.slot._tweenZorder = a.zOrder, this.armature._slotsZOrderChanged = !0), this.slot._changeDisplay(c), this.slot._updateVisible(a.visible)), a.event && this.armature.hasEventListener(f.FrameEvent.BONE_FRAME_EVENT) && (c = new f.FrameEvent(f.FrameEvent.BONE_FRAME_EVENT), c.bone = this, c.animationState = d, c.frameLabel = a.event, this.armature._eventList.push(c)), a.sound && b._soundManager.hasEventListener(f.SoundEvent.SOUND) && (c = new f.SoundEvent(f.SoundEvent.SOUND),
  11763. c.armature = this.armature, c.animationState = d, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action)
  11764. for (var l in this._children) this._children[l] instanceof q && (d = this._children[l].getChildArmature()) && d.animation.gotoAndPlay(a.action)
  11765. } else this.slot && this.slot._changeDisplay(-1)
  11766. };
  11767. b.prototype._updateColor = function(a, b, c, d, e, f, l, g, h) {
  11768. (h || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, f, l, g);
  11769. this._isColorChanged = h
  11770. };
  11771. b._soundManager = f.SoundEventManager.getInstance();
  11772. return b
  11773. }(l);
  11774. c.Bone = n;
  11775. n.prototype.__class__ = "dragonBones.Bone";
  11776. var g = function(a) {
  11777. function c(d) {
  11778. a.call(this);
  11779. this.animation = new b.Animation(this);
  11780. this._display = d;
  11781. this._slotsZOrderChanged = !1;
  11782. this._slotList = [];
  11783. this._boneList = [];
  11784. this._eventList = []
  11785. }
  11786. __extends(c, a);
  11787. c.prototype.getDisplay = function() {
  11788. return this._display
  11789. };
  11790. c.prototype.dispose = function() {
  11791. if (this.animation) {
  11792. this.animation.dispose();
  11793. for (var a = this._slotList.length; a--;) this._slotList[a].dispose();
  11794. for (a = this._boneList.length; a--;) this._boneList[a].dispose();
  11795. this._slotList.length = 0;
  11796. this._boneList.length = 0;
  11797. this._eventList.length = 0;
  11798. this.animation = this._display = this._eventList = this._boneList = this._slotList = null
  11799. }
  11800. };
  11801. c.prototype.advanceTime = function(a) {
  11802. this.animation.advanceTime(a);
  11803. a *= this.animation.timeScale;
  11804. for (var b = this._boneList.length; b--;) this._boneList[b]._update();
  11805. for (var b = this._slotList.length, c; b--;) c = this._slotList[b], c._update(), c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  11806. this._slotsZOrderChanged && (this.updateSlotsZOrder(),
  11807. this.hasEventListener(f.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new f.ArmatureEvent(f.ArmatureEvent.Z_ORDER_UPDATED)));
  11808. if (this._eventList.length) {
  11809. a = this._eventList.length;
  11810. for (b = 0; b < a; b++) this.dispatchEvent(this._eventList[b]);
  11811. this._eventList.length = 0
  11812. }
  11813. };
  11814. c.prototype.getSlots = function(a) {
  11815. void 0 === a && (a = !0);
  11816. return a ? this._slotList.concat() : this._slotList
  11817. };
  11818. c.prototype.getBones = function(a) {
  11819. void 0 === a && (a = !0);
  11820. return a ? this._boneList.concat() : this._boneList
  11821. };
  11822. c.prototype.getSlot = function(a) {
  11823. for (var b =
  11824. this._slotList.length; b--;)
  11825. if (this._slotList[b].name == a) return this._slotList[b];
  11826. return null
  11827. };
  11828. c.prototype.getSlotByDisplay = function(a) {
  11829. if (a)
  11830. for (var b = this._slotList.length; b--;)
  11831. if (this._slotList[b].getDisplay() == a) return this._slotList[b];
  11832. return null
  11833. };
  11834. c.prototype.removeSlot = function(a) {
  11835. if (!a) throw Error();
  11836. if (0 <= this._slotList.indexOf(a)) a.parent.removeChild(a);
  11837. else throw Error();
  11838. };
  11839. c.prototype.removeSlotByName = function(a) {
  11840. a && (a = this.getSlot(a)) && this.removeSlot(a)
  11841. };
  11842. c.prototype.getBone = function(a) {
  11843. for (var b =
  11844. this._boneList.length; b--;)
  11845. if (this._boneList[b].name == a) return this._boneList[b];
  11846. return null
  11847. };
  11848. c.prototype.getBoneByDisplay = function(a) {
  11849. return (a = this.getSlotByDisplay(a)) ? a.parent : null
  11850. };
  11851. c.prototype.removeBone = function(a) {
  11852. if (!a) throw Error();
  11853. if (0 <= this._boneList.indexOf(a)) a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  11854. else throw Error();
  11855. };
  11856. c.prototype.removeBoneByName = function(a) {
  11857. a && (a = this.getBone(a)) && this.removeBone(a)
  11858. };
  11859. c.prototype.addChild = function(a, b) {
  11860. if (!a) throw Error();
  11861. if (b) {
  11862. var c = this.getBone(b);
  11863. if (c) c.addChild(a);
  11864. else throw Error();
  11865. } else a.parent && a.parent.removeChild(a), a._setArmature(this)
  11866. };
  11867. c.prototype.updateSlotsZOrder = function() {
  11868. this._slotList.sort(this.sortSlot);
  11869. for (var a = this._slotList.length, b; a--;) b = this._slotList[a], b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  11870. this._slotsZOrderChanged = !1
  11871. };
  11872. c.prototype._addDBObject = function(a) {
  11873. a instanceof q ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof n && 0 > this._boneList.indexOf(a) && (this._boneList[this._boneList.length] =
  11874. a, this._sortBoneList())
  11875. };
  11876. c.prototype._removeDBObject = function(a) {
  11877. a instanceof q ? (a = this._slotList.indexOf(a), 0 <= a && this._slotList.splice(a, 1)) : a instanceof n && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  11878. };
  11879. c.prototype._sortBoneList = function() {
  11880. var a = this._boneList.length;
  11881. if (0 != a) {
  11882. for (var b = [], c, d, e; a--;) {
  11883. c = 0;
  11884. for (e = d = this._boneList[a]; e;) c++, e = e.parent;
  11885. b[a] = {
  11886. level: c,
  11887. bone: d
  11888. }
  11889. }
  11890. b.sort(this.sortBone);
  11891. for (a = b.length; a--;) this._boneList[a] = b[a].bone
  11892. }
  11893. };
  11894. c.prototype._arriveAtFrame = function(a,
  11895. b, d, e) {
  11896. a.event && this.hasEventListener(f.FrameEvent.ANIMATION_FRAME_EVENT) && (b = new f.FrameEvent(f.FrameEvent.ANIMATION_FRAME_EVENT), b.animationState = d, b.frameLabel = a.event, this._eventList.push(b));
  11897. a.sound && c._soundManager.hasEventListener(f.SoundEvent.SOUND) && (b = new f.SoundEvent(f.SoundEvent.SOUND), b.armature = this, b.animationState = d, b.sound = a.sound, c._soundManager.dispatchEvent(b));
  11898. a.action && d.isPlaying && this.animation.gotoAndPlay(a.action)
  11899. };
  11900. c.prototype.sortSlot = function(a, b) {
  11901. return a.getZOrder() <
  11902. b.getZOrder() ? 1 : -1
  11903. };
  11904. c.prototype.sortBone = function(a, b) {
  11905. return a.level < b.level ? 1 : -1
  11906. };
  11907. c._soundManager = f.SoundEventManager.getInstance();
  11908. return c
  11909. }(f.EventDispatcher);
  11910. c.Armature = g;
  11911. g.prototype.__class__ = "dragonBones.Armature"
  11912. })(dragonBones || (dragonBones = {}));
  11913. __extends = this.__extends || function(c, d) {
  11914. function f() {
  11915. this.constructor = c
  11916. }
  11917. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  11918. f.prototype = d.prototype;
  11919. c.prototype = new f
  11920. };
  11921. (function(c) {
  11922. var d;
  11923. (function(c) {
  11924. var b = function() {
  11925. function a() {}
  11926. a.prototype.getVisible = function() {
  11927. return this._display ? this._display.visible : !1
  11928. };
  11929. a.prototype.setVisible = function(a) {
  11930. this._display && (this._display.visible = a)
  11931. };
  11932. a.prototype.getDisplay = function() {
  11933. return this._display
  11934. };
  11935. a.prototype.setDisplay = function(a) {
  11936. if (this._display != a) {
  11937. if (this._display) {
  11938. var b = this._display.parent;
  11939. if (b) var c = b.getChildIndex(this._display);
  11940. this.removeDisplay()
  11941. }
  11942. this._display = a;
  11943. this.addDisplay(b, c)
  11944. }
  11945. };
  11946. a.prototype.dispose = function() {
  11947. this._display =
  11948. null
  11949. };
  11950. a.prototype.updateTransform = function(a, b) {
  11951. this._display.__hack_local_matrix = a;
  11952. this._display._setSizeDirty()
  11953. };
  11954. a.prototype.updateColor = function(a, b, c, d, f, h, m, k) {
  11955. this._display && (this._display._alpha = f)
  11956. };
  11957. a.prototype.updateBlendMode = function(a) {
  11958. this._display && a && (this._display.blendMode = a)
  11959. };
  11960. a.prototype.addDisplay = function(a, b) {
  11961. a && this._display && (this._display._parent && this._display._parent.removeChild(this._display), 0 > b ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(b, a.numChildren)))
  11962. };
  11963. a.prototype.removeDisplay = function() {
  11964. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  11965. };
  11966. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  11967. return a
  11968. }();
  11969. c.DragonBonesEgretBridge = b;
  11970. b.prototype.__class__ = "dragonBones.display.DragonBonesEgretBridge"
  11971. })(d = c.display || (c.display = {}));
  11972. (function(d) {
  11973. var b = function() {
  11974. function a(a, b, d) {
  11975. void 0 === d && (d = 1);
  11976. this.texture = a;
  11977. this.textureAtlasRawData = b;
  11978. this._textureData = {};
  11979. this.scale = d;
  11980. this.name = b[c.utils.ConstValues.A_NAME];
  11981. this.parseData(b);
  11982. this.spriteSheet =
  11983. new egret.SpriteSheet(a)
  11984. }
  11985. a.prototype.getTexture = function(a) {
  11986. var b = this.spriteSheet.getTexture(a);
  11987. b || (b = this._textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.width, b.height));
  11988. return b
  11989. };
  11990. a.prototype.dispose = function() {
  11991. this.texture = null
  11992. };
  11993. a.prototype.getRegion = function(a) {
  11994. throw Error("error");
  11995. };
  11996. a.prototype.parseData = function(a) {
  11997. for (var b = a.SubTexture.length, c = 0; c < b; c++) {
  11998. var d = a.SubTexture[c];
  11999. this._textureData[d.name] = d
  12000. }
  12001. };
  12002. return a
  12003. }();
  12004. d.EgretTextureAtlas = b;
  12005. b.prototype.__class__ = "dragonBones.textures.EgretTextureAtlas"
  12006. })(c.textures ||
  12007. (c.textures = {}));
  12008. (function(f) {
  12009. var b = function(a) {
  12010. function b() {
  12011. a.call(this)
  12012. }
  12013. __extends(b, a);
  12014. b.prototype._generateArmature = function() {
  12015. return new c.Armature(new egret.DisplayObjectContainer)
  12016. };
  12017. b.prototype._generateSlot = function() {
  12018. return new c.Slot(new d.DragonBonesEgretBridge)
  12019. };
  12020. b.prototype._generateDisplay = function(a, b, c, d) {
  12021. var e = new egret.Bitmap;
  12022. e.texture = a.getTexture(b);
  12023. e.anchorOffsetX = c;
  12024. e.anchorOffsetY = d;
  12025. return e
  12026. };
  12027. return b
  12028. }(f.BaseFactory);
  12029. f.EgretFactory = b;
  12030. b.prototype.__class__ = "dragonBones.factorys.EgretFactory"
  12031. })(c.factorys ||
  12032. (c.factorys = {}))
  12033. })(dragonBones || (dragonBones = {}));
  12034. __extends = this.__extends || function(c, d) {
  12035. function f() {
  12036. this.constructor = c
  12037. }
  12038. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  12039. f.prototype = d.prototype;
  12040. c.prototype = new f
  12041. };
  12042. (function(c) {
  12043. var d = function(d) {
  12044. function b(a) {
  12045. void 0 === a && (a = 60);
  12046. d.call(this);
  12047. this.frameRate = a;
  12048. this._time = 0;
  12049. this._isActivate = !0;
  12050. 60 == a && (b.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, b.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame ||
  12051. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  12052. b.requestAnimationFrame || (b.requestAnimationFrame = function(b) {
  12053. return window.setTimeout(b, 1E3 / a)
  12054. });
  12055. b.cancelAnimationFrame || (b.cancelAnimationFrame = function(a) {
  12056. return window.clearTimeout(a)
  12057. });
  12058. b.instance = this;
  12059. this.registerListener()
  12060. }
  12061. __extends(b, d);
  12062. b.prototype.enterFrame = function() {
  12063. var a = b.instance,
  12064. d = b._thisObject,
  12065. f = b._callback,
  12066. q = c.getTimer(),
  12067. n = q -
  12068. a._time;
  12069. a._requestAnimationId = b.requestAnimationFrame.call(window, b.prototype.enterFrame);
  12070. f.call(d, n);
  12071. a._time = q
  12072. };
  12073. b.prototype.executeMainLoop = function(a, c) {
  12074. b._callback = a;
  12075. b._thisObject = c;
  12076. this.enterFrame()
  12077. };
  12078. b.prototype.reset = function() {
  12079. var a = b.instance;
  12080. a._requestAnimationId && (a._time = c.getTimer(), b.cancelAnimationFrame.call(window, a._requestAnimationId), a.enterFrame())
  12081. };
  12082. b.prototype.registerListener = function() {
  12083. var a = this,
  12084. d = function() {
  12085. a._isActivate && (a._isActivate = !1, c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.DEACTIVATE)))
  12086. },
  12087. f = function() {
  12088. a._isActivate || (a._isActivate = !0, b.instance.reset(), c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.ACTIVATE)))
  12089. },
  12090. q = function() {
  12091. document[n] ? d() : f()
  12092. };
  12093. window.addEventListener("focus", f, !1);
  12094. window.addEventListener("blur", d, !1);
  12095. var n, g;
  12096. "undefined" !== typeof document.hidden ? (n = "hidden", g = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (n = "mozHidden", g = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (n = "msHidden", g = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ?
  12097. (n = "webkitHidden", g = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (n = "oHidden", g = "ovisibilitychange");
  12098. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", f, !1), window.addEventListener("pagehide", d, !1));
  12099. n && g && document.addEventListener(g, q, !1)
  12100. };
  12101. return b
  12102. }(c.DeviceContext);
  12103. c.HTML5DeviceContext = d;
  12104. d.prototype.__class__ = "egret.HTML5DeviceContext"
  12105. })(egret || (egret = {}));
  12106. var egret_html5_localStorage;
  12107. (function(c) {
  12108. c.getItem = function(c) {
  12109. return window.localStorage.getItem(c)
  12110. };
  12111. c.setItem = function(c, f) {
  12112. try {
  12113. return window.localStorage.setItem(c, f), !0
  12114. } catch (b) {
  12115. return console.log("egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key=" + c + "&value=" + f), !1
  12116. }
  12117. };
  12118. c.removeItem = function(c) {
  12119. window.localStorage.removeItem(c)
  12120. };
  12121. c.clear = function() {
  12122. window.localStorage.clear()
  12123. };
  12124. c.init = function() {
  12125. for (var d in c) egret.localStorage[d] = c[d]
  12126. }
  12127. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  12128. egret_html5_localStorage.init();
  12129. __extends = this.__extends || function(c, d) {
  12130. function f() {
  12131. this.constructor = c
  12132. }
  12133. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  12134. f.prototype = d.prototype;
  12135. c.prototype = new f
  12136. };
  12137. (function(c) {
  12138. var d = function(d) {
  12139. function b(a) {
  12140. d.call(this);
  12141. this.globalAlpha = 1;
  12142. this.canvas = a || this.createCanvas();
  12143. this.canvasContext = this.canvas.getContext("2d");
  12144. this._cacheCanvas = document.createElement("canvas");
  12145. this._cacheCanvas.width = this.canvas.width;
  12146. this._cacheCanvas.height = this.canvas.height;
  12147. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  12148. this._cacheCanvasContext.imageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  12149. this._cacheCanvasContext.webkitImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  12150. this._cacheCanvasContext.mozImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  12151. this._cacheCanvasContext.msImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  12152. this.onResize();
  12153. var b = this.canvasContext.setTransform,
  12154. l = this;
  12155. this._cacheCanvasContext.setTransform = function(a, c, d, f, m, k) {
  12156. l._matrixA = a;
  12157. l._matrixB = c;
  12158. l._matrixC = d;
  12159. l._matrixD = f;
  12160. l._matrixTx = m;
  12161. l._matrixTy = k;
  12162. b.call(l._cacheCanvasContext, a, c, d, f, m, k)
  12163. };
  12164. this._matrixA = 1;
  12165. this._matrixC = this._matrixB = 0;
  12166. this._matrixD = 1;
  12167. this._transformTy =
  12168. this._transformTx = this._matrixTy = this._matrixTx = 0;
  12169. this.initBlendMode()
  12170. }
  12171. __extends(b, d);
  12172. b.prototype.createCanvas = function() {
  12173. var a = c.Browser.getInstance().$("#egretCanvas");
  12174. if (!a) {
  12175. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  12176. a = c.Browser.getInstance().$new("canvas");
  12177. a.id = "egretCanvas";
  12178. b.appendChild(a)
  12179. }
  12180. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
  12181. return a
  12182. };
  12183. b.prototype.onResize = function() {
  12184. if (this.canvas) {
  12185. var a = document.getElementById(c.StageDelegate.canvas_div_name);
  12186. this.canvas.width = c.MainContext.instance.stage.stageWidth;
  12187. this.canvas.height = c.MainContext.instance.stage.stageHeight;
  12188. this.canvas.style.width = a.style.width;
  12189. this.canvas.style.height = a.style.height;
  12190. this._cacheCanvas.width = this.canvas.width;
  12191. this._cacheCanvas.height = this.canvas.height
  12192. }
  12193. };
  12194. b.prototype.clearScreen = function() {
  12195. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, d = a.length; b < d; b++) {
  12196. var f = a[b];
  12197. this.clearRect(f.x, f.y, f.width, f.height)
  12198. }
  12199. a = c.MainContext.instance.stage;
  12200. this._cacheCanvasContext.clearRect(0,
  12201. 0, a.stageWidth, a.stageHeight);
  12202. this.renderCost = 0
  12203. };
  12204. b.prototype.clearRect = function(a, b, c, d) {
  12205. this.canvasContext.clearRect(a, b, c, d)
  12206. };
  12207. b.prototype.drawImage = function(a, b, l, q, n, g, h, m, k, p) {
  12208. void 0 === p && (p = void 0);
  12209. var r = c.MainContext.instance.rendererContext.texture_scale_factor;
  12210. b /= r;
  12211. l /= r;
  12212. q /= r;
  12213. n /= r;
  12214. r = a._bitmapData;
  12215. g += this._transformTx;
  12216. h += this._transformTy;
  12217. var s = c.getTimer();
  12218. void 0 === p ? this._cacheCanvasContext.drawImage(r, b, l, q, n, g, h, m, k) : this.drawRepeatImage(a, b, l, q, n, g, h, m, k, p);
  12219. d.prototype.drawImage.call(this,
  12220. a, b, l, q, n, g, h, m, k, p);
  12221. this.renderCost += c.getTimer() - s
  12222. };
  12223. b.prototype.drawRepeatImage = function(a, b, c, d, f, g, h, m, k, p) {
  12224. if (void 0 === a.pattern) {
  12225. var r = a._bitmapData,
  12226. s = r;
  12227. if (r.width != d || r.height != f) s = document.createElement("canvas"), s.width = d, s.height = f, s.getContext("2d").drawImage(r, b, c, d, f, 0, 0, d, f);
  12228. b = this._cacheCanvasContext.createPattern(s, p);
  12229. a.pattern = b
  12230. }
  12231. this._cacheCanvasContext.fillStyle = a.pattern;
  12232. this._cacheCanvasContext.translate(g, h);
  12233. this._cacheCanvasContext.fillRect(0, 0, m, k);
  12234. this._cacheCanvasContext.translate(-g, -h)
  12235. };
  12236. b.prototype.setTransform = function(a) {
  12237. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this._cacheCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  12238. };
  12239. b.prototype.setAlpha = function(a, b) {
  12240. a != this.globalAlpha &&
  12241. (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  12242. b ? (this.blendValue = this.blendModes[b], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = this.blendModes[c.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  12243. };
  12244. b.prototype.initBlendMode = function() {
  12245. this.blendModes = {};
  12246. this.blendModes[c.BlendMode.NORMAL] = "source-over";
  12247. this.blendModes[c.BlendMode.ADD] = "lighter"
  12248. };
  12249. b.prototype.setupFont = function(a,
  12250. b) {
  12251. void 0 === b && (b = null);
  12252. b = b || {};
  12253. var c = null == b.size ? a._size : b.size,
  12254. d = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  12255. f = this._cacheCanvasContext,
  12256. g = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  12257. g = g + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  12258. f.font = g + (c + "px " + d);
  12259. f.textAlign = "left";
  12260. f.textBaseline = "middle"
  12261. };
  12262. b.prototype.measureText = function(a) {
  12263. return this._cacheCanvasContext.measureText(a).width
  12264. };
  12265. b.prototype.drawText = function(a, b, l, q, n, g) {
  12266. void 0 === g && (g = null);
  12267. this.setupFont(a, g);
  12268. g = g || {};
  12269. var h;
  12270. h = null != g.textColor ? c.toColorString(g.textColor) : a._textColorString;
  12271. var m;
  12272. m = null != g.strokeColor ? c.toColorString(g.strokeColor) : a._strokeColorString;
  12273. var k;
  12274. k = null != g.stroke ? g.stroke : a._stroke;
  12275. var p = this._cacheCanvasContext;
  12276. p.fillStyle = h;
  12277. p.strokeStyle = m;
  12278. k && (p.lineWidth = 2 * k, p.strokeText(b, l + this._transformTx, q + this._transformTy, n || 65535));
  12279. p.fillText(b, l + this._transformTx, q + this._transformTy, n || 65535);
  12280. d.prototype.drawText.call(this, a, b, l, q, n, g)
  12281. };
  12282. b.prototype.strokeRect = function(a, b, c, d, f) {
  12283. this._cacheCanvasContext.strokeStyle =
  12284. f;
  12285. this._cacheCanvasContext.strokeRect(a, b, c, d)
  12286. };
  12287. b.prototype.pushMask = function(a) {
  12288. this._cacheCanvasContext.save();
  12289. this._cacheCanvasContext.beginPath();
  12290. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  12291. this._cacheCanvasContext.clip();
  12292. this._cacheCanvasContext.closePath()
  12293. };
  12294. b.prototype.popMask = function() {
  12295. this._cacheCanvasContext.restore();
  12296. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  12297. };
  12298. b.prototype.onRenderStart = function() {
  12299. this._cacheCanvasContext.save()
  12300. };
  12301. b.prototype.onRenderFinish =
  12302. function() {
  12303. this._cacheCanvasContext.restore();
  12304. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  12305. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, d = a.length; b < d; b++) {
  12306. var f = a[b];
  12307. this.canvasContext.drawImage(this._cacheCanvas, f.x, f.y, f.width, f.height, f.x, f.y, f.width, f.height)
  12308. }
  12309. };
  12310. return b
  12311. }(c.RendererContext);
  12312. c.HTML5CanvasRenderer = d;
  12313. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  12314. })(egret || (egret = {}));
  12315. var egret_h5_graphics;
  12316. (function(c) {
  12317. c.beginFill = function(c, b) {
  12318. void 0 === b && (b = 1);
  12319. var a = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + b + ")";
  12320. this.fillStyleColor = a;
  12321. this.commandQueue.push(new d(this._setStyle, this, [a]))
  12322. };
  12323. c.drawRect = function(c, b, a, e) {
  12324. this.commandQueue.push(new d(function(a, b, c, d) {
  12325. var e = this.renderContext;
  12326. this.canvasContext.beginPath();
  12327. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  12328. this.canvasContext.closePath()
  12329. }, this, [c, b, a, e]));
  12330. this._fill()
  12331. };
  12332. c.drawCircle = function(c, b, a) {
  12333. this.commandQueue.push(new d(function(a,
  12334. b, c) {
  12335. var d = this.renderContext;
  12336. this.canvasContext.beginPath();
  12337. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  12338. this.canvasContext.closePath()
  12339. }, this, [c, b, a]));
  12340. this._fill()
  12341. };
  12342. c.drawRoundRect = function(c, b, a, e, l, q) {
  12343. this.commandQueue.push(new d(function(a, b, c, d, e, f) {
  12344. var l = this.renderContext;
  12345. a = l._transformTx + a;
  12346. b = l._transformTy + b;
  12347. e /= 2;
  12348. f = f ? f / 2 : e;
  12349. c = a + c;
  12350. d = b + d;
  12351. l = d - f;
  12352. this.canvasContext.beginPath();
  12353. this.canvasContext.moveTo(c, l);
  12354. this.canvasContext.quadraticCurveTo(c, d, c - e, d);
  12355. this.canvasContext.lineTo(a +
  12356. e, d);
  12357. this.canvasContext.quadraticCurveTo(a, d, a, d - f);
  12358. this.canvasContext.lineTo(a, b + f);
  12359. this.canvasContext.quadraticCurveTo(a, b, a + e, b);
  12360. this.canvasContext.lineTo(c - e, b);
  12361. this.canvasContext.quadraticCurveTo(c, b, c, b + f);
  12362. this.canvasContext.lineTo(c, l);
  12363. this.canvasContext.closePath()
  12364. }, this, [c, b, a, e, l, q]));
  12365. this._fill()
  12366. };
  12367. c.drawEllipse = function(c, b, a, e) {
  12368. this.commandQueue.push(new d(function(a, b, c, d) {
  12369. var e = this.renderContext;
  12370. this.canvasContext.save();
  12371. a = e._transformTx + a;
  12372. b = e._transformTy + b;
  12373. var e = c > d ? c : d,
  12374. f = c / e;
  12375. d /=
  12376. e;
  12377. this.canvasContext.scale(f, d);
  12378. this.canvasContext.beginPath();
  12379. this.canvasContext.moveTo((a + c) / f, b / d);
  12380. this.canvasContext.arc(a / f, b / d, e, 0, 2 * Math.PI);
  12381. this.canvasContext.closePath();
  12382. this.canvasContext.restore();
  12383. this.canvasContext.stroke()
  12384. }, this, [c, b, a, e]));
  12385. this._fill()
  12386. };
  12387. c.lineStyle = function(c, b, a, e, l, q, n, g) {
  12388. void 0 === c && (c = NaN);
  12389. void 0 === b && (b = 0);
  12390. void 0 === a && (a = 1);
  12391. void 0 === e && (e = !1);
  12392. void 0 === l && (l = "normal");
  12393. void 0 === q && (q = null);
  12394. void 0 === n && (n = null);
  12395. void 0 === g && (g = 3);
  12396. this.strokeStyleColor && (this.createEndLineCommand(),
  12397. this.commandQueue.push(this.endLineCommand));
  12398. this.strokeStyleColor = b = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  12399. this.commandQueue.push(new d(function(a, b) {
  12400. this.canvasContext.lineWidth = a;
  12401. this.canvasContext.strokeStyle = b;
  12402. this.canvasContext.beginPath()
  12403. }, this, [c, b]));
  12404. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  12405. this.moveTo(this.lineX, this.lineY)
  12406. };
  12407. c.lineTo = function(c, b) {
  12408. this.commandQueue.push(new d(function(a, b) {
  12409. var c = this.renderContext;
  12410. this.canvasContext.lineTo(c._transformTx +
  12411. a, c._transformTy + b)
  12412. }, this, [c, b]));
  12413. this.lineX = c;
  12414. this.lineY = b
  12415. };
  12416. c.curveTo = function(c, b, a, e) {
  12417. this.commandQueue.push(new d(function(a, b, c, d) {
  12418. var e = this.renderContext;
  12419. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, e._transformTx + c, e._transformTy + d)
  12420. }, this, [c, b, a, e]));
  12421. this.lineX = a;
  12422. this.lineY = e
  12423. };
  12424. c.moveTo = function(c, b) {
  12425. this.commandQueue.push(new d(function(a, b) {
  12426. var c = this.renderContext;
  12427. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  12428. }, this, [c, b]))
  12429. };
  12430. c.clear = function() {
  12431. this.lineY =
  12432. this.lineX = this.commandQueue.length = 0;
  12433. this.fillStyleColor = this.strokeStyleColor = null
  12434. };
  12435. c.createEndFillCommand = function() {
  12436. this.endFillCommand || (this.endFillCommand = new d(function() {
  12437. this.canvasContext.fill();
  12438. this.canvasContext.closePath()
  12439. }, this, null))
  12440. };
  12441. c.endFill = function() {
  12442. null != this.fillStyleColor && this._fill();
  12443. this.fillStyleColor = null
  12444. };
  12445. c._fill = function() {
  12446. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  12447. };
  12448. c.createEndLineCommand = function() {
  12449. this.endLineCommand ||
  12450. (this.endLineCommand = new d(function() {
  12451. this.canvasContext.stroke();
  12452. this.canvasContext.closePath()
  12453. }, this, null))
  12454. };
  12455. c._draw = function(c) {
  12456. var b = this.commandQueue.length;
  12457. if (0 != b) {
  12458. this.renderContext = c;
  12459. c = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  12460. c.save();
  12461. this.strokeStyleColor && 0 < b && this.commandQueue[b - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), b = this.commandQueue.length);
  12462. for (var a = 0; a < b; a++) {
  12463. var d = this.commandQueue[a];
  12464. d.method.apply(d.thisObject, d.args)
  12465. }
  12466. c.restore()
  12467. }
  12468. };
  12469. var d = function() {
  12470. return function(c, b, a) {
  12471. this.method = c;
  12472. this.thisObject = b;
  12473. this.args = a
  12474. }
  12475. }();
  12476. d.prototype.__class__ = "egret_h5_graphics.Command";
  12477. c._setStyle = function(c) {
  12478. this.canvasContext.fillStyle = c;
  12479. this.canvasContext.beginPath()
  12480. };
  12481. c.init = function() {
  12482. for (var d in c) egret.Graphics.prototype[d] = c[d];
  12483. egret.RendererContext.createRendererContext = function(b) {
  12484. return new egret.HTML5CanvasRenderer(b)
  12485. }
  12486. }
  12487. })(egret_h5_graphics || (egret_h5_graphics = {}));
  12488. egret_h5_graphics.init();
  12489. __extends = this.__extends || function(c, d) {
  12490. function f() {
  12491. this.constructor = c
  12492. }
  12493. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  12494. f.prototype = d.prototype;
  12495. c.prototype = new f
  12496. };
  12497. (function(c) {
  12498. var d = function(d) {
  12499. function b(a) {
  12500. d.call(this);
  12501. this.size = 2E3;
  12502. this.vertSize = 5;
  12503. this.contextLost = !1;
  12504. this.glContextId = 0;
  12505. this.currentBlendMode = "";
  12506. this.currentBaseTexture = null;
  12507. this.currentBatchSize = 0;
  12508. this.maskList = [];
  12509. this.maskDataFreeList = [];
  12510. this.canvasContext = document.createElement("canvas").getContext("2d");
  12511. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  12512. this.canvas = a || this.createCanvas();
  12513. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  12514. this.canvas.addEventListener("webglcontextrestored",
  12515. this.handleContextRestored.bind(this), !1);
  12516. this.onResize();
  12517. this.projectionX = this.canvas.width / 2;
  12518. this.projectionY = -this.canvas.height / 2;
  12519. a = 6 * this.size;
  12520. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  12521. this.indices = new Uint16Array(a);
  12522. for (var b = 0, l = 0; b < a; b += 6, l += 4) this.indices[b + 0] = l + 0, this.indices[b + 1] = l + 1, this.indices[b + 2] = l + 2, this.indices[b + 3] = l + 0, this.indices[b + 4] = l + 2, this.indices[b + 5] = l + 3;
  12523. this.initWebGL();
  12524. this.shaderManager = new c.WebGLShaderManager(this.gl);
  12525. this.worldTransform = new c.Matrix;
  12526. this.initBlendMode();
  12527. c.MainContext.instance.addEventListener(c.Event.FINISH_RENDER, this._draw, this);
  12528. c.TextField.prototype._draw = function(a) {
  12529. this.getDirty() && (this.cacheAsBitmap = !0);
  12530. c.DisplayObject.prototype._draw.call(this, a)
  12531. }
  12532. }
  12533. __extends(b, d);
  12534. b.prototype.createCanvas = function() {
  12535. var a = c.Browser.getInstance().$("#egretCanvas");
  12536. if (!a) {
  12537. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  12538. a = c.Browser.getInstance().$new("canvas");
  12539. a.id = "egretCanvas";
  12540. b.appendChild(a)
  12541. }
  12542. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE,
  12543. this.onResize, this);
  12544. return a
  12545. };
  12546. b.prototype.onResize = function() {
  12547. if (this.canvas) {
  12548. var a = document.getElementById(c.StageDelegate.canvas_div_name);
  12549. this.canvas.width = c.MainContext.instance.stage.stageWidth;
  12550. this.canvas.height = c.MainContext.instance.stage.stageHeight;
  12551. this.canvas.style.width = a.style.width;
  12552. this.canvas.style.height = a.style.height;
  12553. this.projectionX = this.canvas.width / 2;
  12554. this.projectionY = -this.canvas.height / 2
  12555. }
  12556. };
  12557. b.prototype.handleContextLost = function() {
  12558. this.contextLost = !0
  12559. };
  12560. b.prototype.handleContextRestored =
  12561. function() {
  12562. this.initWebGL();
  12563. this.shaderManager.setContext(this.gl);
  12564. this.contextLost = !1
  12565. };
  12566. b.prototype.initWebGL = function() {
  12567. for (var a = {
  12568. stencil: !0
  12569. }, b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  12570. try {
  12571. b = this.canvas.getContext(c[d], a)
  12572. } catch (f) {}
  12573. if (b) break
  12574. }
  12575. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  12576. this.setContext(b)
  12577. };
  12578. b.prototype.setContext = function(a) {
  12579. this.gl = a;
  12580. a.id = this.glContextId++;
  12581. this.vertexBuffer = a.createBuffer();
  12582. this.indexBuffer = a.createBuffer();
  12583. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  12584. this.indexBuffer);
  12585. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  12586. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  12587. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  12588. a.disable(a.DEPTH_TEST);
  12589. a.disable(a.CULL_FACE);
  12590. a.enable(a.BLEND);
  12591. a.colorMask(!0, !0, !0, !0)
  12592. };
  12593. b.prototype.initBlendMode = function() {
  12594. this.blendModesWebGL = {};
  12595. this.blendModesWebGL[c.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  12596. this.blendModesWebGL[c.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  12597. };
  12598. b.prototype.start =
  12599. function() {
  12600. if (!this.contextLost) {
  12601. var a = this.gl;
  12602. a.activeTexture(a.TEXTURE0);
  12603. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  12604. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  12605. var b;
  12606. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  12607. this.shaderManager.activateShader(b);
  12608. b.syncUniforms();
  12609. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  12610. var c = 4 * this.vertSize;
  12611. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  12612. a.vertexAttribPointer(b.aTextureCoord,
  12613. 2, a.FLOAT, !1, c, 8);
  12614. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  12615. }
  12616. };
  12617. b.prototype.clearScreen = function() {
  12618. var a = this.gl;
  12619. a.colorMask(!0, !0, !0, !0);
  12620. for (var b = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, f = b.length; d < f; d++) {
  12621. var n = b[d];
  12622. a.viewport(n.x, n.y, n.width, n.height);
  12623. a.bindFramebuffer(a.FRAMEBUFFER, null);
  12624. a.clearColor(0, 0, 0, 0);
  12625. a.clear(a.COLOR_BUFFER_BIT)
  12626. }
  12627. b = c.MainContext.instance.stage;
  12628. a.viewport(0, 0, b.stageWidth, b.stageHeight);
  12629. this.renderCost = 0
  12630. };
  12631. b.prototype.setBlendMode = function(a) {
  12632. a ||
  12633. (a = c.BlendMode.NORMAL);
  12634. if (this.currentBlendMode != a) {
  12635. var b = this.blendModesWebGL[a];
  12636. b && (this._draw(), this.gl.blendFunc(b[0], b[1]), this.currentBlendMode = a)
  12637. }
  12638. };
  12639. b.prototype.drawRepeatImage = function(a, b, c, d, f, g, h, m, k, p) {
  12640. for (; g < m; g += d)
  12641. for (p = h; p < k; p += f) {
  12642. var r = Math.min(d, m - g),
  12643. s = Math.min(f, k - p);
  12644. this.drawImage(a, b, c, r, s, g, p, r, s)
  12645. }
  12646. };
  12647. b.prototype.drawImage = function(a, b, d, f, n, g, h, m, k, p) {
  12648. void 0 === p && (p = void 0);
  12649. if (!this.contextLost)
  12650. if (void 0 !== p) this.drawRepeatImage(a, b, d, f, n, g, h, m, k, p);
  12651. else {
  12652. p = c.MainContext.instance.rendererContext.texture_scale_factor;
  12653. b /= p;
  12654. d /= p;
  12655. f /= p;
  12656. n /= p;
  12657. this.createWebGLTexture(a);
  12658. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(), this.currentBaseTexture = a.webGLTexture;
  12659. var r = this.worldTransform,
  12660. s = r.a,
  12661. t = r.b,
  12662. v = r.c,
  12663. x = r.d,
  12664. A = r.tx,
  12665. z = r.ty;
  12666. 0 == g && 0 == h || r.append(1, 0, 0, 1, g, h);
  12667. 1 == f / m && 1 == n / k || r.append(m / f, 0, 0, k / n, 0, 0);
  12668. g = r.a;
  12669. h = r.b;
  12670. m = r.c;
  12671. k = r.d;
  12672. p = r.tx;
  12673. var y = r.ty;
  12674. r.a = s;
  12675. r.b = t;
  12676. r.c = v;
  12677. r.d = x;
  12678. r.tx = A;
  12679. r.ty = z;
  12680. s = a._sourceWidth;
  12681. t = a._sourceHeight;
  12682. a = f;
  12683. r = n;
  12684. b /= s;
  12685. d /= t;
  12686. f /= s;
  12687. n /= t;
  12688. s = this.vertices;
  12689. t = 4 * this.currentBatchSize *
  12690. this.vertSize;
  12691. v = this.worldAlpha;
  12692. s[t++] = p;
  12693. s[t++] = y;
  12694. s[t++] = b;
  12695. s[t++] = d;
  12696. s[t++] = v;
  12697. s[t++] = g * a + p;
  12698. s[t++] = h * a + y;
  12699. s[t++] = f + b;
  12700. s[t++] = d;
  12701. s[t++] = v;
  12702. s[t++] = g * a + m * r + p;
  12703. s[t++] = k * r + h * a + y;
  12704. s[t++] = f + b;
  12705. s[t++] = n + d;
  12706. s[t++] = v;
  12707. s[t++] = m * r + p;
  12708. s[t++] = k * r + y;
  12709. s[t++] = b;
  12710. s[t++] = n + d;
  12711. s[t++] = v;
  12712. this.currentBatchSize++
  12713. }
  12714. };
  12715. b.prototype._draw = function() {
  12716. if (0 != this.currentBatchSize && !this.contextLost) {
  12717. var a = c.getTimer();
  12718. this.start();
  12719. var b = this.gl;
  12720. b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
  12721. var d = this.vertices.subarray(0, 4 * this.currentBatchSize *
  12722. this.vertSize);
  12723. b.bufferSubData(b.ARRAY_BUFFER, 0, d);
  12724. b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
  12725. this.currentBatchSize = 0;
  12726. this.renderCost += c.getTimer() - a;
  12727. c.Profiler.getInstance().onDrawImage()
  12728. }
  12729. };
  12730. b.prototype.setTransform = function(a) {
  12731. var b = this.worldTransform;
  12732. b.a = a.a;
  12733. b.b = a.b;
  12734. b.c = a.c;
  12735. b.d = a.d;
  12736. b.tx = a.tx;
  12737. b.ty = a.ty
  12738. };
  12739. b.prototype.setAlpha = function(a, b) {
  12740. this.worldAlpha = a;
  12741. this.setBlendMode(b)
  12742. };
  12743. b.prototype.createWebGLTexture = function(a) {
  12744. if (!a.webGLTexture) {
  12745. var b = this.gl;
  12746. a.webGLTexture =
  12747. b.createTexture();
  12748. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  12749. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  12750. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  12751. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  12752. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  12753. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  12754. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  12755. b.bindTexture(b.TEXTURE_2D, null)
  12756. }
  12757. };
  12758. b.prototype.pushMask = function(a) {
  12759. this._draw();
  12760. var b = this.gl;
  12761. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  12762. var c = this.maskDataFreeList.pop();
  12763. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  12764. x: a.x,
  12765. y: a.y,
  12766. w: a.width,
  12767. h: a.height
  12768. };
  12769. this.maskList.push(c);
  12770. b.colorMask(!1, !1, !1, !1);
  12771. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  12772. this.renderGraphics(c);
  12773. b.colorMask(!0, !0, !0, !0);
  12774. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  12775. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  12776. };
  12777. b.prototype.popMask = function() {
  12778. this._draw();
  12779. var a = this.gl,
  12780. b = this.maskList.pop();
  12781. b && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(b), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(b));
  12782. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  12783. };
  12784. b.prototype.setGlobalColorTransform = function(a) {
  12785. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  12786. a = a.concat();
  12787. var b = this.shaderManager.colorTransformShader;
  12788. b.uniforms.colorAdd.value.w = a.splice(19,
  12789. 1)[0] / 255;
  12790. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  12791. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  12792. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  12793. b.uniforms.matrix.value = a
  12794. }
  12795. };
  12796. b.prototype.setupFont = function(a, b) {
  12797. var c = this.canvasContext,
  12798. d = a.italic ? "italic " : "normal ",
  12799. d = d + (a.bold ? "bold " : "normal "),
  12800. d = d + (a.size + "px " + a.fontFamily);
  12801. c.font = d;
  12802. c.textAlign = "left";
  12803. c.textBaseline = "middle"
  12804. };
  12805. b.prototype.measureText = function(a) {
  12806. return this.canvasContext.measureText(a).width
  12807. };
  12808. b.prototype.renderGraphics =
  12809. function(a) {
  12810. var b = this.gl,
  12811. c = this.shaderManager.primitiveShader;
  12812. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  12813. this.updateGraphics(a);
  12814. this.shaderManager.activateShader(c);
  12815. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  12816. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  12817. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  12818. b.uniform2f(c.offsetVector, 0, 0);
  12819. b.uniform3fv(c.tintColor, [1, 1, 1]);
  12820. b.uniform1f(c.alpha, this.worldAlpha);
  12821. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  12822. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  12823. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  12824. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  12825. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  12826. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  12827. };
  12828. b.prototype.updateGraphics =
  12829. function(a) {
  12830. var b = this.gl;
  12831. this.buildRectangle(a);
  12832. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  12833. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  12834. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  12835. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  12836. };
  12837. b.prototype.buildRectangle = function(a) {
  12838. var b = a.x,
  12839. c = a.y,
  12840. d = a.w;
  12841. a = a.h;
  12842. var f = this.graphicsPoints,
  12843. g = this.graphicsIndices,
  12844. h = f.length / 6;
  12845. f.push(b, c);
  12846. f.push(0, 0, 0, 1);
  12847. f.push(b + d, c);
  12848. f.push(0, 0, 0, 1);
  12849. f.push(b, c + a);
  12850. f.push(0, 0, 0, 1);
  12851. f.push(b + d, c + a);
  12852. f.push(0, 0, 0, 1);
  12853. g.push(h, h, h + 1, h + 2, h + 3, h + 3)
  12854. };
  12855. return b
  12856. }(c.RendererContext);
  12857. c.WebGLRenderer = d;
  12858. d.prototype.__class__ = "egret.WebGLRenderer"
  12859. })(egret || (egret = {}));
  12860. (function(c) {
  12861. var d = function() {
  12862. function c() {}
  12863. c.compileProgram = function(b, a, d) {
  12864. d = c.compileFragmentShader(b, d);
  12865. a = c.compileVertexShader(b, a);
  12866. var l = b.createProgram();
  12867. b.attachShader(l, a);
  12868. b.attachShader(l, d);
  12869. b.linkProgram(l);
  12870. b.getProgramParameter(l, b.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  12871. return l
  12872. };
  12873. c.compileFragmentShader = function(b, a) {
  12874. return c._compileShader(b, a, b.FRAGMENT_SHADER)
  12875. };
  12876. c.compileVertexShader = function(b, a) {
  12877. return c._compileShader(b, a, b.VERTEX_SHADER)
  12878. };
  12879. c._compileShader =
  12880. function(b, a, c) {
  12881. c = b.createShader(c);
  12882. b.shaderSource(c, a);
  12883. b.compileShader(c);
  12884. return b.getShaderParameter(c, b.COMPILE_STATUS) ? c : (console.log(b.getShaderInfoLog(c)), null)
  12885. };
  12886. c.checkCanUseWebGL = function() {
  12887. if (void 0 == c.canUseWebGL) try {
  12888. var b = document.createElement("canvas");
  12889. c.canUseWebGL = !!window.WebGLRenderingContext && !(!b.getContext("webgl") && !b.getContext("experimental-webgl"))
  12890. } catch (a) {
  12891. c.canUseWebGL = !1
  12892. }
  12893. return c.canUseWebGL
  12894. };
  12895. return c
  12896. }();
  12897. c.WebGLUtils = d;
  12898. d.prototype.__class__ = "egret.WebGLUtils"
  12899. })(egret || (egret = {}));
  12900. __extends = this.__extends || function(c, d) {
  12901. function f() {
  12902. this.constructor = c
  12903. }
  12904. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  12905. f.prototype = d.prototype;
  12906. c.prototype = new f
  12907. };
  12908. (function(c) {
  12909. var d = function() {
  12910. function c(a) {
  12911. this.maxAttibs = 10;
  12912. this.attribState = [];
  12913. this.tempAttribState = [];
  12914. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  12915. this.setContext(a)
  12916. }
  12917. c.prototype.setContext = function(c) {
  12918. this.gl = c;
  12919. this.primitiveShader = new a(c);
  12920. this.defaultShader = new f(c);
  12921. this.colorTransformShader = new b(c);
  12922. this.activateShader(this.defaultShader)
  12923. };
  12924. c.prototype.activateShader = function(a) {
  12925. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  12926. a)
  12927. };
  12928. c.prototype.setAttribs = function(a) {
  12929. var b, c;
  12930. c = this.tempAttribState.length;
  12931. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  12932. c = a.length;
  12933. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  12934. a = this.gl;
  12935. c = this.attribState.length;
  12936. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  12937. };
  12938. return c
  12939. }();
  12940. c.WebGLShaderManager = d;
  12941. d.prototype.__class__ = "egret.WebGLShaderManager";
  12942. var f = function() {
  12943. function a(b) {
  12944. this.defaultVertexSrc =
  12945. "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}";
  12946. this.program = null;
  12947. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  12948. this.gl = b;
  12949. this.init()
  12950. }
  12951. a.prototype.init = function() {
  12952. var a = this.gl,
  12953. b = c.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  12954. a.useProgram(b);
  12955. this.uSampler = a.getUniformLocation(b, "uSampler");
  12956. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  12957. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  12958. this.dimensions = a.getUniformLocation(b, "dimensions");
  12959. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  12960. this.aTextureCoord = a.getAttribLocation(b, "aTextureCoord");
  12961. this.colorAttribute =
  12962. a.getAttribLocation(b, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  12963. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  12964. for (var d in this.uniforms) this.uniforms[d].uniformLocation = a.getUniformLocation(b, d);
  12965. this.initUniforms();
  12966. this.program = b
  12967. };
  12968. a.prototype.initUniforms = function() {
  12969. if (this.uniforms) {
  12970. var a = this.gl,
  12971. b, c;
  12972. for (c in this.uniforms) {
  12973. b = this.uniforms[c];
  12974. var d = b.type;
  12975. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv :
  12976. "mat3" === d ? b.glFunc = a.uniformMatrix3fv : "mat4" === d && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + d], b.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  12977. }
  12978. }
  12979. };
  12980. a.prototype.syncUniforms = function() {
  12981. if (this.uniforms) {
  12982. var a, b = this.gl,
  12983. c;
  12984. for (c in this.uniforms) a = this.uniforms[c], 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x,
  12985. a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  12986. }
  12987. };
  12988. return a
  12989. }();
  12990. c.EgretShader = f;
  12991. f.prototype.__class__ = "egret.EgretShader";
  12992. var b = function(a) {
  12993. function b(c) {
  12994. a.call(this, c);
  12995. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  12996. this.uniforms = {
  12997. matrix: {
  12998. type: "mat4",
  12999. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  13000. },
  13001. colorAdd: {
  13002. type: "4f",
  13003. value: {
  13004. x: 0,
  13005. y: 0,
  13006. z: 0,
  13007. w: 0
  13008. }
  13009. }
  13010. };
  13011. this.init()
  13012. }
  13013. __extends(b, a);
  13014. return b
  13015. }(f);
  13016. c.ColorTransformShader = b;
  13017. b.prototype.__class__ = "egret.ColorTransformShader";
  13018. var a = function() {
  13019. function a(b) {
  13020. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  13021. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  13022. 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}";
  13023. this.gl = b;
  13024. this.init()
  13025. }
  13026. a.prototype.init = function() {
  13027. var a = this.gl,
  13028. b = c.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  13029. a.useProgram(b);
  13030. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  13031. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  13032. this.tintColor = a.getUniformLocation(b, "tint");
  13033. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  13034. this.colorAttribute = a.getAttribLocation(b, "aColor");
  13035. this.attributes = [this.aVertexPosition, this.colorAttribute];
  13036. this.translationMatrix = a.getUniformLocation(b,
  13037. "translationMatrix");
  13038. this.alpha = a.getUniformLocation(b, "alpha");
  13039. this.program = b
  13040. };
  13041. return a
  13042. }();
  13043. c.PrimitiveShader = a;
  13044. a.prototype.__class__ = "egret.PrimitiveShader"
  13045. })(egret || (egret = {}));
  13046. __extends = this.__extends || function(c, d) {
  13047. function f() {
  13048. this.constructor = c
  13049. }
  13050. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13051. f.prototype = d.prototype;
  13052. c.prototype = new f
  13053. };
  13054. (function(c) {
  13055. var d = function(d) {
  13056. function b() {
  13057. d.call(this)
  13058. }
  13059. __extends(b, d);
  13060. b.prototype.proceed = function(a) {
  13061. function b() {
  13062. if (4 == f.readyState)
  13063. if (f.status != a._status && (a._status = f.status, c.HTTPStatusEvent.dispatchHTTPStatusEvent(a, f.status)), 400 <= f.status || 0 == f.status) c.IOErrorEvent.dispatchIOErrorEvent(a);
  13064. else {
  13065. switch (a.dataFormat) {
  13066. case c.URLLoaderDataFormat.TEXT:
  13067. a.data = f.responseText;
  13068. break;
  13069. case c.URLLoaderDataFormat.VARIABLES:
  13070. a.data = new c.URLVariables(f.responseText);
  13071. break;
  13072. case c.URLLoaderDataFormat.BINARY:
  13073. a.data =
  13074. f.response;
  13075. break;
  13076. default:
  13077. a.data = f.responseText
  13078. }
  13079. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  13080. }
  13081. }
  13082. if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  13083. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  13084. else {
  13085. var d = a._request,
  13086. f = this.getXHR();
  13087. f.onreadystatechange = b;
  13088. var n = c.NetContext._getUrl(d);
  13089. f.open(d.method, n, !0);
  13090. this.setResponseType(f, a.dataFormat);
  13091. d.method != c.URLRequestMethod.GET && d.data ? d.data instanceof c.URLVariables ? (f.setRequestHeader("Content-Type",
  13092. "application/x-www-form-urlencoded"), f.send(d.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(d.data)) : f.send()
  13093. }
  13094. };
  13095. b.prototype.loadSound = function(a) {
  13096. function b(n) {
  13097. window.clearTimeout(f.__timeoutId);
  13098. f.removeEventListener("canplaythrough", b, !1);
  13099. f.removeEventListener("error", d, !1);
  13100. n = new c.Sound;
  13101. n._setAudio(f);
  13102. a.data = n;
  13103. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  13104. }
  13105. function d(n) {
  13106. window.clearTimeout(f.__timeoutId);
  13107. f.removeEventListener("canplaythrough",
  13108. b, !1);
  13109. f.removeEventListener("error", d, !1);
  13110. c.IOErrorEvent.dispatchIOErrorEvent(a)
  13111. }
  13112. var f = new Audio(a._request.url);
  13113. f.__timeoutId = window.setTimeout(b, 100);
  13114. f.addEventListener("canplaythrough", b, !1);
  13115. f.addEventListener("error", d, !1);
  13116. f.load()
  13117. };
  13118. b.prototype.getXHR = function() {
  13119. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  13120. };
  13121. b.prototype.setResponseType = function(a, b) {
  13122. switch (b) {
  13123. case c.URLLoaderDataFormat.TEXT:
  13124. case c.URLLoaderDataFormat.VARIABLES:
  13125. a.responseType = c.URLLoaderDataFormat.TEXT;
  13126. break;
  13127. case c.URLLoaderDataFormat.BINARY:
  13128. a.responseType = "arraybuffer";
  13129. break;
  13130. default:
  13131. a.responseType = b
  13132. }
  13133. };
  13134. b.prototype.loadTexture = function(a) {
  13135. var b = a._request,
  13136. d = new Image;
  13137. d.onload = function(b) {
  13138. d.onerror = null;
  13139. d.onload = null;
  13140. b = new c.Texture;
  13141. b._setBitmapData(d);
  13142. a.data = b;
  13143. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  13144. };
  13145. d.onerror = function(b) {
  13146. d.onerror = null;
  13147. d.onload = null;
  13148. c.IOErrorEvent.dispatchIOErrorEvent(a)
  13149. };
  13150. d.src = b.url
  13151. };
  13152. return b
  13153. }(c.NetContext);
  13154. c.HTML5NetContext = d;
  13155. d.prototype.__class__ = "egret.HTML5NetContext"
  13156. })(egret ||
  13157. (egret = {}));
  13158. __extends = this.__extends || function(c, d) {
  13159. function f() {
  13160. this.constructor = c
  13161. }
  13162. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13163. f.prototype = d.prototype;
  13164. c.prototype = new f
  13165. };
  13166. (function(c) {
  13167. var d = function(d) {
  13168. function b() {
  13169. d.call(this);
  13170. this._isTouchDown = !1;
  13171. this.rootDiv = document.getElementById(c.StageDelegate.canvas_div_name)
  13172. }
  13173. __extends(b, d);
  13174. b.prototype.prevent = function(a) {
  13175. a.stopPropagation();
  13176. !0 != a.isScroll && a.preventDefault()
  13177. };
  13178. b.prototype.run = function() {
  13179. var a = this;
  13180. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  13181. a._onTouchBegin(b);
  13182. a.prevent(b)
  13183. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  13184. a._onTouchMove(b);
  13185. a.prevent(b)
  13186. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  13187. a._onTouchEnd(b);
  13188. a.prevent(b)
  13189. }, !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  13190. window.addEventListener("mousedown", function(b) {
  13191. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  13192. });
  13193. window.addEventListener("mouseup", function(b) {
  13194. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  13195. a._isTouchDown = !1
  13196. })
  13197. };
  13198. b.prototype.addMouseListener = function() {
  13199. var a = this;
  13200. this.rootDiv.addEventListener("mousedown", function(b) {
  13201. a._onTouchBegin(b)
  13202. });
  13203. this.rootDiv.addEventListener("mousemove", function(b) {
  13204. a._onTouchMove(b)
  13205. });
  13206. this.rootDiv.addEventListener("mouseup", function(b) {
  13207. a._onTouchEnd(b)
  13208. })
  13209. };
  13210. b.prototype.addTouchListener = function() {
  13211. var a = this;
  13212. this.rootDiv.addEventListener("touchstart", function(b) {
  13213. for (var c = b.changedTouches.length, d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  13214. a.prevent(b)
  13215. }, !1);
  13216. this.rootDiv.addEventListener("touchmove",
  13217. function(b) {
  13218. for (var c = b.changedTouches.length, d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  13219. a.prevent(b)
  13220. }, !1);
  13221. this.rootDiv.addEventListener("touchend", function(b) {
  13222. for (var c = b.changedTouches.length, d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  13223. a.prevent(b)
  13224. }, !1);
  13225. this.rootDiv.addEventListener("touchcancel", function(b) {
  13226. for (var c = b.changedTouches.length, d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  13227. a.prevent(b)
  13228. }, !1)
  13229. };
  13230. b.prototype.inOutOfCanvas = function(a) {
  13231. var b = this.getLocation(this.rootDiv, a);
  13232. a = b.x;
  13233. var b = b.y,
  13234. d = c.MainContext.instance.stage;
  13235. return 0 > a || 0 > b || a > d.stageWidth || b > d.stageHeight ? !0 : !1
  13236. };
  13237. b.prototype.dispatchLeaveStageEvent = function() {
  13238. this.touchingIdentifiers.length = 0;
  13239. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  13240. };
  13241. b.prototype._onTouchBegin = function(a) {
  13242. var b = this.getLocation(this.rootDiv, a),
  13243. c = -1;
  13244. a.hasOwnProperty("identifier") && (c = a.identifier);
  13245. this.onTouchBegan(b.x, b.y, c)
  13246. };
  13247. b.prototype._onTouchMove = function(a) {
  13248. var b = this.getLocation(this.rootDiv, a),
  13249. c = -1;
  13250. a.hasOwnProperty("identifier") &&
  13251. (c = a.identifier);
  13252. this.onTouchMove(b.x, b.y, c)
  13253. };
  13254. b.prototype._onTouchEnd = function(a) {
  13255. var b = this.getLocation(this.rootDiv, a),
  13256. c = -1;
  13257. a.hasOwnProperty("identifier") && (c = a.identifier);
  13258. this.onTouchEnd(b.x, b.y, c)
  13259. };
  13260. b.prototype.getLocation = function(a, b) {
  13261. var d = document.documentElement,
  13262. f = window,
  13263. n, g;
  13264. "function" === typeof a.getBoundingClientRect ? (g = a.getBoundingClientRect(), n = g.left, g = g.top) : g = n = 0;
  13265. n += f.pageXOffset - d.clientLeft;
  13266. g += f.pageYOffset - d.clientTop;
  13267. null != b.pageX ? (d = b.pageX, f = b.pageY) : (n -= document.body.scrollLeft,
  13268. g -= document.body.scrollTop, d = b.clientX, f = b.clientY);
  13269. var h = c.Point.identity;
  13270. h.x = (d - n) / c.StageDelegate.getInstance().getScaleX();
  13271. h.y = (f - g) / c.StageDelegate.getInstance().getScaleY();
  13272. return h
  13273. };
  13274. return b
  13275. }(c.TouchContext);
  13276. c.HTML5TouchContext = d;
  13277. d.prototype.__class__ = "egret.HTML5TouchContext"
  13278. })(egret || (egret = {}));
  13279. __extends = this.__extends || function(c, d) {
  13280. function f() {
  13281. this.constructor = c
  13282. }
  13283. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13284. f.prototype = d.prototype;
  13285. c.prototype = new f
  13286. };
  13287. (function(c) {
  13288. var d = function(d) {
  13289. function b() {
  13290. d.call(this);
  13291. this._hasListeners = !1;
  13292. this._inputType = "";
  13293. this._isShow = !1;
  13294. this.textValue = "";
  13295. this._height = this._width = 0;
  13296. this._styleInfoes = {};
  13297. var a = c.StageDelegate.getInstance().getScaleX(),
  13298. b = c.StageDelegate.getInstance().getScaleY(),
  13299. l = c.Browser.getInstance().$new("div");
  13300. l.position.x = 0;
  13301. l.position.y = 0;
  13302. l.scale.x = a;
  13303. l.scale.y = b;
  13304. l.transforms();
  13305. l.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  13306. this.div = l;
  13307. b = c.MainContext.instance.stage;
  13308. a = b.stageWidth;
  13309. b = b.stageHeight;
  13310. l = new c.Shape;
  13311. l.width = a;
  13312. l.height = b;
  13313. l.touchEnabled = !0;
  13314. this._shape = l;
  13315. this.getStageDelegateDiv().appendChild(this.div)
  13316. }
  13317. __extends(b, d);
  13318. b.prototype.getStageDelegateDiv = function() {
  13319. var a = c.Browser.getInstance().$("#StageDelegateDiv");
  13320. a || (a = c.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  13321. return a
  13322. };
  13323. b.prototype._setMultiline = function(a) {
  13324. d.prototype._setMultiline.call(this, a);
  13325. this.createInput()
  13326. };
  13327. b.prototype.callHandler =
  13328. function(a) {
  13329. a.stopPropagation()
  13330. };
  13331. b.prototype._add = function() {
  13332. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  13333. };
  13334. b.prototype._remove = function() {
  13335. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  13336. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  13337. };
  13338. b.prototype._addListeners = function() {
  13339. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  13340. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  13341. };
  13342. b.prototype._removeListeners = function() {
  13343. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  13344. };
  13345. b.prototype.createInput = function() {
  13346. var a = this._multiline ? "textarea" : "input";
  13347. this._inputType != a && (this._inputType =
  13348. a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign",
  13349. "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  13350. };
  13351. b.prototype._open = function(a, b, c, d) {};
  13352. b.prototype._setScale = function(a, b) {
  13353. d.prototype._setScale.call(this, a, b);
  13354. var l = c.StageDelegate.getInstance().getScaleX(),
  13355. q = c.StageDelegate.getInstance().getScaleY();
  13356. this.div.scale.x = l * a;
  13357. this.div.scale.y = q * b;
  13358. this.div.transforms()
  13359. };
  13360. b.prototype.changePosition = function(a, b) {
  13361. var d = c.StageDelegate.getInstance().getScaleX(),
  13362. f = c.StageDelegate.getInstance().getScaleY();
  13363. this.div.position.x =
  13364. a * d;
  13365. this.div.position.y = b * f;
  13366. this.div.transforms()
  13367. };
  13368. b.prototype.setStyles = function() {
  13369. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  13370. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  13371. this.setElementStyle("textAlign", this._textAlign);
  13372. this.setElementStyle("fontSize", this._size + "px");
  13373. this.setElementStyle("color", "#000000");
  13374. this.setElementStyle("width", this._width + "px");
  13375. this.setElementStyle("height", this._height + "px");
  13376. this.setElementStyle("border", "1px solid red");
  13377. this.setElementStyle("display",
  13378. "block")
  13379. };
  13380. b.prototype._show = function() {
  13381. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  13382. this._isShow = !0;
  13383. var a = this._getText();
  13384. this.inputElement.value = a;
  13385. var b = this;
  13386. this.inputElement.oninput = function() {
  13387. b.textValue = b.inputElement.value;
  13388. b.dispatchEvent(new c.Event("updateText"))
  13389. };
  13390. this.setStyles();
  13391. this.inputElement.focus();
  13392. this.inputElement.selectionStart = a.length;
  13393. this.inputElement.selectionEnd = a.length;
  13394. this._shape && null == this._shape.parent &&
  13395. c.MainContext.instance.stage.addChild(this._shape)
  13396. };
  13397. b.prototype._hide = function() {
  13398. if (null != this.inputElement) {
  13399. this._isShow = !1;
  13400. this.inputElement.oninput = function() {};
  13401. this.setElementStyle("border", "none");
  13402. this.setElementStyle("display", "none");
  13403. this.inputElement.value = "";
  13404. this.setElementStyle("width", "0px");
  13405. window.scrollTo(0, 0);
  13406. var a = this;
  13407. c.setTimeout(function() {
  13408. a.inputElement.blur();
  13409. window.scrollTo(0, 0)
  13410. }, this, 50);
  13411. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  13412. }
  13413. };
  13414. b.prototype._getText =
  13415. function() {
  13416. this.textValue || (this.textValue = "");
  13417. return this.textValue
  13418. };
  13419. b.prototype._setText = function(a) {
  13420. this.textValue = a;
  13421. this.resetText()
  13422. };
  13423. b.prototype.resetText = function() {
  13424. this.inputElement && (this.inputElement.value = this.textValue)
  13425. };
  13426. b.prototype._setWidth = function(a) {
  13427. this._width = a
  13428. };
  13429. b.prototype._setHeight = function(a) {
  13430. this._height = a
  13431. };
  13432. b.prototype.setElementStyle = function(a, b) {
  13433. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  13434. };
  13435. return b
  13436. }(c.StageText);
  13437. c.HTML5StageText =
  13438. d;
  13439. d.prototype.__class__ = "egret.HTML5StageText"
  13440. })(egret || (egret = {}));
  13441. egret.StageText.create = function() {
  13442. return new egret.HTML5StageText
  13443. };
  13444. var GameUtils = function() {
  13445. function c() {}
  13446. c.createBitmapByName = function(c) {
  13447. var f = new egret.Bitmap;
  13448. c = RES.getRes(c);
  13449. f.texture = c;
  13450. return f
  13451. };
  13452. c.createBitmapFromSheet = function(c, f) {
  13453. void 0 === f && (f = "gameRes");
  13454. var b = RES.getRes(f).getTexture(c),
  13455. a = new egret.Bitmap;
  13456. a.texture = b;
  13457. return a
  13458. };
  13459. c.getTextureFromSheet = function(c, f) {
  13460. void 0 === f && (f = "gameRes");
  13461. return RES.getRes(f).getTexture(c)
  13462. };
  13463. c.removeChild = function(c) {
  13464. c && c.parent && (c.parent.removeElement ? c.parent.removeElement(c) : c.parent.removeChild(c))
  13465. };
  13466. c.addUI = function(c) {
  13467. c &&
  13468. !c.parent && GameApp.uiStage.addElement(c)
  13469. };
  13470. c.removeUI = function(c) {
  13471. c && c.parent && GameApp.uiStage.removeElement(c)
  13472. };
  13473. c.removeStarlingSwfUI = function(d) {
  13474. c.removeChild(d)
  13475. };
  13476. c.getUrl = function(c) {
  13477. return "" != c ? c : ""
  13478. };
  13479. c.addTouchTapListener = function(c, f, b) {
  13480. var a = -1,
  13481. e = -1;
  13482. c.touchEnabled = !0;
  13483. c.addEventListener(egret.TouchEvent.TOUCH_BEGIN, function(b) {
  13484. a = b.stageX;
  13485. e = b.stageY
  13486. }, c);
  13487. c.addEventListener(egret.TouchEvent.TOUCH_END, function(c) {
  13488. 10 > Math.abs(a - c.stageX) && 10 > Math.abs(e - c.stageY) && f.call(b);
  13489. e = a = -1
  13490. }, c)
  13491. };
  13492. c.fixNumber =
  13493. function(c) {
  13494. var f = "";
  13495. 1E4 < c ? (c = Math.floor(c / 1E4), f = c.toString() + "w") : f = c.toString();
  13496. return f
  13497. };
  13498. c.lock = function(c) {
  13499. c = egret.MainContext.instance.stage;
  13500. c.touchEnabled = c.touchChildren = !1
  13501. };
  13502. c.unlock = function(c) {
  13503. c = egret.MainContext.instance.stage;
  13504. c.touchEnabled = c.touchChildren = !0
  13505. };
  13506. c.replaceTextureByUrl = function(c, f) {
  13507. RES.getResByUrl(c, function(b) {
  13508. f.texture = b
  13509. }, this, RES.ResourceItem.TYPE_IMAGE)
  13510. };
  13511. c.getIsTodayFirstIn = function() {
  13512. var c = new Date,
  13513. f = window.localStorage.getItem("LoginDate");
  13514. if (null == f) return f = c.getMonth().toString() +
  13515. c.getDay().toString(), window.localStorage.setItem("LoginDate", f), !0;
  13516. c = c.getMonth().toString() + c.getDay().toString();
  13517. window.localStorage.setItem("LoginDate", c);
  13518. return c != f
  13519. };
  13520. return c
  13521. }();
  13522. GameUtils.prototype.__class__ = "GameUtils";
  13523. var __extends = this.__extends || function(c, d) {
  13524. function f() {
  13525. this.constructor = c
  13526. }
  13527. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13528. f.prototype = d.prototype;
  13529. c.prototype = new f
  13530. },
  13531. Role = function(c) {
  13532. function d() {
  13533. c.call(this);
  13534. this.body = new egret.Bitmap;
  13535. this.body.anchorX = 0.5;
  13536. this.addChild(this.body)
  13537. }
  13538. __extends(d, c);
  13539. d.prototype.setState = function(c) {
  13540. this.state = c;
  13541. this.state == d.STATE5 ? (this.isLoop = !1, this.body.anchorY = 0) : (this.isLoop = !0, this.body.anchorY = 1);
  13542. this.state == d.STATE3 || this.state == d.STATE4 ? (this.currFrames = [],
  13543. 0.5 < Math.random() ? this.currFrames.push(d.FRAMES[this.state][0]) : this.currFrames.push(d.FRAMES[this.state][1])) : this.currFrames = d.FRAMES[this.state];
  13544. this.currFrameIndex = 0;
  13545. this.setBody()
  13546. };
  13547. d.prototype.setBody = function() {
  13548. this.body.texture = GameUtils.getTextureFromSheet(this.currFrames[this.currFrameIndex], "roleRes")
  13549. };
  13550. d.prototype.run = function() {
  13551. this.runFlag++;
  13552. 4 < this.runFlag && (this.runFlag = 0);
  13553. if (0 == this.runFlag) {
  13554. var c = this.currFrameIndex + 1;
  13555. c == this.currFrames.length && (c = this.isLoop ? 0 : this.currFrameIndex);
  13556. c != this.currFrameIndex && (this.currFrameIndex = c, this.setBody())
  13557. }
  13558. };
  13559. d.prototype.play = function() {
  13560. egret.Ticker.getInstance().register(this.run, this);
  13561. this.runFlag = 0
  13562. };
  13563. d.prototype.stop = function() {
  13564. egret.Ticker.getInstance().unregister(this.run, this)
  13565. };
  13566. d.STATE1 = 0;
  13567. d.STATE2 = 1;
  13568. d.STATE3 = 2;
  13569. d.STATE4 = 3;
  13570. d.STATE5 = 4;
  13571. d.FRAMES = [
  13572. ["0020003", "0020004", "0020005", "0020006", "0020007"],
  13573. ["0020008"],
  13574. ["0020009", "0020010"],
  13575. ["0020011", "0020012"],
  13576. ["xue0001", "xue0002", "xue0003", "xue0004", "xue0005"]
  13577. ];
  13578. return d
  13579. }(egret.Sprite);
  13580. Role.prototype.__class__ = "Role";
  13581. var Shake = function() {
  13582. function c() {}
  13583. c.prototype.run = function(c, f, b) {
  13584. void 0 === b && (b = null);
  13585. this.obj = c;
  13586. this.initY = c.y;
  13587. this.shakeNum = f;
  13588. this.overFunc = b;
  13589. egret.Ticker.getInstance().register(this.loop, this);
  13590. this.flag = this.num = 0
  13591. };
  13592. c.prototype.loop = function() {
  13593. 0 == this.flag && (this.obj.y = this.obj.y <= this.initY ? this.obj.y + 5 : this.obj.y - 5, this.obj.y == this.initY && (this.num++, this.num == this.shakeNum && (egret.Ticker.getInstance().unregister(this.loop, this), this.overFunc && this.overFunc())));
  13594. this.flag++;
  13595. 2 == this.flag && (this.flag =
  13596. 0)
  13597. };
  13598. return c
  13599. }();
  13600. Shake.prototype.__class__ = "Shake";
  13601. var __extends = this.__extends || function(c, d) {
  13602. function f() {
  13603. this.constructor = c
  13604. }
  13605. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13606. f.prototype = d.prototype;
  13607. c.prototype = new f
  13608. },
  13609. GameOverLayer = function(c) {
  13610. function d() {
  13611. c.call(this);
  13612. this.init()
  13613. }
  13614. __extends(d, c);
  13615. d.prototype.init = function() {
  13616. this.gameoverbg1 = GameUtils.createBitmapFromSheet("bg_wenzi");
  13617. this.gameoverbg1.x = 76;
  13618. this.gameoverbg1.y = 0;
  13619. this.addChild(this.gameoverbg1);
  13620. this.shibaibg = GameUtils.createBitmapFromSheet("shibai");
  13621. this.shibaibg.x = 140;
  13622. this.shibaibg.y =
  13623. 84;
  13624. this.addChild(this.shibaibg);
  13625. this.maxScoreIm = GameUtils.createBitmapFromSheet("zuigaojilu");
  13626. this.maxScoreIm.x = 278;
  13627. this.maxScoreIm.y = 248;
  13628. this.addChild(this.maxScoreIm);
  13629. this.currScoreIm = GameUtils.createBitmapFromSheet("fenshu");
  13630. this.currScoreIm.x = 108;
  13631. this.currScoreIm.y = 248;
  13632. this.addChild(this.currScoreIm);
  13633. this.tryBtn = new MyButton("btn_y", "btn_zaiwan");
  13634. this.tryBtn.x = 131;
  13635. this.tryBtn.y = 371;
  13636. this.tryBtn.setClick(this.onTryGameClick);
  13637. this.addChild(this.tryBtn);
  13638. this.strutBtn = new MyButton("btn_b", "btn_gengduo");
  13639. this.strutBtn.x = 131;
  13640. this.strutBtn.y = 481;
  13641. this.addChild(this.strutBtn);
  13642. this.strutBtn.setClick(this.onStrutGameClik.bind(this));
  13643. this.scoreNum = new SpecialNumber;
  13644. this.scoreNum.x = 135;
  13645. this.scoreNum.y = 283;
  13646. this.addChild(this.scoreNum);
  13647. this.recordNum = new SpecialNumber;
  13648. this.recordNum.x = 327;
  13649. this.recordNum.y = 283;
  13650. this.addChild(this.recordNum)
  13651. };
  13652. d.prototype.setGameOverDataHandler = function(c, b) {
  13653. void 0 === c && (c = 20);
  13654. void 0 === b && (b = 57);
  13655. this.scoreNum.setData(c.toString());
  13656. this.recordNum.setData(b.toString());
  13657. // EgretShare.setShareContent("\u5f97\u4e86" + c + "\u5206\uff01\u624b\u5fc3\u5168\u662f\u6c57\uff01\u8fd9\u6e38\u620f\u5b9e\u5728TM\u592a\u60ca\u9669\u4e86\uff01\u8c01\u6562\u6765\u6311\u6218\uff1f")
  13658. };
  13659. d.prototype.onTryGameClick = function() {
  13660. GameControl.getInstance().onGameSceneHandler()
  13661. };
  13662. d.prototype.onStrutGameClik = function() {
  13663. console.log("\u70ab\u8000\u4e0b~");
  13664. //Play68.goHome();
  13665. // EgretShare.share()
  13666. };
  13667. d.prototype.onStageTouch = function() {
  13668. var c = this.stage;
  13669. c.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,
  13670. this.onStageTouch, this);
  13671. c.touchChildren = !0;
  13672. c.removeChild(this.weixinContainer)
  13673. };
  13674. return d
  13675. }(egret.Sprite);
  13676. GameOverLayer.prototype.__class__ = "GameOverLayer";
  13677. var __extends = this.__extends || function(c, d) {
  13678. function f() {
  13679. this.constructor = c
  13680. }
  13681. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13682. f.prototype = d.prototype;
  13683. c.prototype = new f
  13684. },
  13685. GameSceneLayer = function(c) {
  13686. function d() {
  13687. c.call(this);
  13688. this.spaceArr = [50, 70, 90, 110];
  13689. this.initUI()
  13690. }
  13691. __extends(d, c);
  13692. d.prototype.initUI = function() {
  13693. this.shake1 = new Shake;
  13694. this.shake2 = new Shake;
  13695. this.bg = RES.getRes("bg_qiang");
  13696. var c = new egret.Bitmap(this.bg);
  13697. c.mask = new egret.Rectangle(0, Consts.GAME_HEIGHT, Consts.GAME_WIDTH, 300);
  13698. this.addChild(c);
  13699. this.bgBitmaps = [];
  13700. this.topContianer = new egret.Sprite;
  13701. this.addChild(this.topContianer);
  13702. this.topSptite = new egret.Sprite;
  13703. this.topContianer.addChild(this.topSptite);
  13704. this.topLine = new egret.Shape;
  13705. this.topContianer.addChild(this.topLine);
  13706. this.bottomContianer = new egret.Sprite;
  13707. this.addChild(this.bottomContianer);
  13708. this.bottomSptite = new egret.Sprite;
  13709. this.bottomContianer.addChild(this.bottomSptite);
  13710. this.bottomLine = new egret.Shape;
  13711. this.bottomContianer.addChild(this.bottomLine);
  13712. this.topRects = [];
  13713. this.bottomRects =
  13714. [];
  13715. this.titleImg = GameUtils.createBitmapFromSheet("bg_shangkuang");
  13716. this.addChild(this.titleImg);
  13717. this.scoreKuang = GameUtils.createBitmapFromSheet("kuang");
  13718. this.scoreKuang.x = 5;
  13719. this.addChild(this.scoreKuang);
  13720. this.lvKuang = GameUtils.createBitmapFromSheet("kuang");
  13721. this.lvKuang.scaleX = -1;
  13722. this.lvKuang.x = 466;
  13723. this.addChild(this.lvKuang);
  13724. this.maxScore = GameUtils.createBitmapFromSheet("fenshu");
  13725. this.maxScore.x = 40;
  13726. this.maxScore.y = 15;
  13727. this.addChild(this.maxScore);
  13728. this.currLv = GameUtils.createBitmapFromSheet("guanqia");
  13729. this.currLv.x = 368;
  13730. this.currLv.y = 15;
  13731. this.addChild(this.currLv);
  13732. this.lvNum = new SpecialNumber;
  13733. this.lvNum.x = 393;
  13734. this.lvNum.y = 50;
  13735. this.addChild(this.lvNum);
  13736. this.recordNum = new SpecialNumber;
  13737. this.recordNum.x = 73;
  13738. this.recordNum.y = 50;
  13739. this.addChild(this.recordNum);
  13740. this.currLevel = 1;
  13741. this.currMaxScore = 0;
  13742. this.lvNum.setData(this.currLevel.toString());
  13743. this.recordNum.setData(this.currMaxScore.toString());
  13744. this.role = new Role;
  13745. this.addChild(this.role);
  13746. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAdd, this)
  13747. };
  13748. d.prototype.onAdd =
  13749. function() {
  13750. this.score = this.dieNum = 0;
  13751. this.currLevel = 1;
  13752. this.refreshScore();
  13753. this.initData();
  13754. egret.setTimeout(this.start, this, 100)
  13755. };
  13756. d.prototype.refreshScore = function() {
  13757. this.lvNum.setData(this.currLevel.toString());
  13758. this.recordNum.setData(this.score.toString())
  13759. };
  13760. d.prototype.refurbish = function() {
  13761. this.initData();
  13762. this.start()
  13763. };
  13764. d.prototype.start = function() {
  13765. this.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
  13766. egret.setTimeout(this.shakeRun, this, 1E3)
  13767. };
  13768. d.prototype.shakeRun = function() {
  13769. this.shake1.run(this.topContianer,
  13770. 5, this.land.bind(this))
  13771. };
  13772. d.prototype.land = function() {
  13773. this.stage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
  13774. egret.Tween.get(this.topContianer).to({
  13775. y: 0
  13776. }, 100).call(function() {
  13777. this.landOver()
  13778. }.bind(this))
  13779. };
  13780. d.prototype.landOver = function() {
  13781. this.checkState();
  13782. this.shake1.run(this.topContianer, 3);
  13783. this.shake2.run(this.bottomContianer, 3, this.checkResult.bind(this))
  13784. };
  13785. d.prototype.checkState = function() {
  13786. var c = this.getSpace();
  13787. 0 == c ? this.role.setState(Role.STATE5) : c == this.spaceArr[2] ? this.role.setState(Role.STATE4) :
  13788. c == this.spaceArr[0] ? this.role.setState(Role.STATE3) : c == this.spaceArr[1] && this.role.setState(Role.STATE2);
  13789. 0 == c && this.setRolePos(this.rolePosIndex, -10, 4)
  13790. };
  13791. d.prototype.checkResult = function() {
  13792. var c = this;
  13793. if (0 == this.getSpace()) {
  13794. if (this.dieNum++, 1 == this.dieNum) {
  13795. this.role.stop();
  13796. egret.setTimeout(function() {
  13797. GameControl.getInstance().showGameOverSceneHandler();
  13798. //updateShare(this.score);
  13799. //Play68.setRankingScoreDesc(this.score);
  13800. GameControl.getInstance().getGameOverDisplay().setGameOverDataHandler(c.score, c.currMaxScore)
  13801. }, this, 1E3);
  13802. return
  13803. }
  13804. } else this.currLevel++, this.score += 10,
  13805. this.score > this.currMaxScore && (this.currMaxScore = this.score), this.refreshScore();
  13806. egret.setTimeout(this.refurbish, this, 1E3)
  13807. };
  13808. d.prototype.getSpace = function() {
  13809. return Consts.GAME_HEIGHT - this.topRects[this.rolePosIndex].height - this.bottomRects[this.rolePosIndex].height
  13810. };
  13811. d.prototype.onClick = function(c) {
  13812. var b = 0,
  13813. a = this.bottomRects.length;
  13814. for (b; b < a; b++) {
  13815. var d = this.bottomRects[b];
  13816. if (c.stageX > d.x && c.stageX < d.x + d.width) {
  13817. this.setRolePos(b);
  13818. break
  13819. }
  13820. }
  13821. };
  13822. d.prototype.initData = function() {
  13823. this.role.setState(Role.STATE1);
  13824. this.role.play();
  13825. this.topRects.splice(0, this.topRects.length);
  13826. this.bottomRects.splice(0, this.bottomRects.length);
  13827. for (var c = !1, b = 0; 8 > b; b++) {
  13828. var a = 150 + 10 * Math.floor(8 * Math.random());
  13829. this.bottomRects.push(new egret.Rectangle(60 * b, Consts.GAME_HEIGHT - a, 60, a));
  13830. a = Consts.GAME_HEIGHT - a;
  13831. if (0.2 > Math.random() || !c && 7 == b) c = Math.floor(Math.random() * this.spaceArr.length), a -= this.spaceArr[c], c = !0;
  13832. this.topRects.push(new egret.Rectangle(60 * b, 0, 60, a))
  13833. }
  13834. this.fullFront(this.topSptite, this.topRects);
  13835. this.fullFront(this.bottomSptite,
  13836. this.bottomRects, !0);
  13837. this.drawLine();
  13838. this.topContianer.y = -200;
  13839. this.setRolePos(3, 17, 0, !0)
  13840. };
  13841. d.prototype.setRolePos = function(c, b, a, d) {
  13842. void 0 === b && (b = 17);
  13843. void 0 === a && (a = 0);
  13844. void 0 === d && (d = !1);
  13845. d || (this.rolePosIndex > c ? c = this.rolePosIndex - 1 : this.rolePosIndex < c && (c = this.rolePosIndex + 1));
  13846. this.rolePosIndex = c;
  13847. c = this.bottomRects[c];
  13848. this.role.x = c.x + c.width / 2 + a;
  13849. this.role.y = c.y + b
  13850. };
  13851. d.prototype.drawLine = function() {
  13852. this.topLine.graphics.clear();
  13853. this.topLine.graphics.lineStyle(10, 3401726);
  13854. this.bottomLine.graphics.clear();
  13855. this.bottomLine.graphics.lineStyle(10, 3401726);
  13856. this.drawTopLine(5);
  13857. this.drawBottomLine(5);
  13858. this.topLine.graphics.endFill();
  13859. this.bottomLine.graphics.endFill()
  13860. };
  13861. d.prototype.drawTopLine = function(c) {
  13862. c = this.topRects.length;
  13863. for (var b = 0; b < c; b++) {
  13864. var a = this.topRects[b];
  13865. 0 == b ? this.topLine.graphics.moveTo(a.x, a.height) : this.topLine.graphics.lineTo(a.x, a.height);
  13866. this.topLine.graphics.lineTo(a.x + a.width, a.height)
  13867. }
  13868. };
  13869. d.prototype.drawBottomLine = function(c) {
  13870. for (var b = this.bottomRects.length, a = 0; a < b; a++) {
  13871. var d = this.bottomRects[a];
  13872. 0 == a ? this.bottomLine.graphics.moveTo(d.x, d.y + c) : this.bottomLine.graphics.lineTo(d.x, d.y + c);
  13873. this.bottomLine.graphics.lineTo(d.x + d.width, d.y + c)
  13874. }
  13875. };
  13876. d.prototype.fullFront = function(c, b, a) {
  13877. this.clearBg(c);
  13878. a = b.length;
  13879. for (var d = 0; d < a; d++) {
  13880. var l = b[d],
  13881. q;
  13882. this.bgBitmaps.length ? q = this.bgBitmaps.pop() : (q = new egret.Bitmap, q.texture = new egret.Texture, q.texture._setBitmapData(this.bg._bitmapData));
  13883. q.scrollRect = l;
  13884. q.x = l.x;
  13885. q.y = l.y;
  13886. c.addChild(q)
  13887. }
  13888. };
  13889. d.prototype.clearBg = function(c) {
  13890. for (; c.numChildren;) {
  13891. var b = c.getChildAt(0);
  13892. b && (c.removeChild(b), this.bgBitmaps.push(b))
  13893. }
  13894. };
  13895. return d
  13896. }(egret.Sprite);
  13897. GameSceneLayer.prototype.__class__ = "GameSceneLayer";
  13898. var __extends = this.__extends || function(c, d) {
  13899. function f() {
  13900. this.constructor = c
  13901. }
  13902. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13903. f.prototype = d.prototype;
  13904. c.prototype = new f
  13905. },
  13906. StartGameLayer = function(c) {
  13907. function d() {
  13908. c.call(this);
  13909. this.init()
  13910. }
  13911. __extends(d, c);
  13912. d.prototype.init = function() {
  13913. this.titleImage = GameUtils.createBitmapFromSheet("logo_mishitaosheng");
  13914. this.titleImage.x = 51;
  13915. this.titleImage.y = 161;
  13916. this.addChild(this.titleImage);
  13917. this.startBtn = new MyButton("btn_y", "btn_kaishi");
  13918. this.startBtn.x = 131;
  13919. this.startBtn.y =
  13920. 324;
  13921. this.startBtn.setClick(this.onStartGameClick);
  13922. this.addChild(this.startBtn);
  13923. this.moreBtn = new MyButton("btn_b", "btn_gengduo");
  13924. this.moreBtn.setClick(function() {
  13925. // EgretShare.moreGame()
  13926. //Play68.goHome();
  13927. });
  13928. this.moreBtn.x = 131;
  13929. this.moreBtn.y = 432;
  13930. this.addChild(this.moreBtn);
  13931. var c = new egret.TextField;
  13932. c.width = Consts.GAME_WIDTH;
  13933. c.textAlign = egret.HorizontalAlign.CENTER;
  13934. c.strokeColor = 4210238;
  13935. c.stroke = 1;
  13936. c.bold = !0;
  13937. c.y = 612;
  13938. c.text = "";
  13939. this.addChild(c)
  13940. };
  13941. d.prototype.onStartGameClick = function() {
  13942. GameControl.getInstance().onGameSceneHandler()
  13943. };
  13944. d.prototype.onMoreGameClik = function() {};
  13945. return d
  13946. }(egret.Sprite);
  13947. StartGameLayer.prototype.__class__ = "StartGameLayer";
  13948. var Consts = function() {
  13949. function c() {}
  13950. c.GAME_WIDTH = 480;
  13951. c.GAME_HEIGHT = 650;
  13952. return c
  13953. }();
  13954. Consts.prototype.__class__ = "Consts";
  13955. var __extends = this.__extends || function(c, d) {
  13956. function f() {
  13957. this.constructor = c
  13958. }
  13959. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  13960. f.prototype = d.prototype;
  13961. c.prototype = new f
  13962. },
  13963. LoadingUI = function(c) {
  13964. function d() {
  13965. c.call(this);
  13966. this.logoUrl = "resource/assets/loading_logo.png";
  13967. this.bgUrl = "resource/assets/loading_bg.jpg";
  13968. this.createView()
  13969. }
  13970. __extends(d, c);
  13971. d.prototype.createView = function() {
  13972. this.w = 480;
  13973. this.h = 800;
  13974. this.textField = new egret.TextField;
  13975. this.textField.y = 500;
  13976. this.textField.textColor = 3355443;
  13977. this.textField.size =
  13978. 23;
  13979. this.textField.width = this.w;
  13980. this.textField.height = 100;
  13981. this.textField.fontFamily = "Black";
  13982. this.textField.textAlign = "center";
  13983. this.textField_power = new egret.TextField;
  13984. this.textField_power.y = 0.9 * this.h;
  13985. this.textField_power.textColor = 3355443;
  13986. this.textField_power.width = this.w;
  13987. this.textField_power.height = 100;
  13988. this.textField_power.size = 20;
  13989. this.textField_power.text = "最好玩的游戏尽在空中传媒小游戏";
  13990. this.textField_power.fontFamily = "Black";
  13991. this.textField_power.textAlign = "center";
  13992. var c = new egret.URLLoader;
  13993. c.addEventListener(egret.Event.COMPLETE,
  13994. this.onComplete, this);
  13995. c.dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  13996. c.load(new egret.URLRequest(this.logoUrl));
  13997. c = new egret.URLLoader;
  13998. c.addEventListener(egret.Event.COMPLETE, this.onComplete, this);
  13999. c.dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  14000. c.load(new egret.URLRequest(this.bgUrl));
  14001. this.bg = new egret.Bitmap;
  14002. this.logo = new egret.Bitmap;
  14003. this.uiContainer = new egret.DisplayObjectContainer;
  14004. this.addChild(this.uiContainer);
  14005. this.addChild(this.logo);
  14006. this.addChildAt(this.bg, 0);
  14007. this.addChild(this.textField);
  14008. this.addChild(this.textField_power)
  14009. };
  14010. d.prototype.onComplete = function(c) {
  14011. c = c.target;
  14012. var b = c.data;
  14013. c._request.url == this.bgUrl ? (this.bg.texture = b, this.bg.scaleX = this.w / 640, this.bg.scaleY = this.h / 960) : c._request.url == this.logoUrl && (this.logo.texture = b, this.logo.anchorX = this.logo.anchorY = 0.5, this.logo.x = this.w / 2, this.logo.y = this.h / 2 - 60, this.logo.scaleX = this.logo.scaleY = this.h / 960, this.textField.y = this.logo.y + 100)
  14014. };
  14015. d.prototype.setProgress = function(c, b) {
  14016. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d\u2026" + Math.floor(c / b * 100) + "%"
  14017. };
  14018. d.prototype.onLoadComplete =
  14019. function(c, b) {};
  14020. return d
  14021. }(egret.Sprite);
  14022. LoadingUI.prototype.__class__ = "LoadingUI";
  14023. var __extends = this.__extends || function(c, d) {
  14024. function f() {
  14025. this.constructor = c
  14026. }
  14027. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  14028. f.prototype = d.prototype;
  14029. c.prototype = new f
  14030. },
  14031. MyButton = function(c) {
  14032. function d(d, b) {
  14033. c.call(this);
  14034. this.bg = GameUtils.createBitmapFromSheet(d);
  14035. this.addChild(this.bg);
  14036. this.title = GameUtils.createBitmapFromSheet(b);
  14037. null == this.title.texture && (this.title.texture = RES.getRes(b));
  14038. this.title.x = this.bg.width - this.title.width >> 1;
  14039. this.title.y = this.bg.height - this.title.height >> 1;
  14040. this.addChild(this.title)
  14041. }
  14042. __extends(d, c);
  14043. d.prototype.setClick = function(c) {
  14044. this.touchEnabled = !0;
  14045. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClickEvent, this);
  14046. this.onClick = c
  14047. };
  14048. d.prototype.onClickEvent = function() {
  14049. this.onClick()
  14050. };
  14051. return d
  14052. }(egret.Sprite);
  14053. MyButton.prototype.__class__ = "MyButton";
  14054. var __extends = this.__extends || function(c, d) {
  14055. function f() {
  14056. this.constructor = c
  14057. }
  14058. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  14059. f.prototype = d.prototype;
  14060. c.prototype = new f
  14061. },
  14062. GameControl = function(c) {
  14063. function d() {
  14064. c.call(this);
  14065. this.startgame = new StartGameLayer;
  14066. this.gameScene = new GameSceneLayer;
  14067. this.gameoverGame = new GameOverLayer
  14068. }
  14069. __extends(d, c);
  14070. d.getInstance = function() {
  14071. d._gameControl || (d._gameControl = new d);
  14072. return d._gameControl
  14073. };
  14074. d.prototype.setStageHandler = function(c) {
  14075. this.currStage = c;
  14076. this.bgImag = GameUtils.createBitmapByName("bgImage");
  14077. this.currStage.addChild(this.bgImag)
  14078. };
  14079. d.prototype.startGameHandler = function() {
  14080. this.gameScene && this.gameScene.parent && GameUtils.removeChild(this.gameScene);
  14081. this.gameoverGame && this.gameoverGame.parent && GameUtils.removeChild(this.gameoverGame);
  14082. this.currStage.addChild(this.startgame);
  14083. GameApp.xia.visible = !0
  14084. };
  14085. d.prototype.onGameSceneHandler = function() {
  14086. this.startgame && this.startgame.parent && GameUtils.removeChild(this.startgame);
  14087. this.gameoverGame && this.gameoverGame.parent && GameUtils.removeChild(this.gameoverGame);
  14088. this.currStage.addChild(this.gameScene);
  14089. GameApp.xia.visible = !1
  14090. };
  14091. d.prototype.showGameOverSceneHandler = function() {
  14092. this.startgame && this.startgame.parent && GameUtils.removeChild(this.startgame);
  14093. this.gameScene && this.gameScene.parent && GameUtils.removeChild(this.gameScene);
  14094. this.currStage.addChild(this.gameoverGame);
  14095. GameApp.xia.visible = !0;
  14096. console.log(this.scoreNum);
  14097. };
  14098. d.prototype.getGameOverDisplay = function() {
  14099. return this.gameoverGame
  14100. };
  14101. d._gameControl = null;
  14102. return d
  14103. }(egret.Sprite);
  14104. GameControl.prototype.__class__ = "GameControl";
  14105. var __extends = this.__extends || function(c, d) {
  14106. function f() {
  14107. this.constructor = c
  14108. }
  14109. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  14110. f.prototype = d.prototype;
  14111. c.prototype = new f
  14112. },
  14113. GameApp = function(c) {
  14114. function d() {
  14115. c.call(this);
  14116. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  14117. egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE && (this.y = 800 - Consts.GAME_HEIGHT >> 1)
  14118. }
  14119. __extends(d, c);
  14120. d.prototype.onAddToStage = function(c) {
  14121. this.loadingView = new LoadingUI;
  14122. this.stage.addChild(this.loadingView);
  14123. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  14124. RES.loadConfig("resource/resource.json", "resource/")
  14125. };
  14126. d.prototype.onConfigComplete = function(c) {
  14127. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  14128. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  14129. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  14130. RES.loadGroup("preload")
  14131. };
  14132. d.prototype.onResourceLoadComplete = function(c) {
  14133. "preload" ==
  14134. c.groupName && (RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.stage.removeChild(this.loadingView), this.createGameScene())
  14135. };
  14136. d.prototype.onResourceProgress = function(c) {
  14137. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  14138. };
  14139. d.prototype.createGameScene = function() {
  14140. /*window.hasOwnProperty("EgretShare") ? EgretShare.setShareData("\u5bc6\u5ba4\u9003\u751f",
  14141. "\u5c3c\u739b\uff0c\u6d3b\u7740\u771f\u662f\u4e0d\u5bb9\u6613", "http://static.egret-labs.org/h5game/8/release.html", "http://static.egret-labs.org/h5game/icons/10000008.jpg") : window.setShareInfo = function() {
  14142. EgretShare.setShareData("\u5bc6\u5ba4\u9003\u751f", "\u5c3c\u739b\uff0c\u6d3b\u7740\u771f\u662f\u4e0d\u5bb9\u6613", "http://static.egret-labs.org/h5game/8/release.html", "http://static.egret-labs.org/h5game/icons/10000008.jpg")
  14143. };*/
  14144. if (egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE) {
  14145. var c =
  14146. GameUtils.createBitmapByName("shang");
  14147. c.height = this.y;
  14148. this.stage.addChild(c);
  14149. c = GameUtils.createBitmapByName("xia");
  14150. c.y = this.y + Consts.GAME_HEIGHT;
  14151. c.height = this.y;
  14152. this.stage.addChild(c);
  14153. d.xia = c
  14154. }
  14155. GameControl.getInstance().setStageHandler(this);
  14156. GameControl.getInstance().startGameHandler()
  14157. };
  14158. d.xia = new egret.DisplayObject;
  14159. return d
  14160. }(egret.DisplayObjectContainer);
  14161. GameApp.prototype.__class__ = "GameApp";
  14162. var __extends = this.__extends || function(c, d) {
  14163. function f() {
  14164. this.constructor = c
  14165. }
  14166. for (var b in d) d.hasOwnProperty(b) && (c[b] = d[b]);
  14167. f.prototype = d.prototype;
  14168. c.prototype = new f
  14169. },
  14170. SpecialNumber = function(c) {
  14171. function d() {
  14172. c.call(this);
  14173. this.gap = 0;
  14174. this.anchorX = 0.5
  14175. }
  14176. __extends(d, c);
  14177. d.prototype.setData = function(c) {
  14178. this.clear();
  14179. if ("" != c && null != c)
  14180. for (var b = c.split(""), a = 0, d = b.length, l = 0; l < d; l++) {
  14181. c = b[l];
  14182. try {
  14183. var q = GameUtils.createBitmapFromSheet(c);
  14184. q && (q.x = a, a += q.width + this.gap, this.addChild(q))
  14185. } catch (n) {
  14186. console.log(n)
  14187. }
  14188. }
  14189. };
  14190. d.prototype.clear = function() {
  14191. for (; this.numChildren;) this.removeChildAt(0)
  14192. };
  14193. return d
  14194. }(egret.DisplayObjectContainer);
  14195. SpecialNumber.prototype.__class__ = "SpecialNumber";