game-min.js 693 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595
  1. var egret;
  2. (function (d) {
  3. var e = function () {
  4. function d() {
  5. this._hashCode = d.hashCount++
  6. }
  7. Object.defineProperty(d.prototype, "hashCode", {
  8. get : function () {
  9. return this._hashCode
  10. },
  11. enumerable : !0,
  12. configurable : !0
  13. });
  14. d.hashCount = 1;
  15. return d
  16. }
  17. ();
  18. d.HashObject = e;
  19. e.prototype.__class__ = "egret.HashObject"
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends || function (d, e) {
  22. function f() {
  23. this.constructor = d
  24. }
  25. for (var c in e)
  26. e.hasOwnProperty(c) && (d[c] = e[c]);
  27. f.prototype = e.prototype;
  28. d.prototype = new f
  29. };
  30. (function (d) {
  31. var e = function (d) {
  32. function c(a) {
  33. "undefined" === typeof a && (a = 300);
  34. d.call(this);
  35. this.objectPool = [];
  36. this._length = 0;
  37. 1 > a && (a = 1);
  38. this.autoDisposeTime = a;
  39. this.frameCount = 0
  40. }
  41. __extends(c, d);
  42. c.prototype._checkFrame = function () {
  43. this.frameCount--;
  44. 0 >= this.frameCount && this.dispose()
  45. };
  46. Object.defineProperty(c.prototype, "length", {
  47. get : function () {
  48. return this._length
  49. },
  50. enumerable : !0,
  51. configurable : !0
  52. });
  53. c.prototype.push = function (a) {
  54. var b = this.objectPool;
  55. -1 == b.indexOf(a) && (b.push(a), this._length++, 0 == this.frameCount &&
  56. (this.frameCount = this.autoDisposeTime, c._callBackList.push(this)))
  57. };
  58. c.prototype.pop = function () {
  59. if (0 == this._length)
  60. return null;
  61. this._length--;
  62. return this.objectPool.pop()
  63. };
  64. c.prototype.dispose = function () {
  65. 0 < this._length && (this.objectPool = [], this._length = 0);
  66. this.frameCount = 0;
  67. var a = c._callBackList,
  68. b = a.indexOf(this);
  69. -1 != b && a.splice(b, 1)
  70. };
  71. c._callBackList = [];
  72. return c
  73. }
  74. (d.HashObject);
  75. d.Recycler = e;
  76. e.prototype.__class__ = "egret.Recycler"
  77. })(egret || (egret = {}));
  78. (function (d) {
  79. d.__START_TIME;
  80. d.getTimer = function () {
  81. return Date.now() - d.__START_TIME
  82. }
  83. })(egret || (egret = {}));
  84. (function (d) {
  85. d.__callLaterFunctionList = [];
  86. d.__callLaterThisList = [];
  87. d.__callLaterArgsList = [];
  88. d.callLater = function (e, f) {
  89. for (var c = [], a = 0; a < arguments.length - 2; a++)
  90. c[a] = arguments[a + 2];
  91. d.__callLaterFunctionList.push(e);
  92. d.__callLaterThisList.push(f);
  93. d.__callLaterArgsList.push(c)
  94. }
  95. })(egret || (egret = {}));
  96. __extends = this.__extends || function (d, e) {
  97. function f() {
  98. this.constructor = d
  99. }
  100. for (var c in e)
  101. e.hasOwnProperty(c) && (d[c] = e[c]);
  102. f.prototype = e.prototype;
  103. d.prototype = new f
  104. };
  105. (function (d) {
  106. var e = function (e) {
  107. function c(a, b, m) {
  108. "undefined" === typeof b && (b = !1);
  109. "undefined" === typeof m && (m = !1);
  110. e.call(this);
  111. this._eventPhase = 2;
  112. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  113. this.isNew = !0;
  114. this._type = a;
  115. this._bubbles = b;
  116. this._cancelable = m
  117. }
  118. __extends(c, e);
  119. Object.defineProperty(c.prototype, "type", {
  120. get : function () {
  121. return this._type
  122. },
  123. enumerable : !0,
  124. configurable : !0
  125. });
  126. Object.defineProperty(c.prototype, "bubbles", {
  127. get : function () {
  128. return this._bubbles
  129. },
  130. enumerable : !0,
  131. configurable : !0
  132. });
  133. Object.defineProperty(c.prototype, "cancelable", {
  134. get : function () {
  135. return this._cancelable
  136. },
  137. enumerable : !0,
  138. configurable : !0
  139. });
  140. Object.defineProperty(c.prototype, "eventPhase", {
  141. get : function () {
  142. return this._eventPhase
  143. },
  144. enumerable : !0,
  145. configurable : !0
  146. });
  147. Object.defineProperty(c.prototype, "currentTarget", {
  148. get : function () {
  149. return this._currentTarget
  150. },
  151. enumerable : !0,
  152. configurable : !0
  153. });
  154. c.prototype._setCurrentTarget = function (a) {
  155. this._currentTarget = a
  156. };
  157. Object.defineProperty(c.prototype, "target", {
  158. get : function () {
  159. return this._target
  160. },
  161. enumerable : !0,
  162. configurable : !0
  163. });
  164. c.prototype.isDefaultPrevented = function () {
  165. return this._isDefaultPrevented
  166. };
  167. c.prototype.preventDefault = function () {
  168. this._cancelable && (this._isDefaultPrevented = !0)
  169. };
  170. c.prototype.stopPropagation = function () {
  171. this._bubbles && (this._isPropagationStopped = !0)
  172. };
  173. c.prototype.stopImmediatePropagation = function () {
  174. this._bubbles && (this._isPropagationImmediateStopped = !0)
  175. };
  176. c.prototype._reset = function () {
  177. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
  178. this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  179. };
  180. c._dispatchByTarget = function (a, b, m, c, e, f) {
  181. "undefined" === typeof e && (e = !1);
  182. "undefined" === typeof f && (f = !1);
  183. var g = a.eventRecycler;
  184. g || (g = a.eventRecycler = new d.Recycler);
  185. var l = g.pop();
  186. l ? l._type = m : l = new a(m);
  187. l._bubbles = e;
  188. l._cancelable = f;
  189. if (c)
  190. for (var k in c)
  191. l[k] = c[k], null !== l[k] && (c[k] = null);
  192. a = b.dispatchEvent(l);
  193. g.push(l);
  194. return a
  195. };
  196. c._getPropertyData = function (a) {
  197. var b = a._props;
  198. b || (b = a._props = {});
  199. return b
  200. };
  201. c.dispatchEvent = function (a, b, m, d) {
  202. "undefined" === typeof m && (m = !1);
  203. var e = c._getPropertyData(c);
  204. d && (e.data = d);
  205. c._dispatchByTarget(c, a, b, e, m)
  206. };
  207. c.ADDED_TO_STAGE = "addedToStage";
  208. c.REMOVED_FROM_STAGE = "removedFromStage";
  209. c.ADDED = "added";
  210. c.REMOVED = "removed";
  211. c.COMPLETE = "complete";
  212. c.ENTER_FRAME = "enterFrame";
  213. c.RENDER = "render";
  214. c.FINISH_RENDER = "finishRender";
  215. c.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  216. c.LEAVE_STAGE = "leaveStage";
  217. c.RESIZE = "resize";
  218. c.CHANGE = "change";
  219. return c
  220. }
  221. (d.HashObject);
  222. d.Event =
  223. e;
  224. e.prototype.__class__ = "egret.Event"
  225. })(egret || (egret = {}));
  226. __extends = this.__extends || function (d, e) {
  227. function f() {
  228. this.constructor = d
  229. }
  230. for (var c in e)
  231. e.hasOwnProperty(c) && (d[c] = e[c]);
  232. f.prototype = e.prototype;
  233. d.prototype = new f
  234. };
  235. (function (d) {
  236. var e = function (e) {
  237. function c(a, b, m) {
  238. "undefined" === typeof b && (b = !1);
  239. "undefined" === typeof m && (m = !1);
  240. e.call(this, a, b, m)
  241. }
  242. __extends(c, e);
  243. c.dispatchIOErrorEvent = function (a) {
  244. d.Event._dispatchByTarget(c, a, c.IO_ERROR)
  245. };
  246. c.IO_ERROR = "ioError";
  247. return c
  248. }
  249. (d.Event);
  250. d.IOErrorEvent = e;
  251. e.prototype.__class__ = "egret.IOErrorEvent"
  252. })(egret || (egret = {}));
  253. __extends = this.__extends || function (d, e) {
  254. function f() {
  255. this.constructor = d
  256. }
  257. for (var c in e)
  258. e.hasOwnProperty(c) && (d[c] = e[c]);
  259. f.prototype = e.prototype;
  260. d.prototype = new f
  261. };
  262. (function (d) {
  263. var e = function (e) {
  264. function c(a, b, m, c, d, h, g, l, k, n) {
  265. "undefined" === typeof b && (b = !0);
  266. "undefined" === typeof m && (m = !0);
  267. "undefined" === typeof c && (c = 0);
  268. "undefined" === typeof d && (d = 0);
  269. "undefined" === typeof h && (h = 0);
  270. "undefined" === typeof g && (g = !1);
  271. "undefined" === typeof l && (l = !1);
  272. "undefined" === typeof n && (n = !1);
  273. e.call(this, a, b, m);
  274. this._localY = this._localX = this._stageY = this._stageX = 0;
  275. this.touchPointID = c;
  276. this._stageX = d;
  277. this._stageY = h;
  278. this.ctrlKey = g;
  279. this.altKey = l;
  280. this.touchDown = n
  281. }
  282. __extends(c, e);
  283. Object.defineProperty(c.prototype,
  284. "stageX", {
  285. get : function () {
  286. return this._stageX
  287. },
  288. enumerable : !0,
  289. configurable : !0
  290. });
  291. Object.defineProperty(c.prototype, "stageY", {
  292. get : function () {
  293. return this._stageY
  294. },
  295. enumerable : !0,
  296. configurable : !0
  297. });
  298. Object.defineProperty(c.prototype, "localX", {
  299. get : function () {
  300. return this._localX
  301. },
  302. enumerable : !0,
  303. configurable : !0
  304. });
  305. Object.defineProperty(c.prototype, "localY", {
  306. get : function () {
  307. return this._localY
  308. },
  309. enumerable : !0,
  310. configurable : !0
  311. });
  312. c.prototype._setCurrentTarget = function (a) {
  313. e.prototype._setCurrentTarget.call(this, a);
  314. a instanceof
  315. d.DisplayObject && (a = a.globalToLocal(this._stageX, this._stageY, d.Point.identity), this._localX = a.x, this._localY = a.y)
  316. };
  317. c.dispatchTouchEvent = function (a, b, m, e, f, h, g, l, k) {
  318. "undefined" === typeof m && (m = 0);
  319. "undefined" === typeof e && (e = 0);
  320. "undefined" === typeof f && (f = 0);
  321. "undefined" === typeof h && (h = !1);
  322. "undefined" === typeof g && (g = !1);
  323. "undefined" === typeof l && (l = !1);
  324. "undefined" === typeof k && (k = !1);
  325. var n = d.Event._getPropertyData(c);
  326. n.touchPointID = m;
  327. n._stageX = e;
  328. n._stageY = f;
  329. n.ctrlKey = h;
  330. n.altKey = g;
  331. n.shiftKey = l;
  332. n.touchDown =
  333. k;
  334. d.Event._dispatchByTarget(c, a, b, n, !0, !0)
  335. };
  336. c.TOUCH_TAP = "touchTap";
  337. c.TOUCH_MOVE = "touchMove";
  338. c.TOUCH_BEGIN = "touchBegin";
  339. c.TOUCH_END = "touchEnd";
  340. c.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  341. c.TOUCH_ROLL_OUT = "touchRollOut";
  342. c.TOUCH_ROLL_OVER = "touchRollOver";
  343. c.TOUCH_OUT = "touchOut";
  344. c.TOUCH_OVER = "touchOver";
  345. return c
  346. }
  347. (d.Event);
  348. d.TouchEvent = e;
  349. e.prototype.__class__ = "egret.TouchEvent"
  350. })(egret || (egret = {}));
  351. __extends = this.__extends || function (d, e) {
  352. function f() {
  353. this.constructor = d
  354. }
  355. for (var c in e)
  356. e.hasOwnProperty(c) && (d[c] = e[c]);
  357. f.prototype = e.prototype;
  358. d.prototype = new f
  359. };
  360. (function (d) {
  361. var e = function (e) {
  362. function c(a, b, m) {
  363. "undefined" === typeof b && (b = !1);
  364. "undefined" === typeof m && (m = !1);
  365. e.call(this, a, b, m)
  366. }
  367. __extends(c, e);
  368. c.dispatchTimerEvent = function (a, b) {
  369. d.Event._dispatchByTarget(c, a, b)
  370. };
  371. c.TIMER = "timer";
  372. c.TIMER_COMPLETE = "timerComplete";
  373. return c
  374. }
  375. (d.Event);
  376. d.TimerEvent = e;
  377. e.prototype.__class__ = "egret.TimerEvent"
  378. })(egret || (egret = {}));
  379. (function (d) {
  380. var e = function () {
  381. function d() {}
  382. d.CAPTURING_PHASE = 1;
  383. d.AT_TARGET = 2;
  384. d.BUBBLING_PHASE = 3;
  385. return d
  386. }
  387. ();
  388. d.EventPhase = e;
  389. e.prototype.__class__ = "egret.EventPhase"
  390. })(egret || (egret = {}));
  391. __extends = this.__extends || function (d, e) {
  392. function f() {
  393. this.constructor = d
  394. }
  395. for (var c in e)
  396. e.hasOwnProperty(c) && (d[c] = e[c]);
  397. f.prototype = e.prototype;
  398. d.prototype = new f
  399. };
  400. (function (d) {
  401. var e = function (e) {
  402. function c(a) {
  403. "undefined" === typeof a && (a = null);
  404. e.call(this);
  405. this._eventTarget = a ? a : this
  406. }
  407. __extends(c, e);
  408. c.prototype.addEventListener = function (a, b, m, c, e) {
  409. "undefined" === typeof c && (c = !1);
  410. "undefined" === typeof e && (e = 0);
  411. "undefined" === typeof c && (c = !1);
  412. "undefined" === typeof e && (e = 0);
  413. b || d.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  414. c ? (this._captureEventsMap || (this._captureEventsMap = {}), c = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), c = this._eventsMap);
  415. var f = c[a];
  416. f || (f = c[a] = []);
  417. this._insertEventBin(f, b, m, e)
  418. };
  419. c.prototype._insertEventBin = function (a, b, m, c) {
  420. for (var d = -1, e = a.length, f = 0; f < e; f++) {
  421. var l = a[f];
  422. if (l.listener === b && l.thisObject === m)
  423. return !1;
  424. -1 == d && l.priority < c && (d = f)
  425. }
  426. b = {
  427. listener : b,
  428. thisObject : m,
  429. priority : c
  430. };
  431. -1 != d ? a.splice(d, 0, b) : a.push(b);
  432. return !0
  433. };
  434. c.prototype.removeEventListener = function (a, b, m, c) {
  435. "undefined" === typeof c && (c = !1);
  436. if (c = c ? this._captureEventsMap : this._eventsMap) {
  437. var d = c[a];
  438. d && (this._removeEventBin(d, b, m), 0 ==
  439. d.length && delete c[a])
  440. }
  441. };
  442. c.prototype._removeEventBin = function (a, b, m) {
  443. for (var c = a.length, d = 0; d < c; d++) {
  444. var e = a[d];
  445. if (e.listener === b && e.thisObject === m)
  446. return a.splice(d, 1), !0
  447. }
  448. return !1
  449. };
  450. c.prototype.hasEventListener = function (a) {
  451. return this._eventsMap && this._eventsMap[a] || this._captureEventsMap && this._captureEventsMap[a]
  452. };
  453. c.prototype.willTrigger = function (a) {
  454. return this.hasEventListener(a)
  455. };
  456. c.prototype.dispatchEvent = function (a) {
  457. a._reset();
  458. a._target = this._eventTarget;
  459. a._setCurrentTarget(this._eventTarget);
  460. return this._notifyListener(a)
  461. };
  462. c.prototype._notifyListener = function (a) {
  463. var b = 1 == a._eventPhase ? this._captureEventsMap : this._eventsMap;
  464. if (!b)
  465. return !0;
  466. b = b[a.type];
  467. if (!b)
  468. return !0;
  469. for (var b = b.concat(), m = b.length, c = 0; c < m; c++) {
  470. var d = b[c];
  471. d.listener.call(d.thisObject, a);
  472. if (a._isPropagationImmediateStopped)
  473. break
  474. }
  475. return !a.isDefaultPrevented()
  476. };
  477. c.prototype.dispatchEventWith = function (a, b, m) {
  478. "undefined" === typeof b && (b = !1);
  479. d.Event.dispatchEvent(this, a, b, m)
  480. };
  481. return c
  482. }
  483. (d.HashObject);
  484. d.EventDispatcher = e;
  485. e.prototype.__class__ =
  486. "egret.EventDispatcher"
  487. })(egret || (egret = {}));
  488. __extends = this.__extends || function (d, e) {
  489. function f() {
  490. this.constructor = d
  491. }
  492. for (var c in e)
  493. e.hasOwnProperty(c) && (d[c] = e[c]);
  494. f.prototype = e.prototype;
  495. d.prototype = new f
  496. };
  497. (function (d) {
  498. var e = function (e) {
  499. function c() {
  500. e.call(this);
  501. this.reuseEvent = new d.Event("")
  502. }
  503. __extends(c, e);
  504. c.prototype.run = function () {
  505. d.Ticker.getInstance().run();
  506. d.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  507. d.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  508. this.touchContext.run()
  509. };
  510. c.prototype.renderLoop = function (a) {
  511. a = this.rendererContext;
  512. a.clearScreen();
  513. if (0 < d.__callLaterFunctionList.length) {
  514. var b = d.__callLaterFunctionList;
  515. d.__callLaterFunctionList =
  516. [];
  517. var m = d.__callLaterThisList;
  518. d.__callLaterThisList = [];
  519. var c = d.__callLaterArgsList;
  520. d.__callLaterArgsList = []
  521. }
  522. this.dispatchEventWith(d.Event.RENDER);
  523. d.Stage._invalidateRenderFlag && (this.broadcastRender(), d.Stage._invalidateRenderFlag = !1);
  524. b && this.doCallLaterList(b, m, c);
  525. this.stage._updateTransform();
  526. this.dispatchEventWith(d.Event.FINISH_UPDATE_TRANSFORM);
  527. this.stage._draw(a);
  528. this.dispatchEventWith(d.Event.FINISH_RENDER)
  529. };
  530. c.prototype.broadcastEnterFrame = function (a) {
  531. a = this.reuseEvent;
  532. a._type = d.Event.ENTER_FRAME;
  533. this.dispatchEvent(a);
  534. for (var b = d.DisplayObject._enterFrameCallBackList.concat(), m = b.length, c = 0; c < m; c++) {
  535. var e = b[c];
  536. a._target = e.display;
  537. a._setCurrentTarget(e.display);
  538. e.listener.call(e.thisObject, a)
  539. }
  540. b = d.Recycler._callBackList;
  541. for (c = b.length - 1; 0 <= c; c--)
  542. b[c]._checkFrame()
  543. };
  544. c.prototype.broadcastRender = function () {
  545. var a = this.reuseEvent;
  546. a._type = d.Event.RENDER;
  547. for (var b = d.DisplayObject._renderCallBackList.concat(), m = b.length, c = 0; c < m; c++) {
  548. var e = b[c];
  549. a._target = e.display;
  550. a._setCurrentTarget(e.display);
  551. e.listener.call(e.thisObject,
  552. a)
  553. }
  554. };
  555. c.prototype.doCallLaterList = function (a, b, m) {
  556. for (var c = a.length, d = 0; d < c; d++) {
  557. var e = a[d];
  558. null != e && e.apply(b[d], m[d])
  559. }
  560. };
  561. c.DEVICE_PC = "web";
  562. c.DEVICE_MOBILE = "native";
  563. return c
  564. }
  565. (d.EventDispatcher);
  566. d.MainContext = e;
  567. e.prototype.__class__ = "egret.MainContext"
  568. })(egret || (egret = {}));
  569. var testDeviceType = function () {
  570. if (!this.navigator)
  571. return !0;
  572. var d = navigator.userAgent.toLowerCase();
  573. return -1 != d.indexOf("mobile") || -1 != d.indexOf("android")
  574. };
  575. egret.MainContext.instance = new egret.MainContext;
  576. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  577. (function (d) {
  578. var e = function () {
  579. function e() {
  580. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  581. this._maxDeltaTime = 500;
  582. this._totalDeltaTime = 0
  583. }
  584. e.getInstance = function () {
  585. null == e.instance && (e.instance = new e);
  586. return e.instance
  587. };
  588. e.prototype.run = function () {
  589. d.Ticker.getInstance().register(this.update, this);
  590. //null == this._txt && (this._txt = new d.TextField, this._txt.size = 28, d.MainContext.instance.stage.addChild(this._txt));
  591. var c =
  592. d.MainContext.instance;
  593. c.addEventListener(d.Event.ENTER_FRAME, this.onEnterFrame, this);
  594. c.addEventListener(d.Event.RENDER, this.onStartRender, this);
  595. c.addEventListener(d.Event.FINISH_RENDER, this.onFinishRender, this);
  596. c.addEventListener(d.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  597. };
  598. e.prototype.onEnterFrame = function (c) {
  599. this._lastTime = d.getTimer()
  600. };
  601. e.prototype.onStartRender = function (c) {
  602. c = d.getTimer();
  603. this._logicPerformanceCost = c - this._lastTime;
  604. this._lastTime = c
  605. };
  606. e.prototype.onFinishUpdateTransform =
  607. function (c) {
  608. c = d.getTimer();
  609. this._updateTransformPerformanceCost = c - this._lastTime;
  610. this._lastTime = c
  611. };
  612. e.prototype.onFinishRender = function (c) {
  613. c = d.getTimer();
  614. this._renderPerformanceCost = c - this._lastTime;
  615. this._lastTime = c
  616. };
  617. e.prototype.update = function (c) {
  618. this._tick++;
  619. this._totalDeltaTime += c;
  620. if (this._totalDeltaTime >= this._maxDeltaTime) {
  621. c = (this._preDrawCount - 1).toString();
  622. var a = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  623. "," + Math.ceil(d.MainContext.instance.rendererContext.renderCost).toString();
  624. //this._txt.text = "draw:" + c + "\ncost:" + a + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  625. this._tick = this._totalDeltaTime = 0
  626. }
  627. this._preDrawCount = 0
  628. };
  629. e.prototype.onDrawImage = function () {
  630. this._preDrawCount++
  631. };
  632. return e
  633. }
  634. ();
  635. d.Profiler = e;
  636. e.prototype.__class__ = "egret.Profiler"
  637. })(egret || (egret = {}));
  638. __extends = this.__extends || function (d, e) {
  639. function f() {
  640. this.constructor = d
  641. }
  642. for (var c in e)
  643. e.hasOwnProperty(c) && (d[c] = e[c]);
  644. f.prototype = e.prototype;
  645. d.prototype = new f
  646. };
  647. (function (d) {
  648. var e = function (e) {
  649. function c() {
  650. e.apply(this, arguments);
  651. this._timeScale = 1;
  652. this._paused = !1;
  653. this.callBackList = []
  654. }
  655. __extends(c, e);
  656. c.prototype.run = function () {
  657. d.__START_TIME = (new Date).getTime();
  658. d.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  659. };
  660. c.prototype.update = function (a) {
  661. var b = this.callBackList.concat(),
  662. m = b.length;
  663. a *= this._timeScale;
  664. a *= this._timeScale;
  665. for (var c = 0; c < m; c++) {
  666. var d = b[c];
  667. d.listener.call(d.thisObject, a)
  668. }
  669. };
  670. c.prototype.register = function (a, b, m) {
  671. "undefined" ===
  672. typeof m && (m = 0);
  673. this._insertEventBin(this.callBackList, a, b, m)
  674. };
  675. c.prototype.unregister = function (a, b) {
  676. this._removeEventBin(this.callBackList, a, b)
  677. };
  678. c.prototype.setTimeout = function (a, b, m) {
  679. for (var c = [], e = 0; e < arguments.length - 3; e++)
  680. c[e] = arguments[e + 3];
  681. d.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  682. d.setTimeout.apply(null, [a, b, m].concat(c))
  683. };
  684. c.prototype.setTimeScale = function (a) {
  685. this._timeScale = a
  686. };
  687. c.prototype.getTimeScale = function () {
  688. return this._timeScale
  689. };
  690. c.prototype.pause = function () {
  691. this._paused = !0
  692. };
  693. c.prototype.resume = function () {
  694. this._paused = !1
  695. };
  696. c.getInstance = function () {
  697. null == c.instance && (c.instance = new c);
  698. return c.instance
  699. };
  700. return c
  701. }
  702. (d.EventDispatcher);
  703. d.Ticker = e;
  704. e.prototype.__class__ = "egret.Ticker"
  705. })(egret || (egret = {}));
  706. (function (d) {
  707. var e = function () {
  708. function d() {}
  709. d.LEFT = "left";
  710. d.RIGHT = "right";
  711. d.CENTER = "center";
  712. d.JUSTIFY = "justify";
  713. d.CONTENT_JUSTIFY = "contentJustify";
  714. return d
  715. }
  716. ();
  717. d.HorizontalAlign = e;
  718. e.prototype.__class__ = "egret.HorizontalAlign"
  719. })(egret || (egret = {}));
  720. (function (d) {
  721. var e = function () {
  722. function d() {}
  723. d.TOP = "top";
  724. d.BOTTOM = "bottom";
  725. d.MIDDLE = "middle";
  726. d.JUSTIFY = "justify";
  727. d.CONTENT_JUSTIFY = "contentJustify";
  728. return d
  729. }
  730. ();
  731. d.VerticalAlign = e;
  732. e.prototype.__class__ = "egret.VerticalAlign"
  733. })(egret || (egret = {}));
  734. __extends = this.__extends || function (d, e) {
  735. function f() {
  736. this.constructor = d
  737. }
  738. for (var c in e)
  739. e.hasOwnProperty(c) && (d[c] = e[c]);
  740. f.prototype = e.prototype;
  741. d.prototype = new f
  742. };
  743. (function (d) {
  744. var e = function (e) {
  745. function c(a, b) {
  746. "undefined" === typeof b && (b = 0);
  747. e.call(this);
  748. this._currentCount = 0;
  749. this.delay = a;
  750. this.repeatCount = b
  751. }
  752. __extends(c, e);
  753. c.prototype.currentCount = function () {
  754. return this._currentCount
  755. };
  756. Object.defineProperty(c.prototype, "running", {
  757. get : function () {
  758. return this._running
  759. },
  760. enumerable : !0,
  761. configurable : !0
  762. });
  763. c.prototype.reset = function () {
  764. this.stop();
  765. this._currentCount = 0
  766. };
  767. c.prototype.start = function () {
  768. this._running || (this.lastTime = d.getTimer(), 0 != this._currentCount && (this._currentCount =
  769. 0), d.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  770. };
  771. c.prototype.stop = function () {
  772. this._running && (d.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  773. };
  774. c.prototype.onEnterFrame = function (a) {
  775. a = d.getTimer();
  776. a - this.lastTime > this.delay && (this.lastTime = a, this._currentCount++, d.TimerEvent.dispatchTimerEvent(this, d.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), d.TimerEvent.dispatchTimerEvent(this, d.TimerEvent.TIMER_COMPLETE)))
  777. };
  778. return c
  779. }
  780. (d.EventDispatcher);
  781. d.Timer = e;
  782. e.prototype.__class__ = "egret.Timer"
  783. })(egret || (egret = {}));
  784. (function (d) {
  785. d.getQualifiedClassName = function (d) {
  786. d = d.prototype ? d.prototype : d.__proto__;
  787. if (d.hasOwnProperty("__class__"))
  788. return d.__class__;
  789. var f = d.constructor.toString(),
  790. c = f.indexOf("("),
  791. f = f.substring(9, c);
  792. return d.__class__ = f
  793. }
  794. })(egret || (egret = {}));
  795. (function (d) {
  796. var e = {};
  797. d.getDefinitionByName = function (d) {
  798. if (!d)
  799. return null;
  800. var c = e[d];
  801. if (c)
  802. return c;
  803. for (var a = d.split("."), b = a.length, c = __global, m = 0; m < b; m++)
  804. if (c = c[a[m]], !c)
  805. return null;
  806. return e[d] = c
  807. }
  808. })(egret || (egret = {}));
  809. var __global = __global || this;
  810. (function (d) {
  811. function e(a) {
  812. for (var b in f) {
  813. var m = f[b];
  814. m.delay -= a;
  815. 0 >= m.delay && (m.listener.apply(m.thisObject, m.params), delete f[b])
  816. }
  817. }
  818. var f = {},
  819. c = 0;
  820. d.setTimeout = function (a, b, m) {
  821. for (var u = [], y = 0; y < arguments.length - 3; y++)
  822. u[y] = arguments[y + 3];
  823. u = {
  824. listener : a,
  825. thisObject : b,
  826. delay : m,
  827. params : u
  828. };
  829. 0 == c && d.Ticker.getInstance().register(e, null);
  830. c++;
  831. f[c] = u;
  832. return c
  833. };
  834. d.clearTimeout = function (a) {
  835. delete f[a]
  836. }
  837. })(egret || (egret = {}));
  838. (function (d) {
  839. d.hasDefinition = function (e) {
  840. return d.getDefinitionByName(e) ? !0 : !1
  841. }
  842. })(egret || (egret = {}));
  843. (function (d) {
  844. d.toColorString = function (d) {
  845. if (isNaN(d) || 0 > d)
  846. d = 0;
  847. 16777215 < d && (d = 16777215);
  848. for (d = d.toString(16).toUpperCase(); 6 > d.length; )
  849. d = "0" + d;
  850. return "#" + d
  851. }
  852. })(egret || (egret = {}));
  853. __extends = this.__extends || function (d, e) {
  854. function f() {
  855. this.constructor = d
  856. }
  857. for (var c in e)
  858. e.hasOwnProperty(c) && (d[c] = e[c]);
  859. f.prototype = e.prototype;
  860. d.prototype = new f
  861. };
  862. (function (d) {
  863. var e = function (e) {
  864. function c(a, b, m, c, d, h) {
  865. "undefined" === typeof a && (a = 1);
  866. "undefined" === typeof b && (b = 0);
  867. "undefined" === typeof m && (m = 0);
  868. "undefined" === typeof c && (c = 1);
  869. "undefined" === typeof d && (d = 0);
  870. "undefined" === typeof h && (h = 0);
  871. e.call(this);
  872. this.a = a;
  873. this.b = b;
  874. this.c = m;
  875. this.d = c;
  876. this.tx = d;
  877. this.ty = h
  878. }
  879. __extends(c, e);
  880. c.prototype.prepend = function (a, b, m, c, d, e) {
  881. var f = this.tx;
  882. if (1 != a || 0 != b || 0 != m || 1 != c) {
  883. var l = this.a,
  884. k = this.c;
  885. this.a = l * a + this.b * m;
  886. this.b = l * b + this.b * c;
  887. this.c = k * a + this.d * m;
  888. this.d = k * b + this.d *
  889. c
  890. }
  891. this.tx = f * a + this.ty * m + d;
  892. this.ty = f * b + this.ty * c + e;
  893. return this
  894. };
  895. c.prototype.append = function (a, b, m, c, d, e) {
  896. var f = this.a,
  897. l = this.b,
  898. k = this.c,
  899. n = this.d;
  900. this.a = a * f + b * k;
  901. this.b = a * l + b * n;
  902. this.c = m * f + c * k;
  903. this.d = m * l + c * n;
  904. this.tx = d * f + e * k + this.tx;
  905. this.ty = d * l + e * n + this.ty;
  906. return this
  907. };
  908. c.prototype.prependMatrix = function (a) {
  909. this.prepend(a.a, a.b, a.c, a.d, a.tx, a.ty);
  910. return this
  911. };
  912. c.prototype.appendMatrix = function (a) {
  913. this.append(a.a, a.b, a.c, a.d, a.tx, a.ty);
  914. return this
  915. };
  916. c.prototype.prependTransform = function (a, b, m, d, e, f, g, l, k) {
  917. if (e %
  918. 360) {
  919. var n = e * c.DEG_TO_RAD;
  920. e = Math.cos(n);
  921. n = Math.sin(n)
  922. } else
  923. e = 1, n = 0;
  924. if (l || k)
  925. this.tx -= l, this.ty -= k;
  926. f || g ? (f *= c.DEG_TO_RAD, g *= c.DEG_TO_RAD, this.prepend(e * m, n * m, -n * d, e * d, 0, 0), this.prepend(Math.cos(g), Math.sin(g), -Math.sin(f), Math.cos(f), a, b)) : this.prepend(e * m, n * m, -n * d, e * d, a, b);
  927. return this
  928. };
  929. c.prototype.appendTransform = function (a, b, m, d, e, f, g, l, k) {
  930. if (e % 360) {
  931. var n = e * c.DEG_TO_RAD;
  932. e = Math.cos(n);
  933. n = Math.sin(n)
  934. } else
  935. e = 1, n = 0;
  936. f || g ? (f *= c.DEG_TO_RAD, g *= c.DEG_TO_RAD, this.append(Math.cos(g), Math.sin(g), -Math.sin(f),
  937. Math.cos(f), a, b), this.append(e * m, n * m, -n * d, e * d, 0, 0)) : this.append(e * m, n * m, -n * d, e * d, a, b);
  938. if (l || k)
  939. this.tx -= l * this.a + k * this.c, this.ty -= l * this.b + k * this.d;
  940. return this
  941. };
  942. c.prototype.rotate = function (a) {
  943. var b = Math.cos(a);
  944. a = Math.sin(a);
  945. var m = this.a,
  946. c = this.c,
  947. d = this.tx;
  948. this.a = m * b - this.b * a;
  949. this.b = m * a + this.b * b;
  950. this.c = c * b - this.d * a;
  951. this.d = c * a + this.d * b;
  952. this.tx = d * b - this.ty * a;
  953. this.ty = d * a + this.ty * b;
  954. return this
  955. };
  956. c.prototype.skew = function (a, b) {
  957. a *= c.DEG_TO_RAD;
  958. b *= c.DEG_TO_RAD;
  959. this.append(Math.cos(b), Math.sin(b), -Math.sin(a),
  960. Math.cos(a), 0, 0);
  961. return this
  962. };
  963. c.prototype.scale = function (a, b) {
  964. this.a *= a;
  965. this.d *= b;
  966. this.c *= a;
  967. this.b *= b;
  968. this.tx *= a;
  969. this.ty *= b;
  970. return this
  971. };
  972. c.prototype.translate = function (a, b) {
  973. this.tx += a;
  974. this.ty += b;
  975. return this
  976. };
  977. c.prototype.identity = function () {
  978. this.a = this.d = 1;
  979. this.b = this.c = this.tx = this.ty = 0;
  980. return this
  981. };
  982. c.prototype.invert = function () {
  983. var a = this.a,
  984. b = this.b,
  985. m = this.c,
  986. c = this.d,
  987. d = this.tx,
  988. e = a * c - b * m;
  989. this.a = c / e;
  990. this.b = -b / e;
  991. this.c = -m / e;
  992. this.d = a / e;
  993. this.tx = (m * this.ty - c * d) / e;
  994. this.ty = - (a * this.ty - b * d) / e;
  995. return this
  996. };
  997. c.transformCoords = function (a, b, m) {
  998. var c = d.Point.identity;
  999. c.x = a.a * b + a.c * m + a.tx;
  1000. c.y = a.d * m + a.b * b + a.ty;
  1001. return c
  1002. };
  1003. c.prototype.toArray = function (a) {
  1004. this.array || (this.array = new Float32Array(9));
  1005. 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] =
  1006. 0);
  1007. this.array[8] = 1;
  1008. return this.array
  1009. };
  1010. c.identity = new c;
  1011. c.DEG_TO_RAD = Math.PI / 180;
  1012. return c
  1013. }
  1014. (d.HashObject);
  1015. d.Matrix = e;
  1016. e.prototype.__class__ = "egret.Matrix"
  1017. })(egret || (egret = {}));
  1018. __extends = this.__extends || function (d, e) {
  1019. function f() {
  1020. this.constructor = d
  1021. }
  1022. for (var c in e)
  1023. e.hasOwnProperty(c) && (d[c] = e[c]);
  1024. f.prototype = e.prototype;
  1025. d.prototype = new f
  1026. };
  1027. (function (d) {
  1028. var e = function (d) {
  1029. function c(a, b) {
  1030. "undefined" === typeof a && (a = 0);
  1031. "undefined" === typeof b && (b = 0);
  1032. d.call(this);
  1033. this.x = a;
  1034. this.y = b
  1035. }
  1036. __extends(c, d);
  1037. c.prototype.clone = function () {
  1038. return new c(this.x, this.y)
  1039. };
  1040. c.prototype.equals = function (a) {
  1041. return this.x == a.x && this.y == a.y
  1042. };
  1043. c.distance = function (a, b) {
  1044. return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y))
  1045. };
  1046. c.identity = new c(0, 0);
  1047. return c
  1048. }
  1049. (d.HashObject);
  1050. d.Point = e;
  1051. e.prototype.__class__ = "egret.Point"
  1052. })(egret || (egret = {}));
  1053. __extends = this.__extends || function (d, e) {
  1054. function f() {
  1055. this.constructor = d
  1056. }
  1057. for (var c in e)
  1058. e.hasOwnProperty(c) && (d[c] = e[c]);
  1059. f.prototype = e.prototype;
  1060. d.prototype = new f
  1061. };
  1062. (function (d) {
  1063. var e = function (d) {
  1064. function c(a, b, m, c) {
  1065. "undefined" === typeof a && (a = 0);
  1066. "undefined" === typeof b && (b = 0);
  1067. "undefined" === typeof m && (m = 0);
  1068. "undefined" === typeof c && (c = 0);
  1069. d.call(this);
  1070. this.x = a;
  1071. this.y = b;
  1072. this.width = m;
  1073. this.height = c
  1074. }
  1075. __extends(c, d);
  1076. Object.defineProperty(c.prototype, "right", {
  1077. get : function () {
  1078. return this.x + this.width
  1079. },
  1080. set : function (a) {
  1081. this.width = a - this.x
  1082. },
  1083. enumerable : !0,
  1084. configurable : !0
  1085. });
  1086. Object.defineProperty(c.prototype, "bottom", {
  1087. get : function () {
  1088. return this.y + this.height
  1089. },
  1090. set : function (a) {
  1091. this.height =
  1092. a - this.y
  1093. },
  1094. enumerable : !0,
  1095. configurable : !0
  1096. });
  1097. c.prototype.initialize = function (a, b, m, c) {
  1098. this.x = a;
  1099. this.y = b;
  1100. this.width = m;
  1101. this.height = c;
  1102. return this
  1103. };
  1104. c.prototype.contains = function (a, b) {
  1105. return this.x <= a && this.x + this.width >= a && this.y <= b && this.y + this.height >= b
  1106. };
  1107. c.prototype.intersects = function (a) {
  1108. return this.contains(a.x, a.y) || this.contains(a.x, a.bottom) || this.contains(a.right, a.y) || this.contains(a.right, a.bottom) ? !0 : !1
  1109. };
  1110. c.prototype.clone = function () {
  1111. return new c(this.x, this.y, this.width, this.height)
  1112. };
  1113. c.prototype.containsPoint =
  1114. function (a) {
  1115. return this.x < a.x && this.x + this.width > a.x && this.y < a.y && this.y + this.height > a.y ? !0 : !1
  1116. };
  1117. c.identity = new c(0, 0, 0, 0);
  1118. return c
  1119. }
  1120. (d.HashObject);
  1121. d.Rectangle = e;
  1122. e.prototype.__class__ = "egret.Rectangle"
  1123. })(egret || (egret = {}));
  1124. (function (d) {
  1125. var e = function () {
  1126. function e() {}
  1127. e.fatal = function (c, a) {
  1128. "undefined" === typeof a && (a = null);
  1129. d.Logger.traceToConsole("Fatal", c, a);
  1130. throw Error(d.Logger.getTraceCode("Fatal", c, a));
  1131. };
  1132. e.info = function (c, a) {
  1133. "undefined" === typeof a && (a = null);
  1134. d.Logger.traceToConsole("Info", c, a)
  1135. };
  1136. e.warning = function (c, a) {
  1137. "undefined" === typeof a && (a = null);
  1138. d.Logger.traceToConsole("Warning", c, a)
  1139. };
  1140. e.traceToConsole = function (c, a, b) {
  1141. console.log(d.Logger.getTraceCode(c, a, b))
  1142. };
  1143. e.getTraceCode = function (c, a, b) {
  1144. return "[" + c + "]" + a + ":" +
  1145. (null == b ? "" : b)
  1146. };
  1147. return e
  1148. }
  1149. ();
  1150. d.Logger = e;
  1151. e.prototype.__class__ = "egret.Logger"
  1152. })(egret || (egret = {}));
  1153. __extends = this.__extends || function (d, e) {
  1154. function f() {
  1155. this.constructor = d
  1156. }
  1157. for (var c in e)
  1158. e.hasOwnProperty(c) && (d[c] = e[c]);
  1159. f.prototype = e.prototype;
  1160. d.prototype = new f
  1161. };
  1162. (function (d) {
  1163. var e = function (e) {
  1164. function c() {
  1165. e.call(this);
  1166. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1167. this._xmlDict = {};
  1168. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1169. }
  1170. __extends(c, e);
  1171. c.getInstance = function () {
  1172. c._instance || (c._instance = new c);
  1173. return c._instance
  1174. };
  1175. c.prototype.parserXML = function (a) {
  1176. for (var b = 0; "\n" == a.charAt(b) || "\t" == a.charAt(b) || "\r" == a.charAt(b) || " " == a.charAt(b); )
  1177. b++;
  1178. 0 != b && (a = a.substring(b, a.length));
  1179. this._isSupportDOMParser ?
  1180. b = this._parser.parseFromString(a, "text/xml") : (b = new ActiveXObject("Microsoft.XMLDOM"), b.async = "false", b.loadXML(a));
  1181. null == b && d.Logger.info("xml not found!");
  1182. return b
  1183. };
  1184. c._instance = null;
  1185. return c
  1186. }
  1187. (d.HashObject);
  1188. d.SAXParser = e;
  1189. e.prototype.__class__ = "egret.SAXParser"
  1190. })(egret || (egret = {}));
  1191. __extends = this.__extends || function (d, e) {
  1192. function f() {
  1193. this.constructor = d
  1194. }
  1195. for (var c in e)
  1196. e.hasOwnProperty(c) && (d[c] = e[c]);
  1197. f.prototype = e.prototype;
  1198. d.prototype = new f
  1199. };
  1200. (function (d) {
  1201. var e = function (b) {
  1202. function a() {
  1203. b.call(this);
  1204. this._designHeight = this._designWidth = 0;
  1205. this._scaleY = this._scaleX = 1;
  1206. var c = document.getElementById(a.canvas_name),
  1207. d = c.height;
  1208. this._designWidth = c.width;
  1209. this._designHeight = d
  1210. }
  1211. __extends(a, b);
  1212. a.getInstance = function () {
  1213. null == a.instance && (c.initialize(), a.instance = new a);
  1214. return a.instance
  1215. };
  1216. a.prototype.setDesignSize = function (b, a, m) {
  1217. this._designWidth = b;
  1218. this._designHeight = a;
  1219. m && (d.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1220. this._setResolutionPolicy(m))
  1221. };
  1222. a.prototype._setResolutionPolicy = function (b) {
  1223. this._resolutionPolicy = b;
  1224. b.init(this);
  1225. b._apply(this, this._designWidth, this._designHeight)
  1226. };
  1227. a.prototype.getScaleX = function () {
  1228. return this._scaleX
  1229. };
  1230. a.prototype.getScaleY = function () {
  1231. return this._scaleY
  1232. };
  1233. a.canvas_name = "gameCanvas";
  1234. a.canvas_div_name = "gameDiv";
  1235. return a
  1236. }
  1237. (d.HashObject);
  1238. d.StageDelegate = e;
  1239. e.prototype.__class__ = "egret.StageDelegate";
  1240. var f = function () {
  1241. function a(b, m) {
  1242. this.setContainerStrategy(b);
  1243. this.setContentStrategy(m)
  1244. }
  1245. a.prototype.init = function (b) {
  1246. this._containerStrategy.init(b);
  1247. this._contentStrategy.init(b)
  1248. };
  1249. a.prototype._apply = function (b, a, m) {
  1250. this._containerStrategy._apply(b, a, m);
  1251. this._contentStrategy._apply(b, a, m)
  1252. };
  1253. a.prototype.setContainerStrategy = function (b) {
  1254. b instanceof c && (this._containerStrategy = b)
  1255. };
  1256. a.prototype.setContentStrategy = function (a) {
  1257. a instanceof b && (this._contentStrategy = a)
  1258. };
  1259. return a
  1260. }
  1261. ();
  1262. d.ResolutionPolicy = f;
  1263. f.prototype.__class__ = "egret.ResolutionPolicy";
  1264. var c = function () {
  1265. function b() {}
  1266. b.initialize =
  1267. function () {
  1268. b.EQUAL_TO_FRAME = new a
  1269. };
  1270. b.prototype.init = function (b) {};
  1271. b.prototype._apply = function (b, a, m) {};
  1272. b.prototype._setupContainer = function () {
  1273. var b = document.body,
  1274. a;
  1275. b && (a = b.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight =
  1276. a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1277. };
  1278. return b
  1279. }
  1280. ();
  1281. d.ContainerStrategy = c;
  1282. c.prototype.__class__ = "egret.ContainerStrategy";
  1283. var a = function (b) {
  1284. function a() {
  1285. b.apply(this, arguments)
  1286. }
  1287. __extends(a, b);
  1288. a.prototype._apply = function (b) {
  1289. this._setupContainer()
  1290. };
  1291. return a
  1292. }
  1293. (c);
  1294. d.EqualToFrame = a;
  1295. a.prototype.__class__ = "egret.EqualToFrame";
  1296. var b = function () {
  1297. function b() {}
  1298. b.prototype.init = function (b) {};
  1299. b.prototype._apply = function (b, a, m) {};
  1300. return b
  1301. }
  1302. ();
  1303. d.ContentStrategy =
  1304. b;
  1305. b.prototype.__class__ = "egret.ContentStrategy";
  1306. f = function (b) {
  1307. function a(c) {
  1308. "undefined" === typeof c && (c = 0);
  1309. b.call(this);
  1310. this.minWidth = c
  1311. }
  1312. __extends(a, b);
  1313. a.prototype._apply = function (b, a, m) {
  1314. a = document.getElementById(e.canvas_name);
  1315. var c = document.getElementById(e.canvas_div_name),
  1316. d = document.documentElement.clientWidth,
  1317. u = document.documentElement.clientHeight,
  1318. f = u / m,
  1319. p = d / f,
  1320. r = 1;
  1321. 0 != this.minWidth && (r = Math.min(1, p / this.minWidth));
  1322. a.width = p / r;
  1323. a.height = m;
  1324. a.style.width = d + "px";
  1325. a.style.height = u * r + "px";
  1326. c.style.width =
  1327. d + "px";
  1328. c.style.height = u * r + "px";
  1329. b._scaleX = f * r;
  1330. b._scaleY = f * r
  1331. };
  1332. return a
  1333. }
  1334. (b);
  1335. d.FixedHeight = f;
  1336. f.prototype.__class__ = "egret.FixedHeight";
  1337. f = function (b) {
  1338. function a(c) {
  1339. "undefined" === typeof c && (c = 0);
  1340. b.call(this);
  1341. this.minHeight = c
  1342. }
  1343. __extends(a, b);
  1344. a.prototype._apply = function (b, a, m) {
  1345. m = document.getElementById(e.canvas_name);
  1346. var c = document.getElementById(e.canvas_div_name),
  1347. d = document.documentElement.clientWidth,
  1348. u = document.documentElement.clientHeight,
  1349. f = d / a,
  1350. p = u / f,
  1351. r = 1;
  1352. 0 != this.minHeight && (r = Math.min(1, p / this.minHeight));
  1353. m.width = a;
  1354. m.height = p / r;
  1355. m.style.width = d * r + "px";
  1356. m.style.height = u + "px";
  1357. c.style.width = d * r + "px";
  1358. c.style.height = u + "px";
  1359. b._scaleX = f * r;
  1360. b._scaleY = f * r
  1361. };
  1362. return a
  1363. }
  1364. (b);
  1365. d.FixedWidth = f;
  1366. f.prototype.__class__ = "egret.FixedWidth";
  1367. f = function (b) {
  1368. function a(c, d) {
  1369. b.call(this);
  1370. this.width = c;
  1371. this.height = d
  1372. }
  1373. __extends(a, b);
  1374. a.prototype._apply = function (b, a, m) {
  1375. m = document.getElementById(e.canvas_name);
  1376. var c = document.getElementById(e.canvas_div_name),
  1377. d = this.width,
  1378. u = this.height,
  1379. f = d / a;
  1380. m.width = a;
  1381. m.height = u / f;
  1382. m.style.width = d + "px";
  1383. m.style.height =
  1384. u + "px";
  1385. c.style.width = d + "px";
  1386. c.style.height = u + "px";
  1387. b._scaleX = f;
  1388. b._scaleY = f
  1389. };
  1390. return a
  1391. }
  1392. (b);
  1393. d.FixedSize = f;
  1394. f.prototype.__class__ = "egret.FixedSize";
  1395. f = function (b) {
  1396. function a() {
  1397. b.call(this)
  1398. }
  1399. __extends(a, b);
  1400. a.prototype._apply = function (b, a, m) {
  1401. a = document.getElementById(e.canvas_name);
  1402. a.style.width = a.width + "px";
  1403. a.style.height = a.height + "px";
  1404. b._scaleX = 1;
  1405. b._scaleY = 1
  1406. };
  1407. return a
  1408. }
  1409. (b);
  1410. d.NoScale = f;
  1411. f.prototype.__class__ = "egret.NoScale"
  1412. })(egret || (egret = {}));
  1413. __extends = this.__extends || function (d, e) {
  1414. function f() {
  1415. this.constructor = d
  1416. }
  1417. for (var c in e)
  1418. e.hasOwnProperty(c) && (d[c] = e[c]);
  1419. f.prototype = e.prototype;
  1420. d.prototype = new f
  1421. };
  1422. (function (d) {
  1423. var e = function (e) {
  1424. function c() {
  1425. e.call(this);
  1426. this._originalData = {};
  1427. this._drawAreaList = []
  1428. }
  1429. __extends(c, e);
  1430. c.getInstance = function () {
  1431. null == c.instance && (c.instance = new c);
  1432. return c.instance
  1433. };
  1434. c.prototype.addDrawArea = function (a) {
  1435. this._drawAreaList.push(a)
  1436. };
  1437. c.prototype.clearDrawArea = function () {
  1438. this._drawAreaList = []
  1439. };
  1440. c.prototype.drawImage = function (a, b, m, c, e, f, g, l, k, n) {
  1441. g = g || 0;
  1442. l = l || 0;
  1443. var q = b._texture_to_render;
  1444. if (null != q && 0 != f && 0 != e && 0 != k && 0 != n)
  1445. if (b._worldBounds) {
  1446. var p = this._originalData;
  1447. p.sourceX =
  1448. m;
  1449. p.sourceY = c;
  1450. p.sourceWidth = e;
  1451. p.sourceHeight = f;
  1452. p.destX = g;
  1453. p.destY = l;
  1454. p.destWidth = k;
  1455. p.destHeight = n;
  1456. for (var r = this.getDrawAreaList(), x = 0; x < r.length; x++) {
  1457. var z = r[x];
  1458. if (!this.ignoreRender(b, z, p.destX, p.destY)) {
  1459. if (0 != this._drawAreaList.length)
  1460. if (0 != b._worldTransform.b || 0 != b._worldTransform.c) {
  1461. if (b._worldBounds.x + p.destX < z.x || b._worldBounds.y + p.destY < z.y || b._worldBounds.x + b._worldBounds.width + p.destX > z.x + z.width || b._worldBounds.y + b._worldBounds.height + p.destY > z.y + z.height) {
  1462. d.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1463. break
  1464. }
  1465. } else {
  1466. var v = b._worldTransform.a,
  1467. A = b._worldTransform.d,
  1468. t;
  1469. b._worldBounds.x + p.destX < z.x && (t = (z.x - b._worldBounds.x) / v - p.destX, m += t / (k / e), e -= t / (k / e), k -= t, g += t);
  1470. b._worldBounds.y + p.destY < z.y && (t = (z.y - b._worldBounds.y) / A - p.destY, c += t / (n / f), f -= t / (n / f), n -= t, l += t);
  1471. b._worldBounds.x + b._worldBounds.width + p.destX > z.x + z.width && (t = (b._worldBounds.x + b._worldBounds.width - z.x - z.width) / v + p.destX, e -= t / (k / e), k -= t);
  1472. b._worldBounds.y + b._worldBounds.height + p.destY > z.y + z.height && (t = (b._worldBounds.y + b._worldBounds.height -
  1473. z.y - z.height) / A + p.destY, f -= t / (n / f), n -= t)
  1474. }
  1475. a.drawImage(q, m, c, e, f, g, l, k, n)
  1476. }
  1477. }
  1478. } else
  1479. a.drawImage(q, m, c, e, f, g, l, k, n)
  1480. };
  1481. c.prototype.ignoreRender = function (a, b, m, c) {
  1482. var d = a._worldBounds;
  1483. m *= a._worldTransform.a;
  1484. c *= a._worldTransform.d;
  1485. return d.x + d.width + m <= b.x || d.x + m >= b.x + b.width || d.y + d.height + c <= b.y || d.y + c >= b.y + b.height ? !0 : !1
  1486. };
  1487. c.prototype.getDrawAreaList = function () {
  1488. var a;
  1489. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new d.Rectangle(0, 0, d.MainContext.instance.stage.stageWidth,
  1490. d.MainContext.instance.stage.stageHeight)]), a = this._defaultDrawAreaList) : a = this._drawAreaList;
  1491. return a
  1492. };
  1493. return c
  1494. }
  1495. (d.HashObject);
  1496. d.RenderFilter = e;
  1497. e.prototype.__class__ = "egret.RenderFilter"
  1498. })(egret || (egret = {}));
  1499. (function (d) {
  1500. var e = function () {
  1501. function e() {}
  1502. e.mapClass = function (c, a, b) {
  1503. "undefined" === typeof b && (b = "");
  1504. c = this.getKey(c) + "#" + b;
  1505. this.mapClassDic[c] = a
  1506. };
  1507. e.getKey = function (c) {
  1508. return "string" == typeof c ? c : d.getQualifiedClassName(c)
  1509. };
  1510. e.mapValue = function (c, a, b) {
  1511. "undefined" === typeof b && (b = "");
  1512. c = this.getKey(c) + "#" + b;
  1513. this.mapValueDic[c] = a
  1514. };
  1515. e.hasMapRule = function (c, a) {
  1516. "undefined" === typeof a && (a = "");
  1517. var b = this.getKey(c) + "#" + a;
  1518. return this.mapValueDic[b] || this.mapClassDic[b] ? !0 : !1
  1519. };
  1520. e.getInstance = function (c, a) {
  1521. "undefined" ===
  1522. typeof a && (a = "");
  1523. var b = this.getKey(c) + "#" + a;
  1524. if (this.mapValueDic[b])
  1525. return this.mapValueDic[b];
  1526. var m = this.mapClassDic[b];
  1527. if (m)
  1528. return m = new m, this.mapValueDic[b] = m, delete this.mapClassDic[b], m;
  1529. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + b + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1530. };
  1531. e.mapClassDic = {};
  1532. e.mapValueDic = {};
  1533. return e
  1534. }
  1535. ();
  1536. d.Injector =
  1537. e;
  1538. e.prototype.__class__ = "egret.Injector"
  1539. })(egret || (egret = {}));
  1540. (function (d) {
  1541. var e = function () {
  1542. function d() {}
  1543. d.NORMAL = "normal";
  1544. d.ADD = "add";
  1545. d.LAYER = "layer";
  1546. return d
  1547. }
  1548. ();
  1549. d.BlendMode = e;
  1550. e.prototype.__class__ = "egret.BlendMode"
  1551. })(egret || (egret = {}));
  1552. __extends = this.__extends || function (d, e) {
  1553. function f() {
  1554. this.constructor = d
  1555. }
  1556. for (var c in e)
  1557. e.hasOwnProperty(c) && (d[c] = e[c]);
  1558. f.prototype = e.prototype;
  1559. d.prototype = new f
  1560. };
  1561. (function (d) {
  1562. var e = function (e) {
  1563. function c() {
  1564. e.call(this);
  1565. this._sizeDirty = this._normalDirty = !0;
  1566. this._parent = null;
  1567. this._cacheAsBitmap = !1;
  1568. this._y = this._x = 0;
  1569. this._scaleY = this._scaleX = 1;
  1570. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1571. this._visible = !0;
  1572. this._rotation = 0;
  1573. this._alpha = 1;
  1574. this._skewY = this._skewX = 0;
  1575. this._hasHeightSet = this._hasWidthSet = !1;
  1576. this.worldAlpha = 1;
  1577. this._rectH = this._rectW = 0;
  1578. this._worldTransform = new d.Matrix;
  1579. this._cacheBounds = new d.Rectangle(0, 0, 0, 0)
  1580. }
  1581. __extends(c, e);
  1582. c.prototype._setDirty = function () {
  1583. this._normalDirty = !0
  1584. };
  1585. c.prototype.getDirty = function () {
  1586. return this._normalDirty || this._sizeDirty
  1587. };
  1588. c.prototype._setParentSizeDirty = function () {
  1589. !this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  1590. };
  1591. c.prototype._setSizeDirty = function () {
  1592. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  1593. };
  1594. c.prototype._clearDirty = function () {
  1595. this._normalDirty = !1
  1596. };
  1597. c.prototype._clearSizeDirty = function () {
  1598. this._sizeDirty =
  1599. !1
  1600. };
  1601. Object.defineProperty(c.prototype, "parent", {
  1602. get : function () {
  1603. return this._parent
  1604. },
  1605. enumerable : !0,
  1606. configurable : !0
  1607. });
  1608. c.prototype._parentChanged = function (a) {
  1609. this._parent = a
  1610. };
  1611. Object.defineProperty(c.prototype, "x", {
  1612. get : function () {
  1613. return this._x
  1614. },
  1615. set : function (a) {
  1616. d.NumberUtils.isNumber(a) && (this._x = a, this._setDirty(), this._setParentSizeDirty())
  1617. },
  1618. enumerable : !0,
  1619. configurable : !0
  1620. });
  1621. Object.defineProperty(c.prototype, "y", {
  1622. get : function () {
  1623. return this._y
  1624. },
  1625. set : function (a) {
  1626. d.NumberUtils.isNumber(a) && (this._y = a, this._setDirty(),
  1627. this._setParentSizeDirty())
  1628. },
  1629. enumerable : !0,
  1630. configurable : !0
  1631. });
  1632. Object.defineProperty(c.prototype, "scaleX", {
  1633. get : function () {
  1634. return this._scaleX
  1635. },
  1636. set : function (a) {
  1637. d.NumberUtils.isNumber(a) && (this._scaleX = a, this._setDirty(), this._setParentSizeDirty())
  1638. },
  1639. enumerable : !0,
  1640. configurable : !0
  1641. });
  1642. Object.defineProperty(c.prototype, "scaleY", {
  1643. get : function () {
  1644. return this._scaleY
  1645. },
  1646. set : function (a) {
  1647. d.NumberUtils.isNumber(a) && (this._scaleY = a, this._setDirty(), this._setParentSizeDirty())
  1648. },
  1649. enumerable : !0,
  1650. configurable : !0
  1651. });
  1652. Object.defineProperty(c.prototype,
  1653. "anchorOffsetX", {
  1654. get : function () {
  1655. return this._anchorOffsetX
  1656. },
  1657. set : function (a) {
  1658. d.NumberUtils.isNumber(a) && (this._anchorOffsetX = a, this._setDirty(), this._setParentSizeDirty())
  1659. },
  1660. enumerable : !0,
  1661. configurable : !0
  1662. });
  1663. Object.defineProperty(c.prototype, "anchorOffsetY", {
  1664. get : function () {
  1665. return this._anchorOffsetY
  1666. },
  1667. set : function (a) {
  1668. d.NumberUtils.isNumber(a) && (this._anchorOffsetY = a, this._setDirty(), this._setParentSizeDirty())
  1669. },
  1670. enumerable : !0,
  1671. configurable : !0
  1672. });
  1673. Object.defineProperty(c.prototype, "anchorX", {
  1674. get : function () {
  1675. return this._anchorX
  1676. },
  1677. set : function (a) {
  1678. d.NumberUtils.isNumber(a) && (this._anchorX = a, this._setDirty(), this._setParentSizeDirty())
  1679. },
  1680. enumerable : !0,
  1681. configurable : !0
  1682. });
  1683. Object.defineProperty(c.prototype, "anchorY", {
  1684. get : function () {
  1685. return this._anchorY
  1686. },
  1687. set : function (a) {
  1688. d.NumberUtils.isNumber(a) && (this._anchorY = a, this._setDirty(), this._setParentSizeDirty())
  1689. },
  1690. enumerable : !0,
  1691. configurable : !0
  1692. });
  1693. Object.defineProperty(c.prototype, "visible", {
  1694. get : function () {
  1695. return this._visible
  1696. },
  1697. set : function (a) {
  1698. this._visible = a;
  1699. this._setSizeDirty()
  1700. },
  1701. enumerable : !0,
  1702. configurable : !0
  1703. });
  1704. Object.defineProperty(c.prototype, "rotation", {
  1705. get : function () {
  1706. return this._rotation
  1707. },
  1708. set : function (a) {
  1709. d.NumberUtils.isNumber(a) && (this._rotation = a, this._setSizeDirty())
  1710. },
  1711. enumerable : !0,
  1712. configurable : !0
  1713. });
  1714. Object.defineProperty(c.prototype, "alpha", {
  1715. get : function () {
  1716. return this._alpha
  1717. },
  1718. set : function (a) {
  1719. d.NumberUtils.isNumber(a) && (this._alpha = a, this._setDirty())
  1720. },
  1721. enumerable : !0,
  1722. configurable : !0
  1723. });
  1724. Object.defineProperty(c.prototype, "skewX", {
  1725. get : function () {
  1726. return this._skewX
  1727. },
  1728. set : function (a) {
  1729. d.NumberUtils.isNumber(a) &&
  1730. (this._skewX = a, this._setSizeDirty())
  1731. },
  1732. enumerable : !0,
  1733. configurable : !0
  1734. });
  1735. Object.defineProperty(c.prototype, "skewY", {
  1736. get : function () {
  1737. return this._skewY
  1738. },
  1739. set : function (a) {
  1740. d.NumberUtils.isNumber(a) && (this._skewY = a, this._setSizeDirty())
  1741. },
  1742. enumerable : !0,
  1743. configurable : !0
  1744. });
  1745. Object.defineProperty(c.prototype, "touchEnabled", {
  1746. get : function () {
  1747. return this._touchEnabled
  1748. },
  1749. set : function (a) {
  1750. this._touchEnabled = a
  1751. },
  1752. enumerable : !0,
  1753. configurable : !0
  1754. });
  1755. Object.defineProperty(c.prototype, "scrollRect", {
  1756. get : function () {
  1757. return this._scrollRect
  1758. },
  1759. set : function (a) {
  1760. this._scrollRect = a;
  1761. this._setSizeDirty()
  1762. },
  1763. enumerable : !0,
  1764. configurable : !0
  1765. });
  1766. Object.defineProperty(c.prototype, "measuredWidth", {
  1767. get : function () {
  1768. return this._measureBounds().width
  1769. },
  1770. enumerable : !0,
  1771. configurable : !0
  1772. });
  1773. Object.defineProperty(c.prototype, "measuredHeight", {
  1774. get : function () {
  1775. return this._measureBounds().height
  1776. },
  1777. enumerable : !0,
  1778. configurable : !0
  1779. });
  1780. Object.defineProperty(c.prototype, "explicitWidth", {
  1781. get : function () {
  1782. return this._explicitWidth
  1783. },
  1784. enumerable : !0,
  1785. configurable : !0
  1786. });
  1787. Object.defineProperty(c.prototype,
  1788. "explicitHeight", {
  1789. get : function () {
  1790. return this._explicitHeight
  1791. },
  1792. enumerable : !0,
  1793. configurable : !0
  1794. });
  1795. Object.defineProperty(c.prototype, "width", {
  1796. get : function () {
  1797. return this._getSize(d.Rectangle.identity).width
  1798. },
  1799. set : function (a) {
  1800. this._setWidth(a)
  1801. },
  1802. enumerable : !0,
  1803. configurable : !0
  1804. });
  1805. Object.defineProperty(c.prototype, "height", {
  1806. get : function () {
  1807. return this._getSize(d.Rectangle.identity).height
  1808. },
  1809. set : function (a) {
  1810. this._setHeight(a)
  1811. },
  1812. enumerable : !0,
  1813. configurable : !0
  1814. });
  1815. c.prototype._setWidth = function (a) {
  1816. this._setSizeDirty();
  1817. this._explicitWidth = a;
  1818. this._hasWidthSet = d.NumberUtils.isNumber(a)
  1819. };
  1820. c.prototype._setHeight = function (a) {
  1821. this._setSizeDirty();
  1822. this._explicitHeight = a;
  1823. this._hasHeightSet = d.NumberUtils.isNumber(a)
  1824. };
  1825. c.prototype._draw = function (a) {
  1826. if (this.visible && !this.drawCacheTexture(a)) {
  1827. a.setAlpha(this.worldAlpha, this.blendMode);
  1828. a.setTransform(this._worldTransform);
  1829. var b = this.mask || this._scrollRect;
  1830. b && a.pushMask(b);
  1831. this._render(a);
  1832. b && a.popMask()
  1833. }
  1834. this.destroyCacheBounds()
  1835. };
  1836. c.prototype.drawCacheTexture = function (a) {
  1837. if (this._cacheAsBitmap) {
  1838. var b =
  1839. this._texture_to_render,
  1840. c = b._offsetX,
  1841. e = b._offsetY,
  1842. f = b._textureWidth,
  1843. b = b._textureHeight;
  1844. this._updateTransform();
  1845. a.setAlpha(this.worldAlpha, this.blendMode);
  1846. a.setTransform(this._worldTransform);
  1847. var h = d.MainContext.instance.rendererContext.texture_scale_factor;
  1848. d.RenderFilter.getInstance().drawImage(a, this, 0, 0, f * h, b * h, c, e, f, b);
  1849. return !0
  1850. }
  1851. return !1
  1852. };
  1853. c.prototype._updateTransform = function () {
  1854. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1855. var a = this._getOffsetPoint();
  1856. this._worldTransform.appendTransform(this._x,
  1857. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1858. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1859. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1860. };
  1861. c.prototype._render = function (a) {};
  1862. c.prototype.getBounds = function (a) {
  1863. var b = this._measureBounds(),
  1864. c = this._hasWidthSet ? this._explicitWidth : b.width,
  1865. e = this._hasHeightSet ? this._explicitHeight : b.height,
  1866. f = b.x,
  1867. b = b.y,
  1868. h,
  1869. g;
  1870. 0 != this._anchorX || 0 != this._anchorY ? (h = c * this._anchorX, g = e * this._anchorY) :
  1871. (h = this._anchorOffsetX, g = this._anchorOffsetY);
  1872. this._cacheBounds.initialize(f - h, b - g, c, e);
  1873. c = this._cacheBounds;
  1874. a || (a = new d.Rectangle);
  1875. return a.initialize(c.x, c.y, c.width, c.height)
  1876. };
  1877. c.prototype.destroyCacheBounds = function () {
  1878. this._cacheBounds.x = 0;
  1879. this._cacheBounds.y = 0;
  1880. this._cacheBounds.width = 0;
  1881. this._cacheBounds.height = 0
  1882. };
  1883. c.prototype._getConcatenatedMatrix = function () {
  1884. for (var a = c.identityMatrixForGetConcatenated.identity(), b = this; null != b; ) {
  1885. if (0 != b._anchorX || 0 != b._anchorY) {
  1886. var m = b._getSize(d.Rectangle.identity);
  1887. a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, m.width * b._anchorX, m.height * b._anchorY)
  1888. } else
  1889. a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, b._anchorOffsetX, b._anchorOffsetY);
  1890. b = b._parent
  1891. }
  1892. return a
  1893. };
  1894. c.prototype.localToGlobal = function (a, b, c) {
  1895. "undefined" === typeof a && (a = 0);
  1896. "undefined" === typeof b && (b = 0);
  1897. var e = this._getConcatenatedMatrix();
  1898. e.append(1, 0, 0, 1, a, b);
  1899. c || (c = new d.Point);
  1900. c.x = e.tx;
  1901. c.y = e.ty;
  1902. return c
  1903. };
  1904. c.prototype.globalToLocal = function (a,
  1905. b, c) {
  1906. "undefined" === typeof a && (a = 0);
  1907. "undefined" === typeof b && (b = 0);
  1908. var e = this._getConcatenatedMatrix();
  1909. e.invert();
  1910. e.append(1, 0, 0, 1, a, b);
  1911. c || (c = new d.Point);
  1912. c.x = e.tx;
  1913. c.y = e.ty;
  1914. return c
  1915. };
  1916. c.prototype.hitTest = function (a, b, c) {
  1917. "undefined" === typeof c && (c = !1);
  1918. if (!this.visible || !c && !this._touchEnabled)
  1919. return null;
  1920. c = this._getSize(d.Rectangle.identity);
  1921. return 0 <= a && a < c.width && 0 <= b && b < c.height ? this.mask || this._scrollRect ? this._scrollRect && a < this._scrollRect.width && b < this._scrollRect.height || this.mask && this.mask.x <=
  1922. a && a < this.mask.x + this.mask.width && this.mask.y <= b && b < this.mask.y + this.mask.height ? this : null : this : null
  1923. };
  1924. c.prototype.hitTestPoint = function (a, b, c) {
  1925. a = this.globalToLocal(a, b);
  1926. return c ? (this._hitTestPointTexture || (this._hitTestPointTexture = new d.RenderTexture), c = this._hitTestPointTexture, c.drawToTexture(this), 0 != c.getPixel32(a.x - this._hitTestPointTexture._offsetX, a.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(a.x, a.y, !0)
  1927. };
  1928. c.prototype._getMatrix = function () {
  1929. var a = d.Matrix.identity.identity(),
  1930. b = this._getOffsetPoint();
  1931. a.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, b.x, b.y);
  1932. return a
  1933. };
  1934. c.prototype._getSize = function (a) {
  1935. return this._hasHeightSet && this._hasWidthSet ? a.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(d.Rectangle.identity)
  1936. };
  1937. c.prototype._measureSize = function (a) {
  1938. this._sizeDirty ? (a = this._measureBounds(), this._rectW = a.width, this._rectH = a.height, this._clearSizeDirty()) : (a.width = this._rectW, a.height = this._rectH);
  1939. return a
  1940. };
  1941. c.prototype._measureBounds = function () {
  1942. return d.Rectangle.identity.initialize(0, 0, 0, 0)
  1943. };
  1944. c.prototype._getOffsetPoint = function () {
  1945. var a = this._anchorOffsetX,
  1946. b = this._anchorOffsetY;
  1947. if (0 != this._anchorX || 0 != this._anchorY)
  1948. b = this._getSize(d.Rectangle.identity), a = this._anchorX * b.width, b = this._anchorY * b.height;
  1949. var c = d.Point.identity;
  1950. c.x = a;
  1951. c.y = b;
  1952. return c
  1953. };
  1954. c.prototype._onAddToStage = function () {
  1955. this._stage = d.MainContext.instance.stage;
  1956. d.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1957. };
  1958. c.prototype._onRemoveFromStage =
  1959. function () {
  1960. this._stage = null;
  1961. d.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1962. };
  1963. Object.defineProperty(c.prototype, "stage", {
  1964. get : function () {
  1965. return this._stage
  1966. },
  1967. enumerable : !0,
  1968. configurable : !0
  1969. });
  1970. c.prototype.addEventListener = function (a, b, m, u, y) {
  1971. "undefined" === typeof u && (u = !1);
  1972. "undefined" === typeof y && (y = 0);
  1973. e.prototype.addEventListener.call(this, a, b, m, u, y);
  1974. ((u = a == d.Event.ENTER_FRAME) || a == d.Event.RENDER) && this._insertEventBin(u ? c._enterFrameCallBackList : c._renderCallBackList, b, m, y)
  1975. };
  1976. c.prototype.removeEventListener =
  1977. function (a, b, m, u) {
  1978. "undefined" === typeof u && (u = !1);
  1979. e.prototype.removeEventListener.call(this, a, b, m, u);
  1980. ((u = a == d.Event.ENTER_FRAME) || a == d.Event.RENDER) && this._removeEventBin(u ? c._enterFrameCallBackList : c._renderCallBackList, b, m)
  1981. };
  1982. c.prototype.dispatchEvent = function (a) {
  1983. if (!a._bubbles)
  1984. return e.prototype.dispatchEvent.call(this, a);
  1985. for (var b = [], c = this; c; )
  1986. b.unshift(c), c = c.parent;
  1987. for (var d = b.length, c = d - 1, d = d - 2; 0 <= d; d--)
  1988. b.push(b[d]);
  1989. a._reset();
  1990. this._dispatchPropagationEvent(a, b, c);
  1991. return !a.isDefaultPrevented()
  1992. };
  1993. c.prototype._dispatchPropagationEvent = function (a, b, c) {
  1994. for (var d = b.length, e = 0; e < d; e++) {
  1995. var f = b[e];
  1996. a._setCurrentTarget(f);
  1997. a._target = this;
  1998. a._eventPhase = e < c ? 1 : e == c ? 2 : 3;
  1999. f._notifyListener(a);
  2000. if (a._isPropagationStopped || a._isPropagationImmediateStopped)
  2001. break
  2002. }
  2003. };
  2004. c.prototype.willTrigger = function (a) {
  2005. for (var b = this; b; ) {
  2006. if (b.hasEventListener(a))
  2007. return !0;
  2008. b = b._parent
  2009. }
  2010. return !1
  2011. };
  2012. Object.defineProperty(c.prototype, "cacheAsBitmap", {
  2013. get : function () {
  2014. return this._cacheAsBitmap
  2015. },
  2016. set : function (a) {
  2017. (this._cacheAsBitmap = a) ? (this.renderTexture ||
  2018. (this.renderTexture = new d.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  2019. },
  2020. enumerable : !0,
  2021. configurable : !0
  2022. });
  2023. c.getTransformBounds = function (a, b) {
  2024. var c,
  2025. d,
  2026. e = a.width,
  2027. f = a.height,
  2028. g = e * b.a,
  2029. e = e * b.b,
  2030. l = f * b.c,
  2031. f = f * b.d,
  2032. k = b.tx,
  2033. n = b.ty,
  2034. q = k,
  2035. p = k,
  2036. r = n,
  2037. x = n;
  2038. (c = g + k) < q ? q = c : c > p && (p = c);
  2039. (c = g + l + k) < q ? q = c : c > p && (p = c);
  2040. (c = l + k) < q ? q = c : c > p && (p = c);
  2041. (d = e + n) < r ? r = d : d > x && (x = d);
  2042. (d = e + f + n) < r ? r = d : d > x && (x = d);
  2043. (d = f + n) < r ? r = d : d > x && (x = d);
  2044. return a.initialize(q, r, p - q, x - r)
  2045. };
  2046. c.identityMatrixForGetConcatenated =
  2047. new d.Matrix;
  2048. c._enterFrameCallBackList = [];
  2049. c._renderCallBackList = [];
  2050. return c
  2051. }
  2052. (d.EventDispatcher);
  2053. d.DisplayObject = e;
  2054. e.prototype.__class__ = "egret.DisplayObject"
  2055. })(egret || (egret = {}));
  2056. __extends = this.__extends || function (d, e) {
  2057. function f() {
  2058. this.constructor = d
  2059. }
  2060. for (var c in e)
  2061. e.hasOwnProperty(c) && (d[c] = e[c]);
  2062. f.prototype = e.prototype;
  2063. d.prototype = new f
  2064. };
  2065. (function (d) {
  2066. var e = function (e) {
  2067. function c() {
  2068. e.call(this);
  2069. this._touchChildren = !0;
  2070. this._children = []
  2071. }
  2072. __extends(c, e);
  2073. Object.defineProperty(c.prototype, "touchChildren", {
  2074. get : function () {
  2075. return this._touchChildren
  2076. },
  2077. set : function (a) {
  2078. this._touchChildren = a
  2079. },
  2080. enumerable : !0,
  2081. configurable : !0
  2082. });
  2083. Object.defineProperty(c.prototype, "numChildren", {
  2084. get : function () {
  2085. return this._children.length
  2086. },
  2087. enumerable : !0,
  2088. configurable : !0
  2089. });
  2090. c.prototype.setChildIndex = function (a, b) {
  2091. this.doSetChildIndex(a, b)
  2092. };
  2093. c.prototype.doSetChildIndex = function (a,
  2094. b) {
  2095. var c = this._children.indexOf(a);
  2096. 0 > c && d.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2097. this._children.splice(c, 1);
  2098. 0 > b || this._children.length <= b ? this._children.push(a) : this._children.splice(b, 0, a)
  2099. };
  2100. c.prototype.addChild = function (a) {
  2101. var b = this.numChildren;
  2102. a._parent == this && b--;
  2103. return this._doAddChild(a, b)
  2104. };
  2105. c.prototype.addChildAt = function (a, b) {
  2106. return this._doAddChild(a, b)
  2107. };
  2108. c.prototype._doAddChild = function (a, b, m) {
  2109. "undefined" === typeof m && (m = !0);
  2110. if (a == this)
  2111. return a;
  2112. if (0 > b || b > this._children.length)
  2113. return d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2114. a;
  2115. var e = a.parent;
  2116. if (e == this)
  2117. return this.doSetChildIndex(a, b), a;
  2118. e && e.removeChild(a);
  2119. this._children.splice(b, 0, a);
  2120. a._parentChanged(this);
  2121. m && a.dispatchEventWith(d.Event.ADDED, !0);
  2122. if (this._stage)
  2123. for (a._onAddToStage(), b = c.__EVENT__ADD_TO_STAGE_LIST; 0 < b.length; )
  2124. b.shift().dispatchEventWith(d.Event.ADDED_TO_STAGE);
  2125. a._setDirty();
  2126. this._setSizeDirty();
  2127. return a
  2128. };
  2129. c.prototype.removeChild = function (a) {
  2130. a = this._children.indexOf(a);
  2131. if (0 <= a)
  2132. return this._doRemoveChild(a);
  2133. d.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2134. return null
  2135. };
  2136. c.prototype.removeChildAt = function (a) {
  2137. if (0 <= a && a < this._children.length)
  2138. return this._doRemoveChild(a);
  2139. d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2140. return null
  2141. };
  2142. c.prototype._doRemoveChild = function (a, b) {
  2143. "undefined" === typeof b && (b = !0);
  2144. var m = this._children,
  2145. e = m[a];
  2146. b && e.dispatchEventWith(d.Event.REMOVED, !0);
  2147. if (this._stage) {
  2148. e._onRemoveFromStage();
  2149. for (var f = c.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length; )
  2150. f.shift().dispatchEventWith(d.Event.REMOVED_FROM_STAGE)
  2151. }
  2152. e._parentChanged(null);
  2153. m.splice(a, 1);
  2154. this._setSizeDirty();
  2155. return e
  2156. };
  2157. c.prototype.getChildAt = function (a) {
  2158. if (0 <= a && a < this._children.length)
  2159. return this._children[a];
  2160. d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2161. return null
  2162. };
  2163. c.prototype.contains = function (a) {
  2164. for (; a; ) {
  2165. if (a == this)
  2166. return !0;
  2167. a = a._parent
  2168. }
  2169. return !1
  2170. };
  2171. c.prototype.swapChildrenAt = function (a, b) {
  2172. 0 <= a && a < this._children.length && 0 <= b && b < this._children.length ? this._swapChildrenAt(a, b) : d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2173. };
  2174. c.prototype.swapChildren = function (a, b) {
  2175. var c = this._children.indexOf(a),
  2176. e = this._children.indexOf(b);
  2177. -1 == c || -1 == e ? d.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(c, e)
  2178. };
  2179. c.prototype._swapChildrenAt = function (a, b) {
  2180. if (a != b) {
  2181. var c = this._children,
  2182. d = c[a];
  2183. c[a] = c[b];
  2184. c[b] = d
  2185. }
  2186. };
  2187. c.prototype.getChildIndex = function (a) {
  2188. return this._children.indexOf(a)
  2189. };
  2190. c.prototype.removeChildren = function () {
  2191. for (var a = this._children.length - 1; 0 <= a; a--)
  2192. this._doRemoveChild(a)
  2193. };
  2194. c.prototype._updateTransform =
  2195. function () {
  2196. if (this.visible) {
  2197. e.prototype._updateTransform.call(this);
  2198. for (var a = 0, b = this._children.length; a < b; a++)
  2199. this._children[a]._updateTransform()
  2200. }
  2201. };
  2202. c.prototype._render = function (a) {
  2203. for (var b = 0, c = this._children.length; b < c; b++)
  2204. this._children[b]._draw(a)
  2205. };
  2206. c.prototype._measureBounds = function () {
  2207. for (var a = 0, b = 0, c = 0, e = 0, f = this._children.length, h = 0; h < f; h++) {
  2208. var g = this._children[h],
  2209. l;
  2210. if (g.visible && (l = d.DisplayObject.getTransformBounds(g._getSize(d.Rectangle.identity), g._getMatrix()))) {
  2211. var g = l.x,
  2212. k = l.y,
  2213. n =
  2214. l.width + l.x,
  2215. q = l.height + l.y;
  2216. if (g < a || 0 == h)
  2217. a = g;
  2218. if (n > b || 0 == h)
  2219. b = n;
  2220. if (k < c || 0 == h)
  2221. c = k;
  2222. if (q > e || 0 == h)
  2223. e = q
  2224. }
  2225. }
  2226. return d.Rectangle.identity.initialize(a, c, b - a, e - c)
  2227. };
  2228. c.prototype.hitTest = function (a, b, c) {
  2229. "undefined" === typeof c && (c = !1);
  2230. var u;
  2231. if (!this.visible)
  2232. return null;
  2233. if (this._scrollRect) {
  2234. if (0 > a || 0 > b || a > this._scrollRect.width || b > this._scrollRect.height)
  2235. return null
  2236. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > b || b > this.mask.y + this.mask.height))
  2237. return null;
  2238. for (var y = this._children, h =
  2239. this._touchChildren, g = y.length - 1; 0 <= g; g--) {
  2240. var l = y[g],
  2241. k = l,
  2242. n = k._getOffsetPoint(),
  2243. q = k._x,
  2244. p = k._y;
  2245. this._scrollRect && (q -= this._scrollRect.x, p -= this._scrollRect.y);
  2246. k = d.Matrix.identity.identity().prependTransform(q, p, k._scaleX, k._scaleY, k._rotation, 0, 0, n.x, n.y);
  2247. k.invert();
  2248. k = d.Matrix.transformCoords(k, a, b);
  2249. if (l = l.hitTest(k.x, k.y, !0)) {
  2250. if (l._touchEnabled && h)
  2251. return l;
  2252. if (this._touchEnabled)
  2253. return this;
  2254. null == u && (u = l)
  2255. }
  2256. }
  2257. return u ? u : e.prototype.hitTest.call(this, a, b, c)
  2258. };
  2259. c.prototype._onAddToStage = function () {
  2260. e.prototype._onAddToStage.call(this);
  2261. for (var a = this.numChildren, b = 0; b < a; b++)
  2262. this._children[b]._onAddToStage()
  2263. };
  2264. c.prototype._onRemoveFromStage = function () {
  2265. e.prototype._onRemoveFromStage.call(this);
  2266. for (var a = this.numChildren, b = 0; b < a; b++)
  2267. this._children[b]._onRemoveFromStage()
  2268. };
  2269. c.prototype.getChildByName = function (a) {
  2270. for (var b = this._children, c = this.numChildren, d, e = 0; e < c; e++)
  2271. if (d = b[e], d.name == a)
  2272. return d;
  2273. return null
  2274. };
  2275. c.__EVENT__ADD_TO_STAGE_LIST = [];
  2276. c.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2277. return c
  2278. }
  2279. (d.DisplayObject);
  2280. d.DisplayObjectContainer = e;
  2281. e.prototype.__class__ =
  2282. "egret.DisplayObjectContainer"
  2283. })(egret || (egret = {}));
  2284. __extends = this.__extends || function (d, e) {
  2285. function f() {
  2286. this.constructor = d
  2287. }
  2288. for (var c in e)
  2289. e.hasOwnProperty(c) && (d[c] = e[c]);
  2290. f.prototype = e.prototype;
  2291. d.prototype = new f
  2292. };
  2293. (function (d) {
  2294. var e = function (e) {
  2295. function c(a, b) {
  2296. "undefined" === typeof a && (a = 480);
  2297. "undefined" === typeof b && (b = 800);
  2298. e.call(this);
  2299. this.touchEnabled = !0;
  2300. this._stage = this;
  2301. this._stageWidth = a;
  2302. this._stageHeight = b
  2303. }
  2304. __extends(c, e);
  2305. c.prototype.invalidate = function () {
  2306. c._invalidateRenderFlag = !0
  2307. };
  2308. Object.defineProperty(c.prototype, "scaleMode", {
  2309. get : function () {
  2310. return this._scaleMode
  2311. },
  2312. set : function (a) {
  2313. if (this._scaleMode != a) {
  2314. this._scaleMode = a;
  2315. var b = {};
  2316. b[d.StageScaleMode.NO_SCALE] = new d.NoScale;
  2317. b[d.StageScaleMode.SHOW_ALL] =
  2318. new d.FixedWidth;
  2319. a = b[a];
  2320. if (!a)
  2321. throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2322. b = new d.EqualToFrame;
  2323. a = new d.ResolutionPolicy(b, a);
  2324. d.StageDelegate.getInstance()._setResolutionPolicy(a);
  2325. a = document.getElementById(d.StageDelegate.canvas_name);
  2326. this._stageWidth = a.width;
  2327. this._stageHeight = a.height;
  2328. this.dispatchEventWith(d.Event.RESIZE)
  2329. }
  2330. },
  2331. enumerable : !0,
  2332. configurable : !0
  2333. });
  2334. Object.defineProperty(c.prototype, "stageWidth", {
  2335. get : function () {
  2336. return this._stageWidth
  2337. },
  2338. enumerable : !0,
  2339. configurable : !0
  2340. });
  2341. Object.defineProperty(c.prototype, "stageHeight", {
  2342. get : function () {
  2343. return this._stageHeight
  2344. },
  2345. enumerable : !0,
  2346. configurable : !0
  2347. });
  2348. c.prototype.hitTest = function (a, b) {
  2349. if (!this.touchEnabled)
  2350. return null;
  2351. var c;
  2352. if (!this.visible)
  2353. return this;
  2354. for (var e = this._children, f = e.length - 1; 0 <= f; f--) {
  2355. var h = c = e[f],
  2356. g = h._getOffsetPoint(),
  2357. h = d.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, g.x, g.y);
  2358. h.invert();
  2359. h = d.Matrix.transformCoords(h, a, b);
  2360. if ((c = c.hitTest(h.x, h.y, !0)) && c.touchEnabled)
  2361. return c
  2362. }
  2363. return this
  2364. };
  2365. c.prototype.getBounds = function (a) {
  2366. a || (a = new d.Rectangle);
  2367. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2368. };
  2369. c.prototype._updateTransform = function () {
  2370. for (var a = 0, b = this._children.length; a < b; a++)
  2371. this._children[a]._updateTransform()
  2372. };
  2373. c._invalidateRenderFlag = !1;
  2374. return c
  2375. }
  2376. (d.DisplayObjectContainer);
  2377. d.Stage = e;
  2378. e.prototype.__class__ = "egret.Stage"
  2379. })(egret || (egret = {}));
  2380. (function (d) {
  2381. var e = function () {
  2382. function d() {}
  2383. d.NO_SCALE = "noScale";
  2384. d.SHOW_ALL = "showAll";
  2385. return d
  2386. }
  2387. ();
  2388. d.StageScaleMode = e;
  2389. e.prototype.__class__ = "egret.StageScaleMode"
  2390. })(egret || (egret = {}));
  2391. (function (d) {
  2392. var e = function () {
  2393. function d() {}
  2394. d.REPEAT = "repeat";
  2395. d.SCALE = "scale";
  2396. return d
  2397. }
  2398. ();
  2399. d.BitmapFillMode = e;
  2400. e.prototype.__class__ = "egret.BitmapFillMode"
  2401. })(egret || (egret = {}));
  2402. __extends = this.__extends || function (d, e) {
  2403. function f() {
  2404. this.constructor = d
  2405. }
  2406. for (var c in e)
  2407. e.hasOwnProperty(c) && (d[c] = e[c]);
  2408. f.prototype = e.prototype;
  2409. d.prototype = new f
  2410. };
  2411. (function (d) {
  2412. var e = function (e) {
  2413. function c(a) {
  2414. e.call(this);
  2415. this.debug = !1;
  2416. this.debugColor = 16711680;
  2417. this.fillMode = "scale";
  2418. a && (this._texture = a, this._setSizeDirty())
  2419. }
  2420. __extends(c, e);
  2421. Object.defineProperty(c.prototype, "texture", {
  2422. get : function () {
  2423. return this._texture
  2424. },
  2425. set : function (a) {
  2426. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2427. },
  2428. enumerable : !0,
  2429. configurable : !0
  2430. });
  2431. c.prototype._render = function (a) {
  2432. var b = this._texture;
  2433. b ? (this._texture_to_render = b, c._drawBitmap(a, this._hasWidthSet ? this._explicitWidth : b._textureWidth,
  2434. this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2435. };
  2436. c._drawBitmap = function (a, b, m, e) {
  2437. var f = e._texture_to_render;
  2438. if (f) {
  2439. var h = f._textureWidth,
  2440. g = f._textureHeight;
  2441. if ("scale" == e.fillMode) {
  2442. var l = e.scale9Grid || f.scale9Grid;
  2443. if (l && h - l.width < b && g - l.height < m)
  2444. c.drawScale9GridImage(a, e, l, b, m);
  2445. else {
  2446. var l = f._offsetX,
  2447. k = f._offsetY,
  2448. n = f._bitmapWidth || h,
  2449. q = f._bitmapHeight || g;
  2450. b /= h;
  2451. l = Math.round(l * b);
  2452. b = Math.round(n * b);
  2453. m /= g;
  2454. k = Math.round(k * m);
  2455. m = Math.round(q * m);
  2456. d.RenderFilter.getInstance().drawImage(a,
  2457. e, f._bitmapX, f._bitmapY, n, q, l, k, b, m)
  2458. }
  2459. } else
  2460. c.drawRepeatImage(a, e, b, m)
  2461. }
  2462. };
  2463. c.drawRepeatImage = function (a, b, c, e) {
  2464. var f = b._texture_to_render;
  2465. if (f)
  2466. for (var h = f._textureWidth, g = f._textureHeight, l = f._bitmapX, k = f._bitmapY, n = f._bitmapWidth || h, q = f._bitmapHeight || g, p = f._offsetX, f = f._offsetY, r = d.RenderFilter.getInstance(); p < c; p += h)
  2467. for (var x = f; x < e; x += g) {
  2468. var z = Math.min(n, c - p),
  2469. v = Math.min(q, e - x);
  2470. r.drawImage(a, b, l, k, n, q, p, x, z, v)
  2471. }
  2472. };
  2473. c.drawScale9GridImage = function (a, b, c, e, f) {
  2474. var h = b._texture_to_render;
  2475. if (h && c) {
  2476. var g = d.RenderFilter.getInstance(),
  2477. l = h._textureWidth,
  2478. k = h._textureHeight,
  2479. n = h._bitmapX,
  2480. q = h._bitmapY,
  2481. p = h._bitmapWidth || l,
  2482. r = h._bitmapHeight || k,
  2483. x = h._offsetX,
  2484. h = h._offsetY;
  2485. c = d.Rectangle.identity.initialize(c.x - Math.round(x), c.y - Math.round(x), c.width, c.height);
  2486. x = Math.round(x);
  2487. h = Math.round(h);
  2488. e -= l - p;
  2489. f -= k - r;
  2490. c.y == c.bottom && (c.bottom < r ? c.bottom++ : c.y--);
  2491. c.x == c.right && (c.right < p ? c.right++ : c.x--);
  2492. var l = n + c.x,
  2493. k = n + c.right,
  2494. z = p - c.right,
  2495. v = q + c.y,
  2496. A = q + c.bottom,
  2497. t = r - c.bottom,
  2498. B = x + c.x,
  2499. w = h + c.y,
  2500. r = f - (r - c.bottom),
  2501. p = e - (p - c.right);
  2502. g.drawImage(a, b, n, q, c.x, c.y, x, h,
  2503. c.x, c.y);
  2504. g.drawImage(a, b, l, q, c.width, c.y, B, h, p - c.x, c.y);
  2505. g.drawImage(a, b, k, q, z, c.y, x + p, h, e - p, c.y);
  2506. g.drawImage(a, b, n, v, c.x, c.height, x, w, c.x, r - c.y);
  2507. g.drawImage(a, b, l, v, c.width, c.height, B, w, p - c.x, r - c.y);
  2508. g.drawImage(a, b, k, v, z, c.height, x + p, w, e - p, r - c.y);
  2509. g.drawImage(a, b, n, A, c.x, t, x, h + r, c.x, f - r);
  2510. g.drawImage(a, b, l, A, c.width, t, B, h + r, p - c.x, f - r);
  2511. g.drawImage(a, b, k, A, z, t, x + p, h + r, e - p, f - r)
  2512. }
  2513. };
  2514. c.prototype._measureBounds = function () {
  2515. var a = this._texture;
  2516. return a ? d.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth,
  2517. a._textureHeight) : e.prototype._measureBounds.call(this)
  2518. };
  2519. c.debug = !1;
  2520. return c
  2521. }
  2522. (d.DisplayObject);
  2523. d.Bitmap = e;
  2524. e.prototype.__class__ = "egret.Bitmap"
  2525. })(egret || (egret = {}));
  2526. __extends = this.__extends || function (d, e) {
  2527. function f() {
  2528. this.constructor = d
  2529. }
  2530. for (var c in e)
  2531. e.hasOwnProperty(c) && (d[c] = e[c]);
  2532. f.prototype = e.prototype;
  2533. d.prototype = new f
  2534. };
  2535. (function (d) {
  2536. var e = function (e) {
  2537. function c() {
  2538. e.call(this);
  2539. this._text = "";
  2540. this._textChanged = !1;
  2541. this._bitmapPool = []
  2542. }
  2543. __extends(c, e);
  2544. Object.defineProperty(c.prototype, "text", {
  2545. get : function () {
  2546. return this._text
  2547. },
  2548. set : function (a) {
  2549. this._textChanged = !0;
  2550. this._text = a
  2551. },
  2552. enumerable : !0,
  2553. configurable : !0
  2554. });
  2555. c.prototype._updateTransform = function () {
  2556. this.visible && (this._textChanged && this._renderText(), e.prototype._updateTransform.call(this))
  2557. };
  2558. c.prototype._renderText = function (a) {
  2559. var b = a = 0;
  2560. this._textChanged && this.removeChildren();
  2561. for (var c = 0, e = this.text.length; c < e; c++) {
  2562. var f = this.text.charAt(c),
  2563. h = this.spriteSheet.getTexture(f);
  2564. if (null == h)
  2565. console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + f);
  2566. else {
  2567. var f = h._offsetX,
  2568. g = h._offsetY,
  2569. l = h._textureWidth;
  2570. if (this._textChanged) {
  2571. var k = this._bitmapPool[c];
  2572. k || (k = new d.Bitmap, this._bitmapPool.push(k));
  2573. k.texture = h;
  2574. this.addChild(k);
  2575. k.x = a
  2576. }
  2577. a += l + f;
  2578. g + h._textureHeight > b && (b = g + h._textureHeight)
  2579. }
  2580. }
  2581. this._textChanged = !1;
  2582. return d.Rectangle.identity.initialize(0, 0, a, b)
  2583. };
  2584. c.prototype._measureBounds =
  2585. function () {
  2586. return this._renderText(!0)
  2587. };
  2588. return c
  2589. }
  2590. (d.DisplayObjectContainer);
  2591. d.BitmapText = e;
  2592. e.prototype.__class__ = "egret.BitmapText"
  2593. })(egret || (egret = {}));
  2594. (function (d) {
  2595. var e = function () {
  2596. function d() {
  2597. this.commandQueue = []
  2598. }
  2599. d.prototype.beginFill = function (c, a) {};
  2600. d.prototype._setStyle = function (c) {};
  2601. d.prototype.drawRect = function (c, a, b, m) {};
  2602. d.prototype.drawCircle = function (c, a, b) {};
  2603. d.prototype.lineStyle = function (c, a, b, m, d, e, f, g) {};
  2604. d.prototype.lineTo = function (c, a) {};
  2605. d.prototype.curveTo = function (c, a, b, m) {};
  2606. d.prototype.moveTo = function (c, a) {};
  2607. d.prototype.clear = function () {};
  2608. d.prototype.endFill = function () {};
  2609. d.prototype._draw = function (c) {};
  2610. return d
  2611. }
  2612. ();
  2613. d.Graphics = e;
  2614. e.prototype.__class__ = "egret.Graphics";
  2615. (function () {
  2616. return function (d, c, a) {
  2617. this.method = d;
  2618. this.thisObject = c;
  2619. this.args = a
  2620. }
  2621. })().prototype.__class__ = "Command"
  2622. })(egret || (egret = {}));
  2623. __extends = this.__extends || function (d, e) {
  2624. function f() {
  2625. this.constructor = d
  2626. }
  2627. for (var c in e)
  2628. e.hasOwnProperty(c) && (d[c] = e[c]);
  2629. f.prototype = e.prototype;
  2630. d.prototype = new f
  2631. };
  2632. (function (d) {
  2633. var e = function (e) {
  2634. function c() {
  2635. e.call(this)
  2636. }
  2637. __extends(c, e);
  2638. Object.defineProperty(c.prototype, "graphics", {
  2639. get : function () {
  2640. this._graphics || (this._graphics = new d.Graphics);
  2641. return this._graphics
  2642. },
  2643. enumerable : !0,
  2644. configurable : !0
  2645. });
  2646. c.prototype._render = function (a) {
  2647. this._graphics && this._graphics._draw(a)
  2648. };
  2649. return c
  2650. }
  2651. (d.DisplayObject);
  2652. d.Shape = e;
  2653. e.prototype.__class__ = "egret.Shape"
  2654. })(egret || (egret = {}));
  2655. __extends = this.__extends || function (d, e) {
  2656. function f() {
  2657. this.constructor = d
  2658. }
  2659. for (var c in e)
  2660. e.hasOwnProperty(c) && (d[c] = e[c]);
  2661. f.prototype = e.prototype;
  2662. d.prototype = new f
  2663. };
  2664. (function (d) {
  2665. var e = function (e) {
  2666. function c() {
  2667. e.call(this)
  2668. }
  2669. __extends(c, e);
  2670. Object.defineProperty(c.prototype, "graphics", {
  2671. get : function () {
  2672. this._graphics || (this._graphics = new d.Graphics);
  2673. return this._graphics
  2674. },
  2675. enumerable : !0,
  2676. configurable : !0
  2677. });
  2678. c.prototype._render = function (a) {
  2679. this._graphics && this._graphics._draw(a);
  2680. e.prototype._render.call(this, a)
  2681. };
  2682. return c
  2683. }
  2684. (d.DisplayObjectContainer);
  2685. d.Sprite = e;
  2686. e.prototype.__class__ = "egret.Sprite"
  2687. })(egret || (egret = {}));
  2688. __extends = this.__extends || function (d, e) {
  2689. function f() {
  2690. this.constructor = d
  2691. }
  2692. for (var c in e)
  2693. e.hasOwnProperty(c) && (d[c] = e[c]);
  2694. f.prototype = e.prototype;
  2695. d.prototype = new f
  2696. };
  2697. (function (d) {
  2698. var e = function (e) {
  2699. function c() {
  2700. e.call(this);
  2701. this._fontFamily = "Arial";
  2702. this._size = 30;
  2703. this._textColorString = "#FFFFFF";
  2704. this._textColor = 16777215;
  2705. this._strokeColorString = "#000000";
  2706. this._stroke = this._strokeColor = 0;
  2707. this._textAlign = "left";
  2708. this._verticalAlign = "top";
  2709. this._numLines = this._lineSpacing = 0;
  2710. this.measuredWidths = []
  2711. }
  2712. __extends(c, e);
  2713. Object.defineProperty(c.prototype, "text", {
  2714. get : function () {
  2715. return this._text
  2716. },
  2717. set : function (a) {
  2718. this._text != a && (this._setTextDirty(), this._text = a)
  2719. },
  2720. enumerable : !0,
  2721. configurable : !0
  2722. });
  2723. c.prototype._setTextDirty = function () {
  2724. this._setSizeDirty()
  2725. };
  2726. Object.defineProperty(c.prototype, "fontFamily", {
  2727. get : function () {
  2728. return this._fontFamily
  2729. },
  2730. set : function (a) {
  2731. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  2732. },
  2733. enumerable : !0,
  2734. configurable : !0
  2735. });
  2736. Object.defineProperty(c.prototype, "size", {
  2737. get : function () {
  2738. return this._size
  2739. },
  2740. set : function (a) {
  2741. this._size != a && (this._setTextDirty(), this._size = a)
  2742. },
  2743. enumerable : !0,
  2744. configurable : !0
  2745. });
  2746. Object.defineProperty(c.prototype, "italic", {
  2747. get : function () {
  2748. return this._italic
  2749. },
  2750. set : function (a) {
  2751. this._italic != a && (this._setTextDirty(), this._italic = a)
  2752. },
  2753. enumerable : !0,
  2754. configurable : !0
  2755. });
  2756. Object.defineProperty(c.prototype, "bold", {
  2757. get : function () {
  2758. return this._bold
  2759. },
  2760. set : function (a) {
  2761. this._bold != a && (this._setTextDirty(), this._bold = a)
  2762. },
  2763. enumerable : !0,
  2764. configurable : !0
  2765. });
  2766. Object.defineProperty(c.prototype, "textColor", {
  2767. get : function () {
  2768. return this._textColor
  2769. },
  2770. set : function (a) {
  2771. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = d.toColorString(a))
  2772. },
  2773. enumerable : !0,
  2774. configurable : !0
  2775. });
  2776. Object.defineProperty(c.prototype, "strokeColor", {
  2777. get : function () {
  2778. return this._strokeColor
  2779. },
  2780. set : function (a) {
  2781. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = d.toColorString(a))
  2782. },
  2783. enumerable : !0,
  2784. configurable : !0
  2785. });
  2786. Object.defineProperty(c.prototype, "stroke", {
  2787. get : function () {
  2788. return this._stroke
  2789. },
  2790. set : function (a) {
  2791. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  2792. },
  2793. enumerable : !0,
  2794. configurable : !0
  2795. });
  2796. Object.defineProperty(c.prototype, "textAlign", {
  2797. get : function () {
  2798. return this._textAlign
  2799. },
  2800. set : function (a) {
  2801. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  2802. },
  2803. enumerable : !0,
  2804. configurable : !0
  2805. });
  2806. Object.defineProperty(c.prototype, "verticalAlign", {
  2807. get : function () {
  2808. return this._verticalAlign
  2809. },
  2810. set : function (a) {
  2811. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  2812. },
  2813. enumerable : !0,
  2814. configurable : !0
  2815. });
  2816. Object.defineProperty(c.prototype, "lineSpacing", {
  2817. get : function () {
  2818. return this._lineSpacing
  2819. },
  2820. set : function (a) {
  2821. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  2822. },
  2823. enumerable : !0,
  2824. configurable : !0
  2825. });
  2826. Object.defineProperty(c.prototype, "numLines", {
  2827. get : function () {
  2828. return this._numLines
  2829. },
  2830. enumerable : !0,
  2831. configurable : !0
  2832. });
  2833. c.prototype._render = function (a) {
  2834. this.drawText(a, !1);
  2835. this._clearDirty()
  2836. };
  2837. c.prototype._measureBounds = function () {
  2838. return this.drawText(d.MainContext.instance.rendererContext, !0)
  2839. };
  2840. c.prototype.drawText = function (a, b) {
  2841. var c = this.getTextLines(a);
  2842. if (!c)
  2843. return d.Rectangle.identity.initialize(0, 0, 0, 0);
  2844. var e = c.length,
  2845. f = 0.5 * this._size,
  2846. h = this._size + this._lineSpacing,
  2847. g = e * h - this._lineSpacing;
  2848. this._textHeight = g;
  2849. var l = this._hasHeightSet ? this._explicitHeight : Number.POSITIVE_INFINITY;
  2850. if (this._hasHeightSet && g < l) {
  2851. var k = 0;
  2852. this._verticalAlign == d.VerticalAlign.MIDDLE ? k = 0.5 : this._verticalAlign == d.VerticalAlign.BOTTOM && (k = 1);
  2853. f += k * (l - g)
  2854. }
  2855. var k = f = Math.round(f),
  2856. n = 0;
  2857. this._textAlign == d.HorizontalAlign.CENTER ? n = 0.5 : this._textAlign == d.HorizontalAlign.RIGHT && (n = 1);
  2858. var q = this.measuredWidths,
  2859. p;
  2860. p = this._hasWidthSet ? this._explicitWidth : this._textWidth;
  2861. for (var r = Number.POSITIVE_INFINITY, x = 0; x < e; x++) {
  2862. var z = c[x],
  2863. v = Math.round((p - q[x]) * n);
  2864. v < r && (r = v);
  2865. !b && f < l && a.drawText(this, z, v, f, p);
  2866. f += h
  2867. }
  2868. return d.Rectangle.identity.initialize(r, k, p, g)
  2869. };
  2870. c.prototype.getTextLines = function (a) {
  2871. var b = this.text ? this.text.toString() : "";
  2872. if (!b)
  2873. return null;
  2874. var c = this.measuredWidths;
  2875. c.length = 0;
  2876. a.setupFont(this);
  2877. var b = b.split(/(?:\r\n|\r|\n)/),
  2878. d = b.length,
  2879. e = 0;
  2880. if (this._hasWidthSet)
  2881. for (var f = this._explicitWidth, g = 0; g < d; g++) {
  2882. var l = b[g],
  2883. k = a.measureText(l);
  2884. if (k > f) {
  2885. for (var n = "", q = 0, p = l.length, r = 0; r < p; r++) {
  2886. var x = l.charAt(r),
  2887. k = a.measureText(x);
  2888. q + k > f && (0 == q ? (b.splice(g, 0, x), c[g] = k, e < k && (e = k), k = 0, x = "") : (b.splice(g, 0, n), c[g] = q, e < q && (e = q), n = "", q = 0), g++, d++);
  2889. q += k;
  2890. n += x
  2891. }
  2892. b[g] = n;
  2893. c[g] = q
  2894. } else
  2895. c[g] = k, e < k && (e = k)
  2896. }
  2897. else
  2898. for (g = 0; g < d; g++)
  2899. l = b[g], k = a.measureText(l), c[g] = k, e < k && (e = k);
  2900. this._textWidth = e;
  2901. return b
  2902. };
  2903. return c
  2904. }
  2905. (d.DisplayObject);
  2906. d.TextField = e;
  2907. e.prototype.__class__ = "egret.TextField"
  2908. })(egret || (egret = {}));
  2909. (function (d) {
  2910. var e = function () {
  2911. function d() {}
  2912. d.DYNAMIC = "dynamic";
  2913. d.INPUT = "input";
  2914. return d
  2915. }
  2916. ();
  2917. d.TextFieldType = e;
  2918. e.prototype.__class__ = "egret.TextFieldType"
  2919. })(egret || (egret = {}));
  2920. __extends = this.__extends || function (d, e) {
  2921. function f() {
  2922. this.constructor = d
  2923. }
  2924. for (var c in e)
  2925. e.hasOwnProperty(c) && (d[c] = e[c]);
  2926. f.prototype = e.prototype;
  2927. d.prototype = new f
  2928. };
  2929. (function (d) {
  2930. var e = function (e) {
  2931. function c(a) {
  2932. e.call(this);
  2933. var b = a.bitmapData;
  2934. this.bitmapData = b;
  2935. this._textureMap = {};
  2936. this._sourceWidth = b.width;
  2937. this._sourceHeight = b.height;
  2938. this._bitmapX = a._bitmapX - a._offsetX;
  2939. this._bitmapY = a._bitmapY - a._offsetY
  2940. }
  2941. __extends(c, e);
  2942. c.prototype.getTexture = function (a) {
  2943. return this._textureMap[a]
  2944. };
  2945. c.prototype.createTexture = function (a, b, c, e, f, h, g, l, k) {
  2946. "undefined" === typeof h && (h = 0);
  2947. "undefined" === typeof g && (g = 0);
  2948. "undefined" === typeof l && (l = h + e);
  2949. "undefined" === typeof k && (k = g + f);
  2950. var n =
  2951. new d.Texture;
  2952. n._bitmapData = this.bitmapData;
  2953. n._bitmapX = this._bitmapX + b;
  2954. n._bitmapY = this._bitmapY + c;
  2955. n._bitmapWidth = e;
  2956. n._bitmapHeight = f;
  2957. n._offsetX = h;
  2958. n._offsetY = g;
  2959. n._textureWidth = l;
  2960. n._textureHeight = k;
  2961. n._sourceWidth = this._sourceWidth;
  2962. n._sourceHeight = this._sourceHeight;
  2963. return this._textureMap[a] = n
  2964. };
  2965. return c
  2966. }
  2967. (d.HashObject);
  2968. d.SpriteSheet = e;
  2969. e.prototype.__class__ = "egret.SpriteSheet"
  2970. })(egret || (egret = {}));
  2971. __extends = this.__extends || function (d, e) {
  2972. function f() {
  2973. this.constructor = d
  2974. }
  2975. for (var c in e)
  2976. e.hasOwnProperty(c) && (d[c] = e[c]);
  2977. f.prototype = e.prototype;
  2978. d.prototype = new f
  2979. };
  2980. (function (d) {
  2981. var e = function (e) {
  2982. function c() {
  2983. e.apply(this, arguments);
  2984. this._placeholderText = "";
  2985. this._edFontSize = 14;
  2986. this._textColor = 16711680;
  2987. this._placeholderFontSize = 14;
  2988. this._placeholderColor = 16776960;
  2989. this._preY = this._preX = 0
  2990. }
  2991. __extends(c, e);
  2992. c.prototype._onAddToStage = function () {
  2993. e.prototype._onAddToStage.call(this);
  2994. var a = this.localToGlobal(),
  2995. b = new d.StageText;
  2996. b._open(a.x, a.y, this._explicitWidth, this._explicitHeight);
  2997. this.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2998. this.stageText =
  2999. b
  3000. };
  3001. c.prototype.setText = function (a) {
  3002. this.stageText._setText(a)
  3003. };
  3004. c.prototype.getText = function () {
  3005. return this.stageText._getText()
  3006. };
  3007. c.prototype.setTextType = function (a) {
  3008. this.stageText._setTextType(a)
  3009. };
  3010. c.prototype.getTextType = function () {
  3011. return this.stageText._getTextType()
  3012. };
  3013. c.prototype.onMouseDownHandler = function (a) {};
  3014. c.prototype._onRemoveFromStage = function () {
  3015. this.stageText._remove()
  3016. };
  3017. c.prototype._measureBounds = function () {
  3018. return d.Rectangle.identity
  3019. };
  3020. c.prototype.hitTest = function (a, b, c) {
  3021. return null
  3022. };
  3023. return c
  3024. }
  3025. (d.DisplayObject);
  3026. d.TextInput = e;
  3027. e.prototype.__class__ = "egret.TextInput";
  3028. e = function () {
  3029. function d() {}
  3030. d.prototype.editBoxEditingDidBegin = function (c) {};
  3031. d.prototype.editBoxEditingDidEnd = function (c) {};
  3032. d.prototype.editBoxTextChanged = function (c, a) {};
  3033. d.prototype.editBoxReturn = function (c) {};
  3034. return d
  3035. }
  3036. ();
  3037. d.TextInputDegelete = e;
  3038. e.prototype.__class__ = "egret.TextInputDegelete"
  3039. })(egret || (egret = {}));
  3040. __extends = this.__extends || function (d, e) {
  3041. function f() {
  3042. this.constructor = d
  3043. }
  3044. for (var c in e)
  3045. e.hasOwnProperty(c) && (d[c] = e[c]);
  3046. f.prototype = e.prototype;
  3047. d.prototype = new f
  3048. };
  3049. (function (d) {
  3050. var e = function (d) {
  3051. function c(a, b) {
  3052. d.call(this, a);
  3053. this.charList = this.parseConfig(b)
  3054. }
  3055. __extends(c, d);
  3056. c.prototype.getTexture = function (a) {
  3057. var b = this._textureMap[a];
  3058. if (!b) {
  3059. b = this.charList[a];
  3060. if (!b)
  3061. return null;
  3062. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  3063. this._textureMap[a] = b
  3064. }
  3065. return b
  3066. };
  3067. c.prototype.parseConfig = function (a) {
  3068. a = a.split("\r\n").join("\n");
  3069. a = a.split("\n");
  3070. for (var b = this.getConfigByKey(a[3], "count"), c = {}, d = 4; d < 4 + b; d++) {
  3071. var e = a[d],
  3072. f = String.fromCharCode(this.getConfigByKey(e,
  3073. "id")),
  3074. g = {};
  3075. c[f] = g;
  3076. g.x = this.getConfigByKey(e, "x");
  3077. g.y = this.getConfigByKey(e, "y");
  3078. g.width = this.getConfigByKey(e, "width");
  3079. g.height = this.getConfigByKey(e, "height");
  3080. g.offsetX = this.getConfigByKey(e, "xoffset");
  3081. g.offsetY = this.getConfigByKey(e, "yoffset")
  3082. }
  3083. return c
  3084. };
  3085. c.prototype.getConfigByKey = function (a, b) {
  3086. for (var c = a.split(" "), d = 0, e = c.length; d < e; d++) {
  3087. var f = c[d];
  3088. if (b == f.substring(0, b.length))
  3089. return c = f.substring(b.length + 1), parseInt(c)
  3090. }
  3091. return 0
  3092. };
  3093. return c
  3094. }
  3095. (d.SpriteSheet);
  3096. d.BitmapTextSpriteSheet = e;
  3097. e.prototype.__class__ =
  3098. "egret.BitmapTextSpriteSheet"
  3099. })(egret || (egret = {}));
  3100. __extends = this.__extends || function (d, e) {
  3101. function f() {
  3102. this.constructor = d
  3103. }
  3104. for (var c in e)
  3105. e.hasOwnProperty(c) && (d[c] = e[c]);
  3106. f.prototype = e.prototype;
  3107. d.prototype = new f
  3108. };
  3109. (function (d) {
  3110. var e = function (c) {
  3111. function a(b, a) {
  3112. c.call(this);
  3113. this.frameRate = 60;
  3114. b instanceof f ? (d.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = b) : this.delegate = new f(b, a);
  3115. this.delegate.setMovieClip(this)
  3116. }
  3117. __extends(a, c);
  3118. a.prototype.gotoAndPlay = function (b) {
  3119. this.delegate.gotoAndPlay(b)
  3120. };
  3121. a.prototype.gotoAndStop = function (b) {
  3122. this.delegate.gotoAndStop(b)
  3123. };
  3124. a.prototype.stop =
  3125. function () {
  3126. this.delegate.stop()
  3127. };
  3128. a.prototype.dispose = function () {
  3129. this.delegate.dispose()
  3130. };
  3131. a.prototype.release = function () {
  3132. d.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  3133. this.dispose()
  3134. };
  3135. a.prototype.getCurrentFrameIndex = function () {
  3136. d.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  3137. return this.delegate._currentFrameIndex
  3138. };
  3139. a.prototype.getTotalFrame = function () {
  3140. d.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  3141. return this.delegate._totalFrame
  3142. };
  3143. a.prototype.setInterval = function (b) {
  3144. d.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  3145. this.frameRate = 60 / b
  3146. };
  3147. a.prototype.getIsPlaying = function () {
  3148. d.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  3149. return this.delegate.isPlaying
  3150. };
  3151. return a
  3152. }
  3153. (d.DisplayObjectContainer);
  3154. d.MovieClip = e;
  3155. e.prototype.__class__ = "egret.MovieClip";
  3156. var f = function () {
  3157. function c(a, b) {
  3158. this.data = a;
  3159. this._currentFrameIndex = this._passTime =
  3160. this._totalFrame = 0;
  3161. this._isPlaying = !1;
  3162. this._frameData = a;
  3163. this._spriteSheet = new d.SpriteSheet(b)
  3164. }
  3165. c.prototype.setMovieClip = function (a) {
  3166. this.movieClip = a;
  3167. this.bitmap = new d.Bitmap;
  3168. this.movieClip.addChild(this.bitmap)
  3169. };
  3170. c.prototype.gotoAndPlay = function (a) {
  3171. this.checkHasFrame(a);
  3172. this._isPlaying = !0;
  3173. this._currentFrameIndex = 0;
  3174. this._currentFrameName = a;
  3175. this._totalFrame = this._frameData.frames[a].totalFrame;
  3176. this.playNextFrame();
  3177. this._passTime = 0;
  3178. d.Ticker.getInstance().register(this.update, this)
  3179. };
  3180. c.prototype.gotoAndStop =
  3181. function (a) {
  3182. this.checkHasFrame(a);
  3183. this.stop();
  3184. this._currentFrameIndex = this._passTime = 0;
  3185. this._currentFrameName = a;
  3186. this._totalFrame = this._frameData.frames[a].totalFrame;
  3187. this.playNextFrame()
  3188. };
  3189. c.prototype.stop = function () {
  3190. this._isPlaying = !1;
  3191. d.Ticker.getInstance().unregister(this.update, this)
  3192. };
  3193. c.prototype.dispose = function () {};
  3194. c.prototype.checkHasFrame = function (a) {
  3195. void 0 == this._frameData.frames[a] && d.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  3196. };
  3197. c.prototype.update = function (a) {
  3198. for (var b =
  3199. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b; )
  3200. 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  3201. this._passTime += a
  3202. };
  3203. c.prototype.playNextFrame = function (a) {
  3204. "undefined" === typeof a && (a = !0);
  3205. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  3206. if (a) {
  3207. a = this.getTexture(b.res);
  3208. var c = this.bitmap;
  3209. c.x = b.x;
  3210. c.y = b.y;
  3211. c.texture = a
  3212. }
  3213. null != b.action && this.movieClip.dispatchEventWith(b.action);
  3214. this._currentFrameIndex++;
  3215. this._currentFrameIndex == this._totalFrame &&
  3216. (this._currentFrameIndex = 0)
  3217. };
  3218. c.prototype.getTexture = function (a) {
  3219. var b = this._frameData.res[a],
  3220. c = this._spriteSheet.getTexture(a);
  3221. c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  3222. return c
  3223. };
  3224. return c
  3225. }
  3226. ();
  3227. d.DefaultMovieClipDelegate = f;
  3228. f.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  3229. })(egret || (egret = {}));
  3230. __extends = this.__extends || function (d, e) {
  3231. function f() {
  3232. this.constructor = d
  3233. }
  3234. for (var c in e)
  3235. e.hasOwnProperty(c) && (d[c] = e[c]);
  3236. f.prototype = e.prototype;
  3237. d.prototype = new f
  3238. };
  3239. (function (d) {
  3240. var e = function (e) {
  3241. function c() {
  3242. e.call(this)
  3243. }
  3244. __extends(c, e);
  3245. c.prototype._getText = function () {
  3246. return this.inputElement.value
  3247. };
  3248. c.prototype._setText = function (a) {
  3249. this.inputElement.value = a
  3250. };
  3251. c.prototype._setTextType = function (a) {
  3252. this.inputElement.type = a
  3253. };
  3254. c.prototype._getTextType = function () {
  3255. return this.inputElement.type
  3256. };
  3257. c.prototype._open = function (a, b, c, e) {
  3258. "undefined" === typeof c && (c = 160);
  3259. "undefined" === typeof e && (e = 21);
  3260. var f = d.StageDelegate.getInstance().getScaleX(),
  3261. h = d.StageDelegate.getInstance().getScaleY(),
  3262. g = document.createElement("input");
  3263. g.type = "text";
  3264. g.style.fontSize = "20px";
  3265. g.style.color = "#FFFFFF";
  3266. g.style.borderStyle = "none";
  3267. g.style.background = "none";
  3268. g.style.width = c * f + "px";
  3269. g.style.height = e * h + "px";
  3270. g.style.outline = "medium";
  3271. var l = d.Browser.getInstance().$new("div");
  3272. l.style.position = "absolute";
  3273. l.position.x = a * f;
  3274. l.style.width = c * f + "px";
  3275. l.style.height = e * h + "px";
  3276. l.position.y = b * h;
  3277. l.transforms();
  3278. l.appendChild(g);
  3279. a = d.Browser.getInstance().$("#StageDelegateDiv");
  3280. a || (c = document.getElementById(d.StageDelegate.canvas_div_name),
  3281. e = c.clientHeight, c = c.clientWidth, a = d.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", a.style.position = "absolute", a.style.width = c + "px", a.style.maxHeight = e + "px", a.style.margin = "0px", document.getElementById(d.StageDelegate.canvas_div_name).appendChild(a), a.position.y = -e, a.transforms());
  3282. a.appendChild(l);
  3283. this.div = l;
  3284. this.inputElement = g
  3285. };
  3286. c.prototype._remove = function () {
  3287. var a = this.div;
  3288. a && a.parentNode && a.parentNode.removeChild(a)
  3289. };
  3290. return c
  3291. }
  3292. (d.HashObject);
  3293. d.StageText = e;
  3294. e.prototype.__class__ = "egret.StageText"
  3295. })(egret ||
  3296. (egret = {}));
  3297. (function (d) {
  3298. var e = function () {
  3299. function d() {}
  3300. d.GET = "GET";
  3301. d.POST = "POST";
  3302. return d
  3303. }
  3304. ();
  3305. d.URLRequestMethod = e;
  3306. e.prototype.__class__ = "egret.URLRequestMethod"
  3307. })(egret || (egret = {}));
  3308. (function (d) {
  3309. var e = function () {
  3310. function d() {}
  3311. d.BINARY = "binary";
  3312. d.TEXT = "text";
  3313. d.VARIABLES = "variables";
  3314. d.TEXTURE = "texture";
  3315. d.SOUND = "sound";
  3316. return d
  3317. }
  3318. ();
  3319. d.URLLoaderDataFormat = e;
  3320. e.prototype.__class__ = "egret.URLLoaderDataFormat"
  3321. })(egret || (egret = {}));
  3322. __extends = this.__extends || function (d, e) {
  3323. function f() {
  3324. this.constructor = d
  3325. }
  3326. for (var c in e)
  3327. e.hasOwnProperty(c) && (d[c] = e[c]);
  3328. f.prototype = e.prototype;
  3329. d.prototype = new f
  3330. };
  3331. (function (d) {
  3332. var e = function (d) {
  3333. function c(a) {
  3334. "undefined" === typeof a && (a = null);
  3335. d.call(this);
  3336. null !== a && this.decode(a)
  3337. }
  3338. __extends(c, d);
  3339. c.prototype.decode = function (a) {
  3340. this.variables || (this.variables = {});
  3341. a = a.split("+").join(" ");
  3342. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a); )
  3343. this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  3344. };
  3345. c.prototype.toString = function () {
  3346. if (!this.variables)
  3347. return "";
  3348. var a = this.variables,
  3349. b = "",
  3350. c = !0,
  3351. d;
  3352. for (d in a)
  3353. c ? c = !1 : b += "&", b += d + "=" + a[d];
  3354. return b
  3355. };
  3356. return c
  3357. }
  3358. (d.HashObject);
  3359. d.URLVariables = e;
  3360. e.prototype.__class__ = "egret.URLVariables"
  3361. })(egret || (egret = {}));
  3362. __extends = this.__extends || function (d, e) {
  3363. function f() {
  3364. this.constructor = d
  3365. }
  3366. for (var c in e)
  3367. e.hasOwnProperty(c) && (d[c] = e[c]);
  3368. f.prototype = e.prototype;
  3369. d.prototype = new f
  3370. };
  3371. (function (d) {
  3372. var e = function (e) {
  3373. function c(a) {
  3374. "undefined" === typeof a && (a = null);
  3375. e.call(this);
  3376. this.method = d.URLRequestMethod.GET;
  3377. this.url = a
  3378. }
  3379. __extends(c, e);
  3380. return c
  3381. }
  3382. (d.HashObject);
  3383. d.URLRequest = e;
  3384. e.prototype.__class__ = "egret.URLRequest"
  3385. })(egret || (egret = {}));
  3386. __extends = this.__extends || function (d, e) {
  3387. function f() {
  3388. this.constructor = d
  3389. }
  3390. for (var c in e)
  3391. e.hasOwnProperty(c) && (d[c] = e[c]);
  3392. f.prototype = e.prototype;
  3393. d.prototype = new f
  3394. };
  3395. (function (d) {
  3396. var e = function (e) {
  3397. function c(a) {
  3398. "undefined" === typeof a && (a = null);
  3399. e.call(this);
  3400. this.dataFormat = d.URLLoaderDataFormat.TEXT;
  3401. a && this.load(a)
  3402. }
  3403. __extends(c, e);
  3404. c.prototype.load = function (a) {
  3405. this._request = a;
  3406. this.data = null;
  3407. d.MainContext.instance.netContext.proceed(this)
  3408. };
  3409. return c
  3410. }
  3411. (d.EventDispatcher);
  3412. d.URLLoader = e;
  3413. e.prototype.__class__ = "egret.URLLoader"
  3414. })(egret || (egret = {}));
  3415. __extends = this.__extends || function (d, e) {
  3416. function f() {
  3417. this.constructor = d
  3418. }
  3419. for (var c in e)
  3420. e.hasOwnProperty(c) && (d[c] = e[c]);
  3421. f.prototype = e.prototype;
  3422. d.prototype = new f
  3423. };
  3424. (function (d) {
  3425. var e = function (e) {
  3426. function c() {
  3427. e.call(this);
  3428. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3429. }
  3430. __extends(c, e);
  3431. Object.defineProperty(c.prototype, "textureWidth", {
  3432. get : function () {
  3433. return this._textureWidth
  3434. },
  3435. enumerable : !0,
  3436. configurable : !0
  3437. });
  3438. Object.defineProperty(c.prototype, "textureHeight", {
  3439. get : function () {
  3440. return this._textureHeight
  3441. },
  3442. enumerable : !0,
  3443. configurable : !0
  3444. });
  3445. Object.defineProperty(c.prototype, "bitmapData", {
  3446. get : function () {
  3447. return this._bitmapData
  3448. },
  3449. enumerable : !0,
  3450. configurable : !0
  3451. });
  3452. c.prototype._setBitmapData = function (a) {
  3453. var b = d.MainContext.instance.rendererContext.texture_scale_factor;
  3454. this._bitmapData = a;
  3455. this._sourceWidth = a.width;
  3456. this._sourceHeight = a.height;
  3457. this._textureWidth = this._sourceWidth * b;
  3458. this._textureHeight = this._sourceHeight * b;
  3459. this._bitmapWidth = this._textureWidth;
  3460. this._bitmapHeight = this._textureHeight;
  3461. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3462. };
  3463. c.prototype.getPixel32 = function (a, b) {
  3464. return this._bitmapData.getContext("2d").getImageData(a,
  3465. b, 1, 1).data
  3466. };
  3467. return c
  3468. }
  3469. (d.HashObject);
  3470. d.Texture = e;
  3471. e.prototype.__class__ = "egret.Texture"
  3472. })(egret || (egret = {}));
  3473. __extends = this.__extends || function (d, e) {
  3474. function f() {
  3475. this.constructor = d
  3476. }
  3477. for (var c in e)
  3478. e.hasOwnProperty(c) && (d[c] = e[c]);
  3479. f.prototype = e.prototype;
  3480. d.prototype = new f
  3481. };
  3482. (function (d) {
  3483. var e = function (e) {
  3484. function c() {
  3485. e.call(this);
  3486. this._bitmapData = document.createElement("canvas");
  3487. this.renderContext = d.RendererContext.createRendererContext(this._bitmapData)
  3488. }
  3489. __extends(c, e);
  3490. c.prototype.drawToTexture = function (a) {
  3491. var b = this._bitmapData,
  3492. c = a.getBounds(d.Rectangle.identity);
  3493. b.width = c.width;
  3494. b.height = c.height;
  3495. a._worldTransform.identity();
  3496. a.worldAlpha = 1;
  3497. if (a instanceof d.DisplayObjectContainer) {
  3498. this._offsetX = c.x;
  3499. this._offsetY = c.y;
  3500. a._worldTransform.append(1, 0, 0, 1, -c.x, -c.y);
  3501. for (var b =
  3502. a._children, c = 0, e = b.length; c < e; c++)
  3503. b[c]._updateTransform()
  3504. }
  3505. b = d.RenderFilter.getInstance();
  3506. c = b._drawAreaList.concat();
  3507. b._drawAreaList.length = 0;
  3508. this.renderContext.clearScreen();
  3509. this.webGLTexture = null;
  3510. (e = a.mask || a._scrollRect) && this.renderContext.pushMask(e);
  3511. a._render(this.renderContext);
  3512. e && this.renderContext.popMask();
  3513. b._drawAreaList = c;
  3514. this._textureWidth = this._bitmapData.width;
  3515. this._textureHeight = this._bitmapData.height;
  3516. this._sourceWidth = this._textureWidth;
  3517. this._sourceHeight = this._textureHeight
  3518. };
  3519. return c
  3520. }
  3521. (d.Texture);
  3522. d.RenderTexture = e;
  3523. e.prototype.__class__ = "egret.RenderTexture"
  3524. })(egret || (egret = {}));
  3525. __extends = this.__extends || function (d, e) {
  3526. function f() {
  3527. this.constructor = d
  3528. }
  3529. for (var c in e)
  3530. e.hasOwnProperty(c) && (d[c] = e[c]);
  3531. f.prototype = e.prototype;
  3532. d.prototype = new f
  3533. };
  3534. (function (d) {
  3535. var e = function (e) {
  3536. function c() {
  3537. e.call(this);
  3538. this.renderCost = 0;
  3539. this.texture_scale_factor = 1
  3540. }
  3541. __extends(c, e);
  3542. c.prototype.clearScreen = function () {};
  3543. c.prototype.clearRect = function (a, b, c, d) {};
  3544. c.prototype.drawImage = function (a, b, c, e, f, h, g, l, k) {
  3545. d.Profiler.getInstance().onDrawImage()
  3546. };
  3547. c.prototype.setTransform = function (a) {};
  3548. c.prototype.setAlpha = function (a, b) {};
  3549. c.prototype.setupFont = function (a) {};
  3550. c.prototype.measureText = function (a) {
  3551. return 0
  3552. };
  3553. c.prototype.drawText = function (a, b, c, e, f) {
  3554. d.Profiler.getInstance().onDrawImage()
  3555. };
  3556. c.prototype.strokeRect = function (a, b, c, d, e) {};
  3557. c.prototype.pushMask = function (a) {};
  3558. c.prototype.popMask = function () {};
  3559. c.createRendererContext = function (a) {
  3560. return null
  3561. };
  3562. return c
  3563. }
  3564. (d.HashObject);
  3565. d.RendererContext = e;
  3566. e.prototype.__class__ = "egret.RendererContext"
  3567. })(egret || (egret = {}));
  3568. (function (d) {
  3569. var e = function () {
  3570. function d() {}
  3571. d.MOUSE = "mouse";
  3572. d.TOUCH = "touch";
  3573. d.mode = "touch";
  3574. return d
  3575. }
  3576. ();
  3577. d.InteractionMode = e;
  3578. e.prototype.__class__ = "egret.InteractionMode"
  3579. })(egret || (egret = {}));
  3580. __extends = this.__extends || function (d, e) {
  3581. function f() {
  3582. this.constructor = d
  3583. }
  3584. for (var c in e)
  3585. e.hasOwnProperty(c) && (d[c] = e[c]);
  3586. f.prototype = e.prototype;
  3587. d.prototype = new f
  3588. };
  3589. (function (d) {
  3590. var e = function (e) {
  3591. function c() {
  3592. e.call(this);
  3593. this._currentTouchTarget = {};
  3594. this.maxTouches = 2;
  3595. this.touchDownTarget = {};
  3596. this.lastTouchY = this.lastTouchX = -1
  3597. }
  3598. __extends(c, e);
  3599. c.prototype.run = function () {};
  3600. c.prototype.getTouchData = function (a, b, c) {
  3601. var d = this._currentTouchTarget[a];
  3602. null == d && (d = {}, this._currentTouchTarget[a] = d);
  3603. d.stageX = b;
  3604. d.stageY = c;
  3605. d.identifier = a;
  3606. return d
  3607. };
  3608. c.prototype.dispatchEvent = function (a, b) {
  3609. d.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX, b.stageY, !1, !1, !1, !0 ==
  3610. this.touchDownTarget[b.identifier])
  3611. };
  3612. c.prototype.onTouchBegan = function (a, b, c) {
  3613. var e = d.MainContext.instance.stage.hitTest(a, b);
  3614. e && (a = this.getTouchData(c, a, b), this.touchDownTarget[c] = !0, a.target = e, a.beginTarget = e, this.dispatchEvent(d.TouchEvent.TOUCH_BEGIN, a))
  3615. };
  3616. c.prototype.onTouchMove = function (a, b, c) {
  3617. if (a != this.lastTouchX || b != this.lastTouchY) {
  3618. this.lastTouchX = a;
  3619. this.lastTouchY = b;
  3620. var e = d.MainContext.instance.stage.hitTest(a, b);
  3621. e && (a = this.getTouchData(c, a, b), a.target = e, this.dispatchEvent(d.TouchEvent.TOUCH_MOVE,
  3622. a))
  3623. }
  3624. };
  3625. c.prototype.onTouchEnd = function (a, b, c) {
  3626. var e = d.MainContext.instance.stage.hitTest(a, b);
  3627. e && (a = this.getTouchData(c, a, b), delete this.touchDownTarget[c], c = a.beginTarget, a.target = e, this.dispatchEvent(d.TouchEvent.TOUCH_END, a), c == e ? this.dispatchEvent(d.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(d.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  3628. };
  3629. return c
  3630. }
  3631. (d.HashObject);
  3632. d.TouchContext = e;
  3633. e.prototype.__class__ = "egret.TouchContext"
  3634. })(egret ||
  3635. (egret = {}));
  3636. __extends = this.__extends || function (d, e) {
  3637. function f() {
  3638. this.constructor = d
  3639. }
  3640. for (var c in e)
  3641. e.hasOwnProperty(c) && (d[c] = e[c]);
  3642. f.prototype = e.prototype;
  3643. d.prototype = new f
  3644. };
  3645. (function (d) {
  3646. var e = function (d) {
  3647. function c() {
  3648. d.call(this)
  3649. }
  3650. __extends(c, d);
  3651. c.prototype.proceed = function (a) {};
  3652. return c
  3653. }
  3654. (d.HashObject);
  3655. d.NetContext = e;
  3656. e.prototype.__class__ = "egret.NetContext"
  3657. })(egret || (egret = {}));
  3658. __extends = this.__extends || function (d, e) {
  3659. function f() {
  3660. this.constructor = d
  3661. }
  3662. for (var c in e)
  3663. e.hasOwnProperty(c) && (d[c] = e[c]);
  3664. f.prototype = e.prototype;
  3665. d.prototype = new f
  3666. };
  3667. (function (d) {
  3668. var e = function (d) {
  3669. function c() {
  3670. d.call(this);
  3671. this.frameRate = 60
  3672. }
  3673. __extends(c, d);
  3674. c.prototype.executeMainLoop = function (a, b) {};
  3675. return c
  3676. }
  3677. (d.HashObject);
  3678. d.DeviceContext = e;
  3679. e.prototype.__class__ = "egret.DeviceContext"
  3680. })(egret || (egret = {}));
  3681. __extends = this.__extends || function (d, e) {
  3682. function f() {
  3683. this.constructor = d
  3684. }
  3685. for (var c in e)
  3686. e.hasOwnProperty(c) && (d[c] = e[c]);
  3687. f.prototype = e.prototype;
  3688. d.prototype = new f
  3689. };
  3690. (function (d) {
  3691. var e = function (e) {
  3692. function c() {
  3693. e.call(this);
  3694. this.translate = this.isHD ? function (b) {
  3695. return "translate3d(" + b.x + "px, " + (b.y - d.MainContext.instance.stage.stageHeight) + "px, 0) "
  3696. }
  3697. : function (b) {
  3698. return "translate(" + b.x + "px, " + b.y + "px) "
  3699. };
  3700. this.rotate = this.isHD ? function (b) {
  3701. return "rotateZ(" + b + "deg) "
  3702. }
  3703. : function (b) {
  3704. return "rotate(" + b + "deg) "
  3705. };
  3706. this.ua = navigator.userAgent.toLowerCase();
  3707. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3708. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  3709. this.type = "unknow";
  3710. switch (this.type) {
  3711. case "firefox":
  3712. this.pfx = "Moz";
  3713. this.isHD = !0;
  3714. break;
  3715. case "chrome":
  3716. case "safari":
  3717. this.pfx = "webkit";
  3718. this.isHD = !0;
  3719. break;
  3720. case "opera":
  3721. this.pfx = "O";
  3722. this.isHD = !1;
  3723. break;
  3724. case "ie":
  3725. this.pfx = "ms";
  3726. this.isHD = !1;
  3727. break;
  3728. default:
  3729. this.pfx = "webkit",
  3730. this.isHD = !0
  3731. }
  3732. this.trans = this.pfx + "Transform"
  3733. }
  3734. __extends(c, e);
  3735. c.getInstance = function () {
  3736. null == c.instance && (c.instance = new c);
  3737. return c.instance
  3738. };
  3739. Object.defineProperty(c.prototype,
  3740. "isMobile", {
  3741. get : function () {
  3742. d.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  3743. return d.MainContext.deviceType == d.MainContext.DEVICE_MOBILE
  3744. },
  3745. enumerable : !0,
  3746. configurable : !0
  3747. });
  3748. c.prototype.$new = function (a) {
  3749. return this.$(document.createElement(a))
  3750. };
  3751. c.prototype.$ = function (a) {
  3752. var b = document;
  3753. if (a = a instanceof HTMLElement ? a : b.querySelector(a))
  3754. a.find = a.find ||
  3755. this.$, a.hasClass = a.hasClass || function (b) {
  3756. return this.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  3757. },
  3758. a.addClass = a.addClass || function (b) {
  3759. this.hasClass(b) || (this.className && (this.className += " "), this.className += b);
  3760. return this
  3761. },
  3762. a.removeClass = a.removeClass || function (b) {
  3763. this.hasClass(b) && (this.className = this.className.replace(b, ""));
  3764. return this
  3765. },
  3766. a.remove = a.remove || function () {},
  3767. a.appendTo = a.appendTo || function (b) {
  3768. b.appendChild(this);
  3769. return this
  3770. },
  3771. a.prependTo = a.prependTo || function (b) {
  3772. b.childNodes[0] ?
  3773. b.insertBefore(this, b.childNodes[0]) : b.appendChild(this);
  3774. return this
  3775. },
  3776. a.transforms = a.transforms || function () {
  3777. this.style[c.getInstance().trans] = c.getInstance().translate(this.position) + c.getInstance().rotate(this.rotation) + c.getInstance().scale(this.scale) + c.getInstance().skew(this.skew);
  3778. return this
  3779. },
  3780. a.position = a.position || {
  3781. x : 0,
  3782. y : 0
  3783. },
  3784. a.rotation = a.rotation || 0,
  3785. a.scale = a.scale || {
  3786. x : 1,
  3787. y : 1
  3788. },
  3789. a.skew = a.skew || {
  3790. x : 0,
  3791. y : 0
  3792. },
  3793. a.translates = function (b, a) {
  3794. this.position.x = b;
  3795. this.position.y = a - d.MainContext.instance.stage.stageHeight;
  3796. this.transforms();
  3797. return this
  3798. },
  3799. a.rotate = function (b) {
  3800. this.rotation = b;
  3801. this.transforms();
  3802. return this
  3803. },
  3804. a.resize = function (b, a) {
  3805. this.scale.x = b;
  3806. this.scale.y = a;
  3807. this.transforms();
  3808. return this
  3809. },
  3810. a.setSkew = function (b, a) {
  3811. this.skew.x = b;
  3812. this.skew.y = a;
  3813. this.transforms();
  3814. return this
  3815. };
  3816. return a
  3817. };
  3818. c.prototype.scale = function (a) {
  3819. return "scale(" + a.x + ", " + a.y + ") "
  3820. };
  3821. c.prototype.skew = function (a) {
  3822. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  3823. };
  3824. return c
  3825. }
  3826. (d.HashObject);
  3827. d.Browser = e;
  3828. e.prototype.__class__ = "egret.Browser"
  3829. })(egret || (egret = {}));
  3830. (function (d) {
  3831. var e = function () {
  3832. function e() {}
  3833. e.parse = function (c) {
  3834. c = d.SAXParser.getInstance().parserXML(c);
  3835. if (!c || !c.childNodes)
  3836. return null;
  3837. for (var a = c.childNodes.length, b = !1, m = 0; m < a; m++) {
  3838. var u = c.childNodes[m];
  3839. if (1 == u.nodeType) {
  3840. b = !0;
  3841. break
  3842. }
  3843. }
  3844. return b ? e.parseNode(u) : null
  3845. };
  3846. e.parseNode = function (c) {
  3847. if (!c || 1 != c.nodeType)
  3848. return null;
  3849. var a = {};
  3850. a.localName = c.localName;
  3851. a.name = c.nodeName;
  3852. c.namespaceURI && (a.namespace = c.namespaceURI);
  3853. c.prefix && (a.prefix = c.prefix);
  3854. for (var b = c.attributes, m = b.length, d = 0; d < m; d++) {
  3855. var y = b[d],
  3856. h = y.name;
  3857. 0 != h.indexOf("xmlns:") && (a["$" + h] = y.value)
  3858. }
  3859. b = c.childNodes;
  3860. m = b.length;
  3861. for (d = 0; d < m; d++)
  3862. if (y = e.parseNode(b[d]))
  3863. a.children || (a.children = []), y.parent = a, a.children.push(y);
  3864. !a.children && (c = c.textContent.trim()) && (a.text = c);
  3865. return a
  3866. };
  3867. e.findChildren = function (c, a, b) {
  3868. b ? b.length = 0 : b = [];
  3869. e.findByPath(c, a, b);
  3870. return b
  3871. };
  3872. e.findByPath = function (c, a, b) {
  3873. var m = a.indexOf("."),
  3874. d;
  3875. -1 == m ? (d = a, m = !0) : (d = a.substring(0, m), a = a.substring(m + 1), m = !1);
  3876. if (c = c.children)
  3877. for (var y = c.length, h = 0; h < y; h++) {
  3878. var g = c[h];
  3879. g.localName == d &&
  3880. (m ? b.push(g) : e.findByPath(g, a, b))
  3881. }
  3882. };
  3883. e.getAttributes = function (c, a) {
  3884. a ? a.length = 0 : a = [];
  3885. for (var b in c)
  3886. "$" == b.charAt(0) && a.push(b.substring(1));
  3887. return a
  3888. };
  3889. return e
  3890. }
  3891. ();
  3892. d.XML = e;
  3893. e.prototype.__class__ = "egret.XML"
  3894. })(egret || (egret = {}));
  3895. (function (d) {
  3896. var e = function () {
  3897. function c() {}
  3898. c.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  3899. c.BIG_ENDIAN = "BIG_ENDIAN";
  3900. return c
  3901. }
  3902. ();
  3903. d.Endian = e;
  3904. e.prototype.__class__ = "egret.Endian";
  3905. var f = function () {
  3906. function c() {
  3907. this.length = this.position = 0;
  3908. this._mode = "";
  3909. this.maxlength = 0;
  3910. this._endian = e.LITTLE_ENDIAN;
  3911. this.isLittleEndian = !1;
  3912. this._mode = "Typed array";
  3913. this.maxlength = 4;
  3914. this.arraybytes = new ArrayBuffer(this.maxlength);
  3915. this.unalignedarraybytestemp = new ArrayBuffer(16);
  3916. this.endian = c.DEFAULT_ENDIAN
  3917. }
  3918. Object.defineProperty(c.prototype,
  3919. "endian", {
  3920. get : function () {
  3921. return this._endian
  3922. },
  3923. set : function (a) {
  3924. this._endian = a;
  3925. this.isLittleEndian = a == e.LITTLE_ENDIAN
  3926. },
  3927. enumerable : !0,
  3928. configurable : !0
  3929. });
  3930. c.prototype.ensureWriteableSpace = function (a) {
  3931. this.ensureSpace(a + this.position)
  3932. };
  3933. c.prototype.setArrayBuffer = function (a) {
  3934. this.ensureSpace(a.byteLength);
  3935. this.length = a.byteLength;
  3936. a = new Int8Array(a);
  3937. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  3938. this.position = 0
  3939. };
  3940. Object.defineProperty(c.prototype, "bytesAvailable", {
  3941. get : function () {
  3942. return this.length - this.position
  3943. },
  3944. enumerable : !0,
  3945. configurable : !0
  3946. });
  3947. c.prototype.ensureSpace = function (a) {
  3948. if (a > this.maxlength) {
  3949. a = a + 255 & -256;
  3950. var b = new ArrayBuffer(a),
  3951. c = new Uint8Array(this.arraybytes, 0, this.length);
  3952. (new Uint8Array(b, 0, this.length)).set(c);
  3953. this.arraybytes = b;
  3954. this.maxlength = a
  3955. }
  3956. };
  3957. c.prototype.writeByte = function (a) {
  3958. this.ensureWriteableSpace(1);
  3959. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  3960. this.position > this.length && (this.length = this.position)
  3961. };
  3962. c.prototype.readByte = function () {
  3963. if (this.position >= this.length)
  3964. throw "ByteArray out of bounds read. Positon=" +
  3965. this.position + ", Length=" + this.length;
  3966. return (new Int8Array(this.arraybytes))[this.position++]
  3967. };
  3968. c.prototype.readBytes = function (a, b, c) {
  3969. "undefined" === typeof b && (b = 0);
  3970. "undefined" === typeof c && (c = 0);
  3971. null == c && (c = a.length);
  3972. a.ensureWriteableSpace(b + c);
  3973. var d = new Int8Array(a.arraybytes),
  3974. e = new Int8Array(this.arraybytes);
  3975. d.set(e.subarray(this.position, this.position + c), b);
  3976. this.position += c;
  3977. c + b > a.length && (a.length += c + b - a.length)
  3978. };
  3979. c.prototype.writeUnsignedByte = function (a) {
  3980. this.ensureWriteableSpace(1);
  3981. (new Uint8Array(this.arraybytes))[this.position++] =
  3982. ~~a & 255;
  3983. this.position > this.length && (this.length = this.position)
  3984. };
  3985. c.prototype.readUnsignedByte = function () {
  3986. if (this.position >= this.length)
  3987. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3988. return (new Uint8Array(this.arraybytes))[this.position++]
  3989. };
  3990. c.prototype.writeUnsignedShort = function (a) {
  3991. this.ensureWriteableSpace(2);
  3992. if (0 == (this.position & 1)) {
  3993. var b = new Uint16Array(this.arraybytes);
  3994. b[this.position >> 1] = ~~a & 65535
  3995. } else
  3996. b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] =
  3997. ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  3998. this.position += 2;
  3999. this.position > this.length && (this.length = this.position)
  4000. };
  4001. c.prototype.readUTFBytes = function (a) {
  4002. var b = "";
  4003. a = this.position + a;
  4004. for (var c = new DataView(this.arraybytes); this.position < a; ) {
  4005. var d = c.getUint8(this.position++);
  4006. if (128 > d) {
  4007. if (0 == d)
  4008. break;
  4009. b += String.fromCharCode(d)
  4010. } else if (224 > d)
  4011. b += String.fromCharCode((d & 63) << 6 | c.getUint8(this.position++) & 127);
  4012. else if (240 > d)
  4013. var e = c.getUint8(this.position++),
  4014. b = b + String.fromCharCode((d & 31) << 12 | (e & 127) << 6 | c.getUint8(this.position++) & 127);
  4015. else
  4016. var e = c.getUint8(this.position++), f = c.getUint8(this.position++), b = b + String.fromCharCode((d & 15) << 18 | (e & 127) << 12 | f << 6 & 127 | c.getUint8(this.position++) & 127)
  4017. }
  4018. return b
  4019. };
  4020. c.prototype.readInt = function () {
  4021. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  4022. this.position += 4;
  4023. return a
  4024. };
  4025. c.prototype.readShort = function () {
  4026. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  4027. this.position += 2;
  4028. return a
  4029. };
  4030. c.prototype.readDouble = function () {
  4031. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  4032. this.position += 8;
  4033. return a
  4034. };
  4035. c.prototype.readUnsignedShort = function () {
  4036. if (this.position > this.length + 2)
  4037. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4038. if (0 == (this.position & 1)) {
  4039. var a = new Uint16Array(this.arraybytes),
  4040. b = this.position >> 1;
  4041. this.position += 2;
  4042. return a[b]
  4043. }
  4044. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  4045. b = new Uint8Array(this.arraybytes,
  4046. this.position, 2);
  4047. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  4048. this.position += 2;
  4049. return a[0]
  4050. };
  4051. c.prototype.writeUnsignedInt = function (a) {
  4052. this.ensureWriteableSpace(4);
  4053. if (0 == (this.position & 3)) {
  4054. var b = new Uint32Array(this.arraybytes);
  4055. b[this.position >> 2] = ~~a & 4294967295
  4056. } else
  4057. b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  4058. this.position += 4;
  4059. this.position > this.length &&
  4060. (this.length = this.position)
  4061. };
  4062. c.prototype.readUnsignedInt = function () {
  4063. if (this.position > this.length + 4)
  4064. throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4065. if (0 == (this.position & 3)) {
  4066. var a = new Uint32Array(this.arraybytes),
  4067. b = this.position >> 2;
  4068. this.position += 4;
  4069. return a[b]
  4070. }
  4071. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  4072. b = new Uint8Array(this.arraybytes, this.position, 4);
  4073. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  4074. this.position += 4;
  4075. return a[0]
  4076. };
  4077. c.prototype.writeFloat =
  4078. function (a) {
  4079. this.ensureWriteableSpace(4);
  4080. if (0 == (this.position & 3)) {
  4081. var b = new Float32Array(this.arraybytes);
  4082. b[this.position >> 2] = a
  4083. } else
  4084. b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  4085. this.position += 4;
  4086. this.position > this.length && (this.length = this.position)
  4087. };
  4088. c.prototype.readFloat = function () {
  4089. if (this.position > this.length + 4)
  4090. throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  4091. this.length;
  4092. if (0 == (this.position & 3)) {
  4093. var a = new Float32Array(this.arraybytes),
  4094. b = this.position >> 2;
  4095. this.position += 4;
  4096. return a[b]
  4097. }
  4098. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  4099. b = new Uint8Array(this.arraybytes, this.position, 4);
  4100. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  4101. this.position += 4;
  4102. return a[0]
  4103. };
  4104. c.DEFAULT_ENDIAN = e.BIG_ENDIAN;
  4105. return c
  4106. }
  4107. ();
  4108. d.ByteArray = f;
  4109. f.prototype.__class__ = "egret.ByteArray"
  4110. })(egret || (egret = {}));
  4111. __extends = this.__extends || function (d, e) {
  4112. function f() {
  4113. this.constructor = d
  4114. }
  4115. for (var c in e)
  4116. e.hasOwnProperty(c) && (d[c] = e[c]);
  4117. f.prototype = e.prototype;
  4118. d.prototype = new f
  4119. };
  4120. (function (d) {
  4121. var e = function (e) {
  4122. function c(a, b, c) {
  4123. e.call(this);
  4124. this._target = null;
  4125. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4126. this._actions = this._steps = this.pluginData = null;
  4127. this.paused = !1;
  4128. this.duration = 0;
  4129. this._prevPos = -1;
  4130. this.position = null;
  4131. this._stepPosition = this._prevPosition = 0;
  4132. this.passive = !1;
  4133. this.initialize(a, b, c)
  4134. }
  4135. __extends(c, e);
  4136. c.get = function (a, b, d, e) {
  4137. "undefined" === typeof b && (b = null);
  4138. "undefined" === typeof d && (d = null);
  4139. "undefined" === typeof e && (e = !1);
  4140. e && c.removeTweens(a);
  4141. return new c(a, b, d)
  4142. };
  4143. c.removeTweens = function (a) {
  4144. if (a.tween_count) {
  4145. for (var b = c._tweens, d = b.length - 1; 0 <= d; d--)
  4146. b[d]._target == a && (b[d].paused = !0, b.splice(d, 1));
  4147. a.tween_count = 0
  4148. }
  4149. };
  4150. c.tick = function (a, b) {
  4151. "undefined" === typeof b && (b = !1);
  4152. for (var d = c._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  4153. var f = d[e];
  4154. b && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : a)
  4155. }
  4156. };
  4157. c._register = function (a, b) {
  4158. var m = a._target,
  4159. e = c._tweens;
  4160. if (b)
  4161. m && (m.tween_count = m.tween_count ? m.tween_count + 1 : 1), e.push(a), c._inited || (d.Ticker.getInstance().register(c.tick, null),
  4162. c._inited = !0);
  4163. else
  4164. for (m && m.tween_count--, m = e.length; m--; )
  4165. if (e[m] == a) {
  4166. e.splice(m, 1);
  4167. break
  4168. }
  4169. };
  4170. c.removeAllTweens = function () {
  4171. for (var a = c._tweens, b = 0, d = a.length; b < d; b++) {
  4172. var e = a[b];
  4173. e.paused = !0;
  4174. e._target.tweenjs_count = 0
  4175. }
  4176. a.length = 0
  4177. };
  4178. c.prototype.initialize = function (a, b, d) {
  4179. this._target = a;
  4180. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && c.removeTweens(a));
  4181. this.pluginData = d || {};
  4182. this._curQueueProps = {};
  4183. this._initQueueProps = {};
  4184. this._steps = [];
  4185. this._actions = [];
  4186. b && b.paused ? this.paused = !0 : c._register(this, !0);
  4187. b && null != b.position && this.setPosition(b.position, c.NONE)
  4188. };
  4189. c.prototype.setPosition = function (a, b) {
  4190. "undefined" === typeof b && (b = 1);
  4191. 0 > a && (a = 0);
  4192. var c = a,
  4193. d = !1;
  4194. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  4195. if (c == this._prevPos)
  4196. return d;
  4197. var e = this._prevPos;
  4198. this.position = this._prevPos = c;
  4199. this._prevPosition = a;
  4200. if (this._target)
  4201. if (d)
  4202. this._updateTargetProps(null, 1);
  4203. else if (0 < this._steps.length) {
  4204. for (var f =
  4205. 0, g = this._steps.length; f < g && !(this._steps[f].t > c); f++);
  4206. f = this._steps[f - 1];
  4207. this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
  4208. }
  4209. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
  4210. d && this.setPaused(!0);
  4211. this.dispatchEventWith("change");
  4212. return d
  4213. };
  4214. c.prototype._runActions = function (a, b, c) {
  4215. "undefined" === typeof c && (c = !1);
  4216. var d = a,
  4217. e = b,
  4218. f = -1,
  4219. g = this._actions.length,
  4220. l = 1;
  4221. a > b && (d = b,
  4222. e = a, f = g, g = l = -1);
  4223. for (; (f += l) != g; ) {
  4224. b = this._actions[f];
  4225. var k = b.t;
  4226. (k == e || k > d && k < e || c && k == a) && b.f.apply(b.o, b.p)
  4227. }
  4228. };
  4229. c.prototype._updateTargetProps = function (a, b) {
  4230. var d,
  4231. e,
  4232. f,
  4233. h;
  4234. if (a || 1 != b) {
  4235. if (this.passive = !!a.v)
  4236. return;
  4237. a.e && (b = a.e(b, 0, 1, 1));
  4238. d = a.p0;
  4239. e = a.p1
  4240. } else
  4241. this.passive = !1, d = e = this._curQueueProps;
  4242. for (var g in this._initQueueProps) {
  4243. null == (f = d[g]) && (d[g] = f = this._initQueueProps[g]);
  4244. null == (h = e[g]) && (e[g] = h = f);
  4245. f = f == h || 0 == b || 1 == b || "number" != typeof f ? 1 == b ? h : f : f + (h - f) * b;
  4246. var l = !1;
  4247. if (h = c._plugins[g])
  4248. for (var k = 0, n = h.length; k <
  4249. n; k++) {
  4250. var q = h[k].tween(this, g, f, d, e, b, !!a && d == e, !a);
  4251. q == c.IGNORE ? l = !0 : f = q
  4252. }
  4253. l || (this._target[g] = f)
  4254. }
  4255. };
  4256. c.prototype.setPaused = function (a) {
  4257. this.paused = a;
  4258. c._register(this, !a);
  4259. return this
  4260. };
  4261. c.prototype._cloneProps = function (a) {
  4262. var b = {},
  4263. c;
  4264. for (c in a)
  4265. b[c] = a[c];
  4266. return b
  4267. };
  4268. c.prototype._addStep = function (a) {
  4269. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  4270. return this
  4271. };
  4272. c.prototype._appendQueueProps = function (a) {
  4273. var b,
  4274. d,
  4275. e,
  4276. f,
  4277. h,
  4278. g;
  4279. for (g in a)
  4280. if (void 0 === this._initQueueProps[g]) {
  4281. d = this._target[g];
  4282. if (b = c._plugins[g])
  4283. for (e =
  4284. 0, f = b.length; e < f; e++)
  4285. d = b[e].init(this, g, d);
  4286. this._initQueueProps[g] = this._curQueueProps[g] = void 0 === d ? null : d
  4287. }
  4288. for (g in a) {
  4289. d = this._curQueueProps[g];
  4290. if (b = c._plugins[g])
  4291. for (h = h || {}, e = 0, f = b.length; e < f; e++)
  4292. b[e].step && b[e].step(this, g, d, a[g], h);
  4293. this._curQueueProps[g] = a[g]
  4294. }
  4295. h && this._appendQueueProps(h);
  4296. return this._curQueueProps
  4297. };
  4298. c.prototype._addAction = function (a) {
  4299. a.t = this.duration;
  4300. this._actions.push(a);
  4301. return this
  4302. };
  4303. c.prototype._set = function (a, b) {
  4304. for (var c in a)
  4305. b[c] = a[c]
  4306. };
  4307. c.prototype.wait = function (a, b) {
  4308. if (null ==
  4309. a || 0 >= a)
  4310. return this;
  4311. var c = this._cloneProps(this._curQueueProps);
  4312. return this._addStep({
  4313. d : a,
  4314. p0 : c,
  4315. p1 : c,
  4316. v : b
  4317. })
  4318. };
  4319. c.prototype.to = function (a, b, c) {
  4320. "undefined" === typeof c && (c = void 0);
  4321. if (isNaN(b) || 0 > b)
  4322. b = 0;
  4323. return this._addStep({
  4324. d : b || 0,
  4325. p0 : this._cloneProps(this._curQueueProps),
  4326. e : c,
  4327. p1 : this._cloneProps(this._appendQueueProps(a))
  4328. })
  4329. };
  4330. c.prototype.call = function (a, b, c) {
  4331. "undefined" === typeof b && (b = void 0);
  4332. "undefined" === typeof c && (c = void 0);
  4333. return this._addAction({
  4334. f : a,
  4335. p : c ? c : [],
  4336. o : b ? b : this._target
  4337. })
  4338. };
  4339. c.prototype.set = function (a,
  4340. b) {
  4341. "undefined" === typeof b && (b = null);
  4342. return this._addAction({
  4343. f : this._set,
  4344. o : this,
  4345. p : [a, b ? b : this._target]
  4346. })
  4347. };
  4348. c.prototype.play = function (a) {
  4349. a || (a = this);
  4350. return this.call(a.setPaused, a, [!1])
  4351. };
  4352. c.prototype.pause = function (a) {
  4353. a || (a = this);
  4354. return this.call(a.setPaused, a, [!0])
  4355. };
  4356. c.prototype.tick = function (a) {
  4357. this.paused || this.setPosition(this._prevPosition + a)
  4358. };
  4359. c.NONE = 0;
  4360. c.LOOP = 1;
  4361. c.REVERSE = 2;
  4362. c._tweens = [];
  4363. c.IGNORE = {};
  4364. c._plugins = {};
  4365. c._inited = !1;
  4366. return c
  4367. }
  4368. (d.EventDispatcher);
  4369. d.Tween = e;
  4370. e.prototype.__class__ = "egret.Tween"
  4371. })(egret ||
  4372. (egret = {}));
  4373. (function (d) {
  4374. var e = function () {
  4375. function e() {
  4376. d.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  4377. }
  4378. e.get = function (c) {
  4379. -1 > c && (c = -1);
  4380. 1 < c && (c = 1);
  4381. return function (a) {
  4382. return 0 == c ? a : 0 > c ? a * (a * -c + 1 + c) : a * ((2 - a) * c + (1 - c))
  4383. }
  4384. };
  4385. e.getPowIn = function (c) {
  4386. return function (a) {
  4387. return Math.pow(a, c)
  4388. }
  4389. };
  4390. e.getPowOut = function (c) {
  4391. return function (a) {
  4392. return 1 - Math.pow(1 - a, c)
  4393. }
  4394. };
  4395. e.getPowInOut = function (c) {
  4396. return function (a) {
  4397. return 1 > (a *= 2) ? 0.5 * Math.pow(a, c) : 1 - 0.5 * Math.abs(Math.pow(2 - a, c))
  4398. }
  4399. };
  4400. e.sineIn = function (c) {
  4401. return 1 - Math.cos(c *
  4402. Math.PI / 2)
  4403. };
  4404. e.sineOut = function (c) {
  4405. return Math.sin(c * Math.PI / 2)
  4406. };
  4407. e.sineInOut = function (c) {
  4408. return -0.5 * (Math.cos(Math.PI * c) - 1)
  4409. };
  4410. e.getBackIn = function (c) {
  4411. return function (a) {
  4412. return a * a * ((c + 1) * a - c)
  4413. }
  4414. };
  4415. e.getBackOut = function (c) {
  4416. return function (a) {
  4417. a -= 1;
  4418. return a * a * ((c + 1) * a + c) + 1
  4419. }
  4420. };
  4421. e.getBackInOut = function (c) {
  4422. c *= 1.525;
  4423. return function (a) {
  4424. return 1 > (a *= 2) ? 0.5 * a * a * ((c + 1) * a - c) : 0.5 * ((a -= 2) * a * ((c + 1) * a + c) + 2)
  4425. }
  4426. };
  4427. e.circIn = function (c) {
  4428. return - (Math.sqrt(1 - c * c) - 1)
  4429. };
  4430. e.circOut = function (c) {
  4431. return Math.sqrt(1 - c * c)
  4432. };
  4433. e.circInOut = function (c) {
  4434. return 1 >
  4435. (c *= 2) ? -0.5 * (Math.sqrt(1 - c * c) - 1) : 0.5 * (Math.sqrt(1 - (c -= 2) * c) + 1)
  4436. };
  4437. e.bounceIn = function (c) {
  4438. return 1 - e.bounceOut(1 - c)
  4439. };
  4440. e.bounceOut = function (c) {
  4441. return c < 1 / 2.75 ? 7.5625 * c * c : c < 2 / 2.75 ? 7.5625 * (c -= 1.5 / 2.75) * c + 0.75 : c < 2.5 / 2.75 ? 7.5625 * (c -= 2.25 / 2.75) * c + 0.9375 : 7.5625 * (c -= 2.625 / 2.75) * c + 0.984375
  4442. };
  4443. e.bounceInOut = function (c) {
  4444. return 0.5 > c ? 0.5 * e.bounceIn(2 * c) : 0.5 * e.bounceOut(2 * c - 1) + 0.5
  4445. };
  4446. e.getElasticIn = function (c, a) {
  4447. var b = 2 * Math.PI;
  4448. return function (d) {
  4449. if (0 == d || 1 == d)
  4450. return d;
  4451. var e = a / b * Math.asin(1 / c);
  4452. return - (c * Math.pow(2, 10 *
  4453. (d -= 1)) * Math.sin((d - e) * b / a))
  4454. }
  4455. };
  4456. e.getElasticOut = function (c, a) {
  4457. var b = 2 * Math.PI;
  4458. return function (d) {
  4459. if (0 == d || 1 == d)
  4460. return d;
  4461. var e = a / b * Math.asin(1 / c);
  4462. return c * Math.pow(2, -10 * d) * Math.sin((d - e) * b / a) + 1
  4463. }
  4464. };
  4465. e.getElasticInOut = function (c, a) {
  4466. var b = 2 * Math.PI;
  4467. return function (d) {
  4468. var e = a / b * Math.asin(1 / c);
  4469. return 1 > (d *= 2) ? -0.5 * c * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * b / a) : c * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * b / a) * 0.5 + 1
  4470. }
  4471. };
  4472. e.quadIn = e.getPowIn(2);
  4473. e.quadOut = e.getPowOut(2);
  4474. e.quadInOut = e.getPowInOut(2);
  4475. e.cubicIn = e.getPowIn(3);
  4476. e.cubicOut = e.getPowOut(3);
  4477. e.cubicInOut = e.getPowInOut(3);
  4478. e.quartIn = e.getPowIn(4);
  4479. e.quartOut = e.getPowOut(4);
  4480. e.quartInOut = e.getPowInOut(4);
  4481. e.quintIn = e.getPowIn(5);
  4482. e.quintOut = e.getPowOut(5);
  4483. e.quintInOut = e.getPowInOut(5);
  4484. e.backIn = e.getBackIn(1.7);
  4485. e.backOut = e.getBackOut(1.7);
  4486. e.backInOut = e.getBackInOut(1.7);
  4487. e.elasticIn = e.getElasticIn(1, 0.3);
  4488. e.elasticOut = e.getElasticOut(1, 0.3);
  4489. e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
  4490. return e
  4491. }
  4492. ();
  4493. d.Ease = e;
  4494. e.prototype.__class__ = "egret.Ease"
  4495. })(egret || (egret = {}));
  4496. (function (d) {
  4497. var e = function () {
  4498. function d() {}
  4499. d.prototype.play = function (c) {
  4500. "undefined" === typeof c && (c = !1);
  4501. var a = this.audio;
  4502. a && (isNaN(a.duration) || (a.currentTime = 0), a.loop = c, a.play())
  4503. };
  4504. d.prototype.pause = function () {
  4505. var c = this.audio;
  4506. c && c.pause()
  4507. };
  4508. d.prototype.load = function () {
  4509. var c = this.audio;
  4510. c && c.load()
  4511. };
  4512. d.prototype.addEventListener = function (c, a) {
  4513. this.audio && this.audio.addEventListener(c, a, !1)
  4514. };
  4515. d.prototype.removeEventListener = function (c, a) {
  4516. this.audio && this.audio.removeEventListener(c, a, !1)
  4517. };
  4518. d.prototype.setVolume =
  4519. function (c) {
  4520. var a = this.audio;
  4521. a && (a.volume = c)
  4522. };
  4523. d.prototype.getVolume = function () {
  4524. return this.audio ? this.audio.volume : 0
  4525. };
  4526. return d
  4527. }
  4528. ();
  4529. d.Sound = e;
  4530. e.prototype.__class__ = "egret.Sound"
  4531. })(egret || (egret = {}));
  4532. (function (d) {
  4533. var e = function () {
  4534. function d() {}
  4535. d.isNumber = function (c) {
  4536. return "number" === typeof c && !isNaN(c)
  4537. };
  4538. return d
  4539. }
  4540. ();
  4541. d.NumberUtils = e;
  4542. e.prototype.__class__ = "egret.NumberUtils"
  4543. })(egret || (egret = {}));
  4544. var __extends = this.__extends || function (d, e) {
  4545. function f() {
  4546. this.constructor = d
  4547. }
  4548. for (var c in e)
  4549. e.hasOwnProperty(c) && (d[c] = e[c]);
  4550. f.prototype = e.prototype;
  4551. d.prototype = new f
  4552. }, RES;
  4553. (function (d) {
  4554. var e = function (d) {
  4555. function c(a, b, c) {
  4556. "undefined" === typeof b && (b = !1);
  4557. "undefined" === typeof c && (c = !1);
  4558. d.call(this, a, b, c);
  4559. this.itemsTotal = this.itemsLoaded = 0
  4560. }
  4561. __extends(c, d);
  4562. c.dispatchResourceEvent = function (a, b, d, e, f, h) {
  4563. "undefined" === typeof d && (d = "");
  4564. "undefined" === typeof e && (e = null);
  4565. "undefined" === typeof f && (f = 0);
  4566. "undefined" === typeof h && (h = 0);
  4567. var g = egret.Event._getPropertyData(c);
  4568. g.groupName = d;
  4569. g.resItem = e;
  4570. g.itemsLoaded = f;
  4571. g.itemsTotal = h;
  4572. egret.Event._dispatchByTarget(c, a, b, g)
  4573. };
  4574. c.ITEM_LOAD_ERROR =
  4575. "itemLoadError";
  4576. c.CONFIG_COMPLETE = "configComplete";
  4577. c.GROUP_PROGRESS = "groupProgress";
  4578. c.GROUP_COMPLETE = "groupComplete";
  4579. return c
  4580. }
  4581. (egret.Event);
  4582. d.ResourceEvent = e;
  4583. e.prototype.__class__ = "RES.ResourceEvent"
  4584. })(RES || (RES = {}));
  4585. (function (d) {
  4586. var e = function () {
  4587. function d(c, a, b) {
  4588. this._loaded = !1;
  4589. this.name = c;
  4590. this.url = a;
  4591. this.type = b
  4592. }
  4593. Object.defineProperty(d.prototype, "loaded", {
  4594. get : function () {
  4595. return this.data ? this.data.loaded : this._loaded
  4596. },
  4597. set : function (c) {
  4598. this.data && (this.data.loaded = c);
  4599. this._loaded = c
  4600. },
  4601. enumerable : !0,
  4602. configurable : !0
  4603. });
  4604. d.prototype.toString = function () {
  4605. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  4606. };
  4607. d.TYPE_XML = "xml";
  4608. d.TYPE_IMAGE = "image";
  4609. d.TYPE_BIN = "bin";
  4610. d.TYPE_TEXT = "text";
  4611. d.TYPE_JSON =
  4612. "json";
  4613. d.TYPE_SHEET = "sheet";
  4614. d.TYPE_FONT = "font";
  4615. d.TYPE_SOUND = "sound";
  4616. return d
  4617. }
  4618. ();
  4619. d.ResourceItem = e;
  4620. e.prototype.__class__ = "RES.ResourceItem"
  4621. })(RES || (RES = {}));
  4622. (function (d) {
  4623. var e = function () {
  4624. function e() {
  4625. this.keyMap = {};
  4626. this.groupDic = {}
  4627. }
  4628. e.prototype.getGroupByName = function (c) {
  4629. var a = [];
  4630. if (!this.groupDic[c])
  4631. return a;
  4632. c = this.groupDic[c];
  4633. for (var b = c.length, d = 0; d < b; d++)
  4634. a.push(this.parseResourceItem(c[d]));
  4635. return a
  4636. };
  4637. e.prototype.getRawGroupByName = function (c) {
  4638. return this.groupDic[c] ? this.groupDic[c] : []
  4639. };
  4640. e.prototype.createGroup = function (c, a, b) {
  4641. "undefined" === typeof b && (b = !1);
  4642. if (!b && this.groupDic[c] || !a || 0 == a.length)
  4643. return !1;
  4644. b = this.groupDic;
  4645. for (var d = [], e = a.length, f = 0; f <
  4646. e; f++) {
  4647. var h = a[f],
  4648. g = b[h];
  4649. if (g)
  4650. for (var h = g.length, l = 0; l < h; l++) {
  4651. var k = g[l];
  4652. -1 == d.indexOf(k) && d.push(k)
  4653. }
  4654. else (k = this.keyMap[h]) && -1 == d.indexOf(k) && d.push(k)
  4655. }
  4656. if (0 == d.length)
  4657. return !1;
  4658. this.groupDic[c] = d;
  4659. return !0
  4660. };
  4661. e.prototype.parseConfig = function (c, a) {
  4662. if (c) {
  4663. var b = c.resources;
  4664. if (b)
  4665. for (var d = b.length, e = 0; e < d; e++) {
  4666. var f = b[e],
  4667. h = f.url;
  4668. h && -1 == h.indexOf("://") && (f.url = a + h);
  4669. this.addItemToKeyMap(f)
  4670. }
  4671. if (b = c.groups)
  4672. for (d = b.length, e = 0; e < d; e++) {
  4673. for (var h = b[e], g = [], l = h.keys.split(","), k = l.length, n = 0; n < k; n++)
  4674. f = l[n].trim(),
  4675. (f = this.keyMap[f]) && -1 == g.indexOf(f) && g.push(f);
  4676. this.groupDic[h.name] = g
  4677. }
  4678. }
  4679. };
  4680. e.prototype.addItemToKeyMap = function (c) {
  4681. this.keyMap[c.name] || (this.keyMap[c.name] = c);
  4682. if (c.hasOwnProperty("subkeys")) {
  4683. var a = c.subkeys.split(",");
  4684. c.subkeys = a;
  4685. for (var b = a.length, d = 0; d < b; d++) {
  4686. var e = a[d];
  4687. null == this.keyMap[e] && (this.keyMap[e] = c)
  4688. }
  4689. }
  4690. };
  4691. e.prototype.getName = function (c) {
  4692. return (c = this.keyMap[c]) ? c.name : ""
  4693. };
  4694. e.prototype.getType = function (c) {
  4695. return (c = this.keyMap[c]) ? c.type : ""
  4696. };
  4697. e.prototype.getRawResourceItem = function (c) {
  4698. return this.keyMap[c]
  4699. };
  4700. e.prototype.getResourceItem = function (c) {
  4701. return (c = this.keyMap[c]) ? this.parseResourceItem(c) : null
  4702. };
  4703. e.prototype.parseResourceItem = function (c) {
  4704. var a = new d.ResourceItem(c.name, c.url, c.type);
  4705. a.data = c;
  4706. return a
  4707. };
  4708. return e
  4709. }
  4710. ();
  4711. d.ResourceConfig = e;
  4712. e.prototype.__class__ = "RES.ResourceConfig"
  4713. })(RES || (RES = {}));
  4714. __extends = this.__extends || function (d, e) {
  4715. function f() {
  4716. this.constructor = d
  4717. }
  4718. for (var c in e)
  4719. e.hasOwnProperty(c) && (d[c] = e[c]);
  4720. f.prototype = e.prototype;
  4721. d.prototype = new f
  4722. };
  4723. (function (d) {
  4724. var e = function (e) {
  4725. function c() {
  4726. e.call(this);
  4727. this.thread = 2;
  4728. this.loadingCount = 0;
  4729. this.groupTotalDic = {};
  4730. this.numLoadedDic = {};
  4731. this.itemListDic = {};
  4732. this.priorityQueue = {};
  4733. this.lazyLoadList = [];
  4734. this.analyzerDic = {};
  4735. this.queueIndex = 0
  4736. }
  4737. __extends(c, e);
  4738. c.prototype.isGroupInLoading = function (a) {
  4739. return void 0 !== this.itemListDic[a]
  4740. };
  4741. c.prototype.loadGroup = function (a, b, c) {
  4742. "undefined" === typeof c && (c = 0);
  4743. if (!this.itemListDic[b] && b)
  4744. if (a && 0 != a.length) {
  4745. this.priorityQueue[c] ? this.priorityQueue[c].push(b) : this.priorityQueue[c] =
  4746. [b];
  4747. this.itemListDic[b] = a;
  4748. c = a.length;
  4749. for (var e = 0; e < c; e++)
  4750. a[e].groupName = b;
  4751. this.groupTotalDic[b] = a.length;
  4752. this.numLoadedDic[b] = 0;
  4753. this.next()
  4754. } else
  4755. a = new d.ResourceEvent(d.ResourceEvent.GROUP_COMPLETE), a.groupName = b, this.dispatchEvent(a)
  4756. };
  4757. c.prototype.loadItem = function (a) {
  4758. this.lazyLoadList.push(a);
  4759. a.groupName = "";
  4760. this.next()
  4761. };
  4762. c.prototype.next = function () {
  4763. for (; this.loadingCount < this.thread; ) {
  4764. var a = this.getOneResourceItem();
  4765. if (!a)
  4766. break;
  4767. this.loadingCount++;
  4768. if (a.loaded)
  4769. this.onItemComplete(a);
  4770. else {
  4771. var b = this.analyzerDic[a.type];
  4772. b || (b = this.analyzerDic[a.type] = egret.Injector.getInstance(d.AnalyzerBase, a.type));
  4773. b.loadFile(a, this.onItemComplete, this)
  4774. }
  4775. }
  4776. };
  4777. c.prototype.getOneResourceItem = function () {
  4778. var a = Number.NEGATIVE_INFINITY,
  4779. b;
  4780. for (b in this.priorityQueue)
  4781. a = Math.max(a, b);
  4782. a = this.priorityQueue[a];
  4783. if (!a || 0 == a.length)
  4784. return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  4785. b = a.length;
  4786. for (var c, d = 0; d < b; d++) {
  4787. this.queueIndex >= b && (this.queueIndex = 0);
  4788. c = this.itemListDic[a[this.queueIndex]];
  4789. if (0 < c.length)
  4790. break;
  4791. this.queueIndex++
  4792. }
  4793. return 0 ==
  4794. c.length ? null : c.shift()
  4795. };
  4796. c.prototype.onItemComplete = function (a) {
  4797. this.loadingCount--;
  4798. var b = a.groupName;
  4799. a.loaded || d.ResourceEvent.dispatchResourceEvent(this.resInstance, d.ResourceEvent.ITEM_LOAD_ERROR, b, a);
  4800. if (b) {
  4801. this.numLoadedDic[b]++;
  4802. var c = this.numLoadedDic[b],
  4803. e = this.groupTotalDic[b];
  4804. d.ResourceEvent.dispatchResourceEvent(this.resInstance, d.ResourceEvent.GROUP_PROGRESS, b, a, c, e);
  4805. c == e && (this.removeGroupName(b), delete this.groupTotalDic[b], delete this.numLoadedDic[b], delete this.itemListDic[b], d.ResourceEvent.dispatchResourceEvent(this,
  4806. d.ResourceEvent.GROUP_COMPLETE, b))
  4807. } else
  4808. this.callBack.call(this.resInstance, a);
  4809. this.next()
  4810. };
  4811. c.prototype.removeGroupName = function (a) {
  4812. for (var b in this.priorityQueue) {
  4813. for (var c = this.priorityQueue[b], d = c.length, e = 0, f = !1, d = c.length, g = 0; g < d; g++) {
  4814. if (c[g] == a) {
  4815. c.splice(e, 1);
  4816. f = !0;
  4817. break
  4818. }
  4819. e++
  4820. }
  4821. if (f) {
  4822. 0 == c.length && delete this.priorityQueue[b];
  4823. break
  4824. }
  4825. }
  4826. };
  4827. return c
  4828. }
  4829. (egret.EventDispatcher);
  4830. d.ResourceLoader = e;
  4831. e.prototype.__class__ = "RES.ResourceLoader"
  4832. })(RES || (RES = {}));
  4833. __extends = this.__extends || function (d, e) {
  4834. function f() {
  4835. this.constructor = d
  4836. }
  4837. for (var c in e)
  4838. e.hasOwnProperty(c) && (d[c] = e[c]);
  4839. f.prototype = e.prototype;
  4840. d.prototype = new f
  4841. };
  4842. (function (d) {
  4843. var e = function (d) {
  4844. function c() {
  4845. d.call(this)
  4846. }
  4847. __extends(c, d);
  4848. c.prototype.loadFile = function (a, b, c) {};
  4849. c.prototype.getRes = function (a) {};
  4850. c.prototype.destroyRes = function (a) {
  4851. return !1
  4852. };
  4853. c.getStringPrefix = function (a) {
  4854. if (!a)
  4855. return "";
  4856. var b = a.indexOf(".");
  4857. return -1 != b ? a.substring(0, b) : ""
  4858. };
  4859. c.getStringTail = function (a) {
  4860. if (!a)
  4861. return "";
  4862. var b = a.indexOf(".");
  4863. return -1 != b ? a.substring(b + 1) : ""
  4864. };
  4865. return c
  4866. }
  4867. (egret.HashObject);
  4868. d.AnalyzerBase = e;
  4869. e.prototype.__class__ = "RES.AnalyzerBase"
  4870. })(RES || (RES = {}));
  4871. __extends = this.__extends || function (d, e) {
  4872. function f() {
  4873. this.constructor = d
  4874. }
  4875. for (var c in e)
  4876. e.hasOwnProperty(c) && (d[c] = e[c]);
  4877. f.prototype = e.prototype;
  4878. d.prototype = new f
  4879. };
  4880. (function (d) {
  4881. var e = function (d) {
  4882. function c() {
  4883. d.call(this);
  4884. this.fileDic = {};
  4885. this.resItemDic = [];
  4886. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  4887. this.recycler = new egret.Recycler
  4888. }
  4889. __extends(c, d);
  4890. c.prototype.loadFile = function (a, b, c) {
  4891. if (this.fileDic[a.name])
  4892. b.call(c, a);
  4893. else {
  4894. var d = this.getLoader();
  4895. this.resItemDic[d.hashCode] = {
  4896. item : a,
  4897. func : b,
  4898. thisObject : c
  4899. };
  4900. d.load(new egret.URLRequest(a.url))
  4901. }
  4902. };
  4903. c.prototype.getLoader = function () {
  4904. var a = this.recycler.pop();
  4905. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  4906. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  4907. a.dataFormat = this._dataFormat;
  4908. return a
  4909. };
  4910. c.prototype.onLoadFinish = function (a) {
  4911. var b = a.target,
  4912. c = this.resItemDic[b.hashCode];
  4913. delete this.resItemDic[b.hashCode];
  4914. this.recycler.push(b);
  4915. var d = c.item,
  4916. e = c.func;
  4917. d.loaded = a.type == egret.Event.COMPLETE;
  4918. d.loaded && this.analyzeData(d, b.data);
  4919. e.call(c.thisObject, d)
  4920. };
  4921. c.prototype.analyzeData = function (a, b) {
  4922. var c = a.name;
  4923. !this.fileDic[c] && b && (this.fileDic[c] = b)
  4924. };
  4925. c.prototype.getRes =
  4926. function (a) {
  4927. return this.fileDic[a]
  4928. };
  4929. c.prototype.hasRes = function (a) {
  4930. return null != this.getRes(a)
  4931. };
  4932. c.prototype.destroyRes = function (a) {
  4933. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  4934. };
  4935. return c
  4936. }
  4937. (d.AnalyzerBase);
  4938. d.BinAnalyzer = e;
  4939. e.prototype.__class__ = "RES.BinAnalyzer"
  4940. })(RES || (RES = {}));
  4941. __extends = this.__extends || function (d, e) {
  4942. function f() {
  4943. this.constructor = d
  4944. }
  4945. for (var c in e)
  4946. e.hasOwnProperty(c) && (d[c] = e[c]);
  4947. f.prototype = e.prototype;
  4948. d.prototype = new f
  4949. };
  4950. (function (d) {
  4951. var e = function (d) {
  4952. function c() {
  4953. d.call(this);
  4954. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  4955. }
  4956. __extends(c, d);
  4957. c.prototype.analyzeData = function (a, b) {
  4958. var c = a.name;
  4959. !this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  4960. };
  4961. return c
  4962. }
  4963. (d.BinAnalyzer);
  4964. d.ImageAnalyzer = e;
  4965. e.prototype.__class__ = "RES.ImageAnalyzer"
  4966. })(RES || (RES = {}));
  4967. __extends = this.__extends || function (d, e) {
  4968. function f() {
  4969. this.constructor = d
  4970. }
  4971. for (var c in e)
  4972. e.hasOwnProperty(c) && (d[c] = e[c]);
  4973. f.prototype = e.prototype;
  4974. d.prototype = new f
  4975. };
  4976. (function (d) {
  4977. var e = function (d) {
  4978. function c() {
  4979. d.call(this);
  4980. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4981. }
  4982. __extends(c, d);
  4983. c.prototype.analyzeData = function (a, b) {
  4984. var c = a.name;
  4985. if (!this.fileDic[c] && b)
  4986. try {
  4987. this.fileDic[c] = JSON.parse(b)
  4988. } catch (d) {
  4989. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4990. }
  4991. };
  4992. return c
  4993. }
  4994. (d.BinAnalyzer);
  4995. d.JsonAnalyzer = e;
  4996. e.prototype.__class__ = "RES.JsonAnalyzer"
  4997. })(RES || (RES = {}));
  4998. __extends = this.__extends || function (d, e) {
  4999. function f() {
  5000. this.constructor = d
  5001. }
  5002. for (var c in e)
  5003. e.hasOwnProperty(c) && (d[c] = e[c]);
  5004. f.prototype = e.prototype;
  5005. d.prototype = new f
  5006. };
  5007. (function (d) {
  5008. var e = function (d) {
  5009. function c() {
  5010. d.call(this);
  5011. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5012. }
  5013. __extends(c, d);
  5014. return c
  5015. }
  5016. (d.BinAnalyzer);
  5017. d.TextAnalyzer = e;
  5018. e.prototype.__class__ = "RES.TextAnalyzer"
  5019. })(RES || (RES = {}));
  5020. __extends = this.__extends || function (d, e) {
  5021. function f() {
  5022. this.constructor = d
  5023. }
  5024. for (var c in e)
  5025. e.hasOwnProperty(c) && (d[c] = e[c]);
  5026. f.prototype = e.prototype;
  5027. d.prototype = new f
  5028. };
  5029. (function (d) {
  5030. var e = function (e) {
  5031. function c() {
  5032. e.call(this);
  5033. this.sheetMap = {};
  5034. this.textureMap = {};
  5035. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5036. }
  5037. __extends(c, e);
  5038. c.prototype.getRes = function (a) {
  5039. var b = this.fileDic[a];
  5040. b || (b = this.textureMap[a]);
  5041. !b && (b = d.AnalyzerBase.getStringPrefix(a), b = this.fileDic[b]) && (a = d.AnalyzerBase.getStringTail(a), b = b.getTexture(a));
  5042. return b
  5043. };
  5044. c.prototype.onLoadFinish = function (a) {
  5045. var b = a.target,
  5046. c = this.resItemDic[b.hashCode];
  5047. delete this.resItemDic[b.hashCode];
  5048. this.recycler.push(b);
  5049. var d =
  5050. c.item,
  5051. e = c.func;
  5052. d.loaded = a.type == egret.Event.COMPLETE;
  5053. d.loaded && this.analyzeData(d, b.data);
  5054. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, e, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : e.call(c.thisObject, d)
  5055. };
  5056. c.prototype.analyzeData = function (a, b) {
  5057. var c = a.name;
  5058. if (!this.fileDic[c] && b) {
  5059. var d;
  5060. if ("string" == typeof b) {
  5061. try {
  5062. d = JSON.parse(b)
  5063. } catch (e) {
  5064. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  5065. }
  5066. d && (this.sheetMap[c] =
  5067. d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  5068. } else
  5069. d = this.sheetMap[c], delete this.sheetMap[c], b && (d = this.parseSpriteSheet(b, d), this.fileDic[c] = d)
  5070. }
  5071. };
  5072. c.prototype.getRelativePath = function (a, b) {
  5073. a = a.split("\\").join("/");
  5074. var c = a.lastIndexOf("/");
  5075. return a = -1 != c ? a.substring(0, c + 1) + b : b
  5076. };
  5077. c.prototype.parseSpriteSheet = function (a, b) {
  5078. var c = b.frames;
  5079. if (!c)
  5080. return null;
  5081. var d = new egret.SpriteSheet(a),
  5082. e = this.textureMap,
  5083. f;
  5084. for (f in c) {
  5085. var g = c[f];
  5086. a = d.createTexture(f, g.x, g.y, g.w, g.h, g.offX, g.offY, g.sourceW, g.sourceH);
  5087. null == e[f] && (e[f] = a)
  5088. }
  5089. return d
  5090. };
  5091. return c
  5092. }
  5093. (d.BinAnalyzer);
  5094. d.SheetAnalyzer = e;
  5095. e.prototype.__class__ = "RES.SheetAnalyzer"
  5096. })(RES || (RES = {}));
  5097. __extends = this.__extends || function (d, e) {
  5098. function f() {
  5099. this.constructor = d
  5100. }
  5101. for (var c in e)
  5102. e.hasOwnProperty(c) && (d[c] = e[c]);
  5103. f.prototype = e.prototype;
  5104. d.prototype = new f
  5105. };
  5106. (function (d) {
  5107. var e = function (d) {
  5108. function c() {
  5109. d.call(this)
  5110. }
  5111. __extends(c, d);
  5112. c.prototype.analyzeData = function (a, b) {
  5113. var c = a.name;
  5114. if (!this.fileDic[c] && b) {
  5115. var d;
  5116. "string" == typeof b ? (d = b, this.sheetMap[c] = d, a.loaded = !1, a.url = this.getTexturePath(a.url, d)) : (d = this.sheetMap[c], delete this.sheetMap[c], b && (d = new egret.BitmapTextSpriteSheet(b, d), this.fileDic[c] = d))
  5117. }
  5118. };
  5119. c.prototype.getTexturePath = function (a, b) {
  5120. var c = "",
  5121. d = b.split("\n")[2],
  5122. e = d.indexOf('file="');
  5123. -1 != e && (d = d.substring(e + 6), e = d.indexOf('"'), c = d.substring(0,
  5124. e));
  5125. a = a.split("\\").join("/");
  5126. e = a.lastIndexOf("/");
  5127. return a = -1 != e ? a.substring(0, e + 1) + c : c
  5128. };
  5129. return c
  5130. }
  5131. (d.SheetAnalyzer);
  5132. d.FontAnalyzer = e;
  5133. e.prototype.__class__ = "RES.FontAnalyzer"
  5134. })(RES || (RES = {}));
  5135. __extends = this.__extends || function (d, e) {
  5136. function f() {
  5137. this.constructor = d
  5138. }
  5139. for (var c in e)
  5140. e.hasOwnProperty(c) && (d[c] = e[c]);
  5141. f.prototype = e.prototype;
  5142. d.prototype = new f
  5143. };
  5144. (function (d) {
  5145. var e = function (d) {
  5146. function c() {
  5147. d.call(this);
  5148. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  5149. }
  5150. __extends(c, d);
  5151. return c
  5152. }
  5153. (d.BinAnalyzer);
  5154. d.SoundAnalyzer = e;
  5155. e.prototype.__class__ = "RES.SoundAnalyzer"
  5156. })(RES || (RES = {}));
  5157. __extends = this.__extends || function (d, e) {
  5158. function f() {
  5159. this.constructor = d
  5160. }
  5161. for (var c in e)
  5162. e.hasOwnProperty(c) && (d[c] = e[c]);
  5163. f.prototype = e.prototype;
  5164. d.prototype = new f
  5165. };
  5166. (function (d) {
  5167. var e = function (d) {
  5168. function c() {
  5169. d.call(this);
  5170. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5171. }
  5172. __extends(c, d);
  5173. c.prototype.analyzeData = function (a, b) {
  5174. var c = a.name;
  5175. if (!this.fileDic[c] && b)
  5176. try {
  5177. var d = egret.XML.parse(b);
  5178. this.fileDic[c] = d
  5179. } catch (e) {}
  5180. };
  5181. return c
  5182. }
  5183. (d.BinAnalyzer);
  5184. d.XMLAnalyzer = e;
  5185. e.prototype.__class__ = "RES.XMLAnalyzer"
  5186. })(RES || (RES = {}));
  5187. __extends = this.__extends || function (d, e) {
  5188. function f() {
  5189. this.constructor = d
  5190. }
  5191. for (var c in e)
  5192. e.hasOwnProperty(c) && (d[c] = e[c]);
  5193. f.prototype = e.prototype;
  5194. d.prototype = new f
  5195. };
  5196. (function (d) {
  5197. d.loadConfig = function (c, a, b) {
  5198. "undefined" === typeof a && (a = "");
  5199. "undefined" === typeof b && (b = "json");
  5200. f.loadConfig(c, a, b)
  5201. };
  5202. d.loadGroup = function (c, a) {
  5203. "undefined" === typeof a && (a = 0);
  5204. f.loadGroup(c, a)
  5205. };
  5206. d.isGroupLoaded = function (c) {
  5207. return f.isGroupLoaded(c)
  5208. };
  5209. d.getGroupByName = function (c) {
  5210. return f.getGroupByName(c)
  5211. };
  5212. d.createGroup = function (c, a, b) {
  5213. "undefined" === typeof b && (b = !1);
  5214. return f.createGroup(c, a, b)
  5215. };
  5216. d.hasRes = function (c) {
  5217. return f.hasRes(c)
  5218. };
  5219. d.getRes = function (c) {
  5220. return f.getRes(c)
  5221. };
  5222. d.getResAsync =
  5223. function (c, a, b) {
  5224. f.getResAsync(c, a, b)
  5225. };
  5226. d.getResByUrl = function (c, a, b, d) {
  5227. "undefined" === typeof d && (d = "");
  5228. f.getResByUrl(c, a, b, d)
  5229. };
  5230. d.destroyRes = function (c) {
  5231. return f.destroyRes(c)
  5232. };
  5233. d.setMaxLoadingThread = function (c) {
  5234. f.setMaxLoadingThread(c)
  5235. };
  5236. d.addEventListener = function (c, a, b, d, e) {
  5237. "undefined" === typeof d && (d = !1);
  5238. "undefined" === typeof e && (e = 0);
  5239. f.addEventListener(c, a, b, d, e)
  5240. };
  5241. d.removeEventListener = function (c, a, b, d) {
  5242. "undefined" === typeof d && (d = !1);
  5243. f.removeEventListener(c, a, b, d)
  5244. };
  5245. var e = function (c) {
  5246. function a() {
  5247. c.call(this);
  5248. this.analyzerDic = {};
  5249. this.configItemList = [];
  5250. this.configComplete = this.callLaterFlag = !1;
  5251. this.loadedGroups = [];
  5252. this.groupNameList = [];
  5253. this.asyncDic = {};
  5254. this.init()
  5255. }
  5256. __extends(a, c);
  5257. a.prototype.getAnalyzerByType = function (b) {
  5258. var a = this.analyzerDic[b];
  5259. a || (a = this.analyzerDic[b] = egret.Injector.getInstance(d.AnalyzerBase, b));
  5260. return a
  5261. };
  5262. a.prototype.init = function () {
  5263. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(d.AnalyzerBase, d.BinAnalyzer, d.ResourceItem.TYPE_BIN);
  5264. egret.Injector.hasMapRule(d.AnalyzerBase,
  5265. d.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(d.AnalyzerBase, d.ImageAnalyzer, d.ResourceItem.TYPE_IMAGE);
  5266. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(d.AnalyzerBase, d.TextAnalyzer, d.ResourceItem.TYPE_TEXT);
  5267. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(d.AnalyzerBase, d.JsonAnalyzer, d.ResourceItem.TYPE_JSON);
  5268. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(d.AnalyzerBase,
  5269. d.SheetAnalyzer, d.ResourceItem.TYPE_SHEET);
  5270. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(d.AnalyzerBase, d.FontAnalyzer, d.ResourceItem.TYPE_FONT);
  5271. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(d.AnalyzerBase, d.SoundAnalyzer, d.ResourceItem.TYPE_SOUND);
  5272. egret.Injector.hasMapRule(d.AnalyzerBase, d.ResourceItem.TYPE_XML) || egret.Injector.mapClass(d.AnalyzerBase, d.XMLAnalyzer, d.ResourceItem.TYPE_XML);
  5273. this.resConfig =
  5274. new d.ResourceConfig;
  5275. this.resLoader = new d.ResourceLoader;
  5276. this.resLoader.callBack = this.onResourceItemComp;
  5277. this.resLoader.resInstance = this;
  5278. this.resLoader.addEventListener(d.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  5279. };
  5280. a.prototype.loadConfig = function (b, a, c) {
  5281. "undefined" === typeof c && (c = "json");
  5282. this.configItemList.push({
  5283. url : b,
  5284. resourceRoot : a,
  5285. type : c
  5286. });
  5287. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  5288. };
  5289. a.prototype.startLoadConfig = function () {
  5290. this.callLaterFlag = !1;
  5291. var b = this.configItemList;
  5292. this.configItemList = [];
  5293. this.loadingConfigList = b;
  5294. for (var c = b.length, e = [], f = 0; f < c; f++) {
  5295. var h = b[f],
  5296. h = new d.ResourceItem(h.url, h.url, h.type);
  5297. e.push(h)
  5298. }
  5299. this.resLoader.loadGroup(e, a.GROUP_CONFIG, Number.MAX_VALUE)
  5300. };
  5301. a.prototype.isGroupLoaded = function (b) {
  5302. return -1 != this.loadedGroups.indexOf(b)
  5303. };
  5304. a.prototype.getGroupByName = function (b) {
  5305. return this.resConfig.getGroupByName(b)
  5306. };
  5307. a.prototype.loadGroup = function (b, a) {
  5308. "undefined" === typeof a && (a = 0);
  5309. if (-1 == this.loadedGroups.indexOf(b) && !this.resLoader.isGroupInLoading(b))
  5310. if (this.configComplete) {
  5311. var c =
  5312. this.resConfig.getGroupByName(b);
  5313. this.resLoader.loadGroup(c, b, a)
  5314. } else
  5315. this.groupNameList.push({
  5316. name : b,
  5317. priority : a
  5318. })
  5319. };
  5320. a.prototype.createGroup = function (b, a, c) {
  5321. "undefined" === typeof c && (c = !1);
  5322. if (c) {
  5323. var d = this.loadedGroups.indexOf(b);
  5324. -1 != d && this.loadedGroups.splice(d, 1)
  5325. }
  5326. return this.resConfig.createGroup(b, a, c)
  5327. };
  5328. a.prototype.onGroupComp = function (b) {
  5329. if (b.groupName == a.GROUP_CONFIG) {
  5330. b = this.loadingConfigList.length;
  5331. for (var c = 0; c < b; c++) {
  5332. var e = this.loadingConfigList[c],
  5333. f = this.getAnalyzerByType(e.type),
  5334. h = f.getRes(e.url);
  5335. f.destroyRes(e.url);
  5336. this.resConfig.parseConfig(h, e.resourceRoot)
  5337. }
  5338. this.configComplete = !0;
  5339. this.loadingConfigList = null;
  5340. d.ResourceEvent.dispatchResourceEvent(this, d.ResourceEvent.CONFIG_COMPLETE);
  5341. e = this.groupNameList;
  5342. b = e.length;
  5343. for (c = 0; c < b; c++)
  5344. f = e[c], this.loadGroup(f.name, f.priority);
  5345. this.groupNameList = []
  5346. } else
  5347. this.loadedGroups.push(b.groupName), this.dispatchEvent(b)
  5348. };
  5349. a.prototype.hasRes = function (b) {
  5350. var a = this.resConfig.getType(b);
  5351. return "" == a && (b = d.AnalyzerBase.getStringPrefix(b), a = this.resConfig.getType(b),
  5352. "" == a) ? !1 : !0
  5353. };
  5354. a.prototype.getRes = function (b) {
  5355. var a = this.resConfig.getType(b);
  5356. return "" == a && (a = d.AnalyzerBase.getStringPrefix(b), a = this.resConfig.getType(a), "" == a) ? null : this.getAnalyzerByType(a).getRes(b)
  5357. };
  5358. a.prototype.getResAsync = function (b, a, c) {
  5359. var e = this.resConfig.getType(b),
  5360. f = this.resConfig.getName(b);
  5361. if ("" == e && (f = d.AnalyzerBase.getStringPrefix(b), e = this.resConfig.getType(f), "" == e)) {
  5362. a.call(c, null);
  5363. return
  5364. }
  5365. (e = this.getAnalyzerByType(e).getRes(b)) ? a.call(c, e) : (b = {
  5366. key : b,
  5367. compFunc : a,
  5368. thisObject : c
  5369. }, this.asyncDic[f] ?
  5370. this.asyncDic[f].push(b) : (this.asyncDic[f] = [b], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  5371. };
  5372. a.prototype.getResByUrl = function (b, a, c, e) {
  5373. "undefined" === typeof e && (e = "");
  5374. if (b) {
  5375. e || (e = this.getTypeByUrl(b));
  5376. var f = this.getAnalyzerByType(e).getRes(b);
  5377. f ? a.call(c, f) : (a = {
  5378. key : b,
  5379. compFunc : a,
  5380. thisObject : c
  5381. }, this.asyncDic[b] ? this.asyncDic[b].push(a) : (this.asyncDic[b] = [a], b = new d.ResourceItem(b, b, e), this.resLoader.loadItem(b)))
  5382. } else
  5383. a.call(c, null)
  5384. };
  5385. a.prototype.getTypeByUrl = function (b) {
  5386. (b = b.substr(b.lastIndexOf(".") +
  5387. 1)) && (b = b.toLowerCase());
  5388. switch (b) {
  5389. case d.ResourceItem.TYPE_XML:
  5390. case d.ResourceItem.TYPE_JSON:
  5391. case d.ResourceItem.TYPE_SHEET:
  5392. break;
  5393. case "png":
  5394. case "jpg":
  5395. case "gif":
  5396. b = d.ResourceItem.TYPE_IMAGE;
  5397. break;
  5398. case "fnt":
  5399. b = d.ResourceItem.TYPE_FONT;
  5400. break;
  5401. case "txt":
  5402. b = d.ResourceItem.TYPE_TEXT;
  5403. break;
  5404. case "mp3":
  5405. case "ogg":
  5406. case "mpeg":
  5407. case "wav":
  5408. case "m4a":
  5409. case "mp4":
  5410. case "aiff":
  5411. case "wma":
  5412. case "mid":
  5413. b = d.ResourceItem.TYPE_SOUND;
  5414. break;
  5415. default:
  5416. b = d.ResourceItem.TYPE_BIN
  5417. }
  5418. return b
  5419. };
  5420. a.prototype.onResourceItemComp = function (b) {
  5421. var a =
  5422. this.asyncDic[b.name];
  5423. delete this.asyncDic[b.name];
  5424. b = this.getAnalyzerByType(b.type);
  5425. for (var c = a.length, d = 0; d < c; d++) {
  5426. var e = a[d],
  5427. f = b.getRes(e.key);
  5428. e.compFunc.call(e.thisObject, f)
  5429. }
  5430. };
  5431. a.prototype.destroyRes = function (b) {
  5432. var a = this.resConfig.getRawGroupByName(b);
  5433. if (a) {
  5434. var c = this.loadedGroups.indexOf(b);
  5435. -1 != c && this.loadedGroups.splice(c, 1);
  5436. b = a.length;
  5437. for (var d = 0; d < b; d++) {
  5438. c = a[d];
  5439. c.loaded = !1;
  5440. var e = this.getAnalyzerByType(c.type);
  5441. e.destroyRes(c.name)
  5442. }
  5443. return !0
  5444. }
  5445. a = this.resConfig.getType(b);
  5446. if ("" == a)
  5447. return !1;
  5448. c = this.resConfig.getRawResourceItem(b);
  5449. c.loaded = !1;
  5450. e = this.getAnalyzerByType(a);
  5451. return e.destroyRes(b)
  5452. };
  5453. a.prototype.setMaxLoadingThread = function (b) {
  5454. 1 > b && (b = 1);
  5455. this.resLoader.thread = b
  5456. };
  5457. a.GROUP_CONFIG = "RES__CONFIG";
  5458. return a
  5459. }
  5460. (egret.EventDispatcher);
  5461. e.prototype.__class__ = "Resource";
  5462. var f = new e
  5463. })(RES || (RES = {}));
  5464. __extends = this.__extends || function (d, e) {
  5465. function f() {
  5466. this.constructor = d
  5467. }
  5468. for (var c in e)
  5469. e.hasOwnProperty(c) && (d[c] = e[c]);
  5470. f.prototype = e.prototype;
  5471. d.prototype = new f
  5472. };
  5473. (function (d) {
  5474. (function (e) {
  5475. var f = function (c) {
  5476. function a(b) {
  5477. "undefined" === typeof b && (b = null);
  5478. c.call(this);
  5479. this._source = b ? b : []
  5480. }
  5481. __extends(a, c);
  5482. Object.defineProperty(a.prototype, "source", {
  5483. get : function () {
  5484. return this._source
  5485. },
  5486. set : function (b) {
  5487. b || (b = []);
  5488. this._source = b;
  5489. this.dispatchCoEvent(e.CollectionEventKind.RESET)
  5490. },
  5491. enumerable : !0,
  5492. configurable : !0
  5493. });
  5494. a.prototype.refresh = function () {
  5495. this.dispatchCoEvent(e.CollectionEventKind.REFRESH)
  5496. };
  5497. a.prototype.contains = function (b) {
  5498. return -1 != this.getItemIndex(b)
  5499. };
  5500. a.prototype.checkIndex =
  5501. function (b) {
  5502. if (0 > b || b >= this._source.length)
  5503. throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5504. };
  5505. Object.defineProperty(a.prototype, "length", {
  5506. get : function () {
  5507. return this._source.length
  5508. },
  5509. enumerable : !0,
  5510. configurable : !0
  5511. });
  5512. a.prototype.addItem = function (b) {
  5513. this._source.push(b);
  5514. this.dispatchCoEvent(e.CollectionEventKind.ADD, this._source.length - 1, -1, [b])
  5515. };
  5516. a.prototype.addItemAt = function (b, a) {
  5517. if (0 > a || a > this._source.length)
  5518. throw new RangeError('\u7d22\u5f15:"' +
  5519. a + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5520. this._source.splice(a, 0, b);
  5521. this.dispatchCoEvent(e.CollectionEventKind.ADD, a, -1, [b])
  5522. };
  5523. a.prototype.getItemAt = function (b) {
  5524. return this._source[b]
  5525. };
  5526. a.prototype.getItemIndex = function (b) {
  5527. for (var a = this._source.length, c = 0; c < a; c++)
  5528. if (this._source[c] === b)
  5529. return c;
  5530. return -1
  5531. };
  5532. a.prototype.itemUpdated = function (b) {
  5533. var a = this.getItemIndex(b);
  5534. -1 != a && this.dispatchCoEvent(e.CollectionEventKind.UPDATE, a, -1, [b])
  5535. };
  5536. a.prototype.removeAll = function () {
  5537. var b =
  5538. this._source.concat();
  5539. this._source.length = 0;
  5540. this.dispatchCoEvent(e.CollectionEventKind.REMOVE, 0, -1, b)
  5541. };
  5542. a.prototype.removeItemAt = function (b) {
  5543. this.checkIndex(b);
  5544. var a = this._source.splice(b, 1)[0];
  5545. this.dispatchCoEvent(e.CollectionEventKind.REMOVE, b, -1, [a]);
  5546. return a
  5547. };
  5548. a.prototype.replaceItemAt = function (b, a) {
  5549. this.checkIndex(a);
  5550. var c = this._source.splice(a, 1, b)[0];
  5551. this.dispatchCoEvent(e.CollectionEventKind.REPLACE, a, -1, [b], [c]);
  5552. return c
  5553. };
  5554. a.prototype.replaceAll = function (b) {
  5555. b || (b = []);
  5556. for (var a = b.length, c = this._source.length,
  5557. d = a; d < c; d++)
  5558. this.removeItemAt(a);
  5559. for (d = 0; d < a; d++)
  5560. d >= c ? this.addItemAt(b[d], d) : this.replaceItemAt(b[d], d);
  5561. this._source = b
  5562. };
  5563. a.prototype.moveItemAt = function (b, a) {
  5564. this.checkIndex(b);
  5565. this.checkIndex(a);
  5566. var c = this._source.splice(b, 1)[0];
  5567. this._source.splice(a, 0, c);
  5568. this.dispatchCoEvent(e.CollectionEventKind.MOVE, a, b, [c]);
  5569. return c
  5570. };
  5571. a.prototype.dispatchCoEvent = function (b, a, c, d, f) {
  5572. "undefined" === typeof b && (b = null);
  5573. "undefined" === typeof a && (a = -1);
  5574. "undefined" === typeof c && (c = -1);
  5575. "undefined" === typeof d && (d = null);
  5576. "undefined" ===
  5577. typeof f && (f = null);
  5578. e.CollectionEvent.dispatchCollectionEvent(this, e.CollectionEvent.COLLECTION_CHANGE, b, a, c, d, f)
  5579. };
  5580. return a
  5581. }
  5582. (d.EventDispatcher);
  5583. e.ArrayCollection = f;
  5584. f.prototype.__class__ = "egret.gui.ArrayCollection"
  5585. })(d.gui || (d.gui = {}))
  5586. })(egret || (egret = {}));
  5587. __extends = this.__extends || function (d, e) {
  5588. function f() {
  5589. this.constructor = d
  5590. }
  5591. for (var c in e)
  5592. e.hasOwnProperty(c) && (d[c] = e[c]);
  5593. f.prototype = e.prototype;
  5594. d.prototype = new f
  5595. };
  5596. (function (d) {
  5597. (function (e) {
  5598. var f = function (c) {
  5599. function a(b, a) {
  5600. "undefined" === typeof b && (b = "children");
  5601. "undefined" === typeof a && (a = "parent");
  5602. c.call(this);
  5603. this.nodeList = [];
  5604. this._openNodes = [];
  5605. this._showRoot = !1;
  5606. this.childrenKey = b;
  5607. this.parentKey = a
  5608. }
  5609. __extends(a, c);
  5610. Object.defineProperty(a.prototype, "source", {
  5611. get : function () {
  5612. return this._source
  5613. },
  5614. set : function (b) {
  5615. this._source = b;
  5616. this._openNodes = [];
  5617. this.nodeList = [];
  5618. this._source && (this._showRoot ? this.nodeList.push(this._source) : (this._openNodes = [this._source], this.addChildren(this._source,
  5619. this.nodeList)));
  5620. this.dispatchCoEvent(e.CollectionEventKind.RESET)
  5621. },
  5622. enumerable : !0,
  5623. configurable : !0
  5624. });
  5625. Object.defineProperty(a.prototype, "openNodes", {
  5626. get : function () {
  5627. return this._openNodes.concat()
  5628. },
  5629. set : function (b) {
  5630. this._openNodes = b ? b.concat() : [];
  5631. this.refresh()
  5632. },
  5633. enumerable : !0,
  5634. configurable : !0
  5635. });
  5636. Object.defineProperty(a.prototype, "length", {
  5637. get : function () {
  5638. return this.nodeList.length
  5639. },
  5640. enumerable : !0,
  5641. configurable : !0
  5642. });
  5643. a.prototype.getItemAt = function (b) {
  5644. return this.nodeList[b]
  5645. };
  5646. a.prototype.getItemIndex = function (b) {
  5647. for (var a =
  5648. this.nodeList.length, c = 0; c < a; c++)
  5649. if (this.nodeList[c] === b)
  5650. return c;
  5651. return -1
  5652. };
  5653. a.prototype.itemUpdated = function (b) {
  5654. var a = this.getItemIndex(b);
  5655. -1 != a && this.dispatchCoEvent(e.CollectionEventKind.UPDATE, a, -1, [b])
  5656. };
  5657. a.prototype.removeItem = function (b) {
  5658. this.isItemOpen(b) && this.closeNode(b);
  5659. if (b) {
  5660. var a = b[this.parentKey];
  5661. if (a && (a = a[this.childrenKey])) {
  5662. var c = a.indexOf(b);
  5663. -1 != c && a.splice(c, 1);
  5664. b[this.parentKey] = null;
  5665. c = this.nodeList.indexOf(b);
  5666. -1 != c && (this.nodeList.splice(c, 1), this.dispatchCoEvent(e.CollectionEventKind.REMOVE,
  5667. c, -1, [b]))
  5668. }
  5669. }
  5670. };
  5671. Object.defineProperty(a.prototype, "showRoot", {
  5672. get : function () {
  5673. return this._showRoot
  5674. },
  5675. set : function (b) {
  5676. this._showRoot != b && (this._showRoot = b, this._source && (this._showRoot ? this.nodeList.splice(0, 0, this._source) : (this.nodeList.shift(), -1 == this.openNodes.indexOf(this._source) && this.openNodes.push(this._source)), this.refresh()))
  5677. },
  5678. enumerable : !0,
  5679. configurable : !0
  5680. });
  5681. a.prototype.addChildren = function (b, a) {
  5682. if (b.hasOwnProperty(this.childrenKey) && -1 != this._openNodes.indexOf(b))
  5683. for (var c = b[this.childrenKey],
  5684. d = c.length, e = 0; e < d; e++) {
  5685. var f = c[e];
  5686. a.push(f);
  5687. this.addChildren(f, a)
  5688. }
  5689. };
  5690. a.prototype.hasChildren = function (b) {
  5691. return b.hasOwnProperty(this.childrenKey) ? 0 < b[this.childrenKey].length : !1
  5692. };
  5693. a.prototype.isItemOpen = function (b) {
  5694. return -1 != this._openNodes.indexOf(b)
  5695. };
  5696. a.prototype.expandItem = function (b, a) {
  5697. "undefined" === typeof a && (a = !0);
  5698. a ? this.openNode(b) : this.closeNode(b)
  5699. };
  5700. a.prototype.openNode = function (b) {
  5701. if (-1 == this._openNodes.indexOf(b)) {
  5702. this._openNodes.push(b);
  5703. var a = this.nodeList.indexOf(b);
  5704. if (-1 != a) {
  5705. var c = [];
  5706. this.addChildren(b, c);
  5707. for (var d = a; c.length; ) {
  5708. d++;
  5709. var f = c.shift();
  5710. this.nodeList.splice(d, 0, f);
  5711. this.dispatchCoEvent(e.CollectionEventKind.ADD, d, -1, [f])
  5712. }
  5713. this.dispatchCoEvent("open", a, a, [b])
  5714. }
  5715. }
  5716. };
  5717. a.prototype.closeNode = function (b) {
  5718. var a = this._openNodes.indexOf(b);
  5719. if (-1 != a) {
  5720. var c = [];
  5721. this.addChildren(b, c);
  5722. this._openNodes.splice(a, 1);
  5723. a = this.nodeList.indexOf(b);
  5724. if (-1 != a) {
  5725. for (a++; c.length; ) {
  5726. var d = this.nodeList.splice(a, 1)[0];
  5727. this.dispatchCoEvent(e.CollectionEventKind.REMOVE, a, -1, [d]);
  5728. c.shift()
  5729. }
  5730. a--;
  5731. this.dispatchCoEvent(e.CollectionEventKind.CLOSE,
  5732. a, a, [b])
  5733. }
  5734. }
  5735. };
  5736. a.prototype.getDepth = function (b) {
  5737. var a = 0;
  5738. for (b = b[this.parentKey]; b; )
  5739. a++, b = b[this.parentKey];
  5740. 0 < a && !this._showRoot && a--;
  5741. return a
  5742. };
  5743. a.prototype.refresh = function () {
  5744. this.nodeList = [];
  5745. this._source && (this._showRoot && this.nodeList.push(this._source), this.addChildren(this._source, this.nodeList));
  5746. this.dispatchCoEvent(e.CollectionEventKind.REFRESH)
  5747. };
  5748. a.prototype.dispatchCoEvent = function (b, a, c, d, f) {
  5749. "undefined" === typeof b && (b = null);
  5750. "undefined" === typeof a && (a = -1);
  5751. "undefined" === typeof c && (c = -1);
  5752. "undefined" ===
  5753. typeof d && (d = null);
  5754. "undefined" === typeof f && (f = null);
  5755. e.CollectionEvent.dispatchCollectionEvent(this, e.CollectionEvent.COLLECTION_CHANGE, b, a, c, d, f)
  5756. };
  5757. a.assignParent = function (b, c, d) {
  5758. "undefined" === typeof c && (c = "children");
  5759. "undefined" === typeof d && (d = "parent");
  5760. if (b.hasOwnProperty(c))
  5761. for (var e = b[c], f = e.length, g = 0; g < f; g++) {
  5762. var l = e[g];
  5763. try {
  5764. l[d] = b
  5765. } catch (k) {}
  5766. a.assignParent(l, c, d)
  5767. }
  5768. };
  5769. return a
  5770. }
  5771. (d.EventDispatcher);
  5772. e.ObjectCollection = f;
  5773. f.prototype.__class__ = "egret.gui.ObjectCollection"
  5774. })(d.gui || (d.gui = {}))
  5775. })(egret ||
  5776. (egret = {}));
  5777. __extends = this.__extends || function (d, e) {
  5778. function f() {
  5779. this.constructor = d
  5780. }
  5781. for (var c in e)
  5782. e.hasOwnProperty(c) && (d[c] = e[c]);
  5783. f.prototype = e.prototype;
  5784. d.prototype = new f
  5785. };
  5786. (function (d) {
  5787. (function (e) {
  5788. var f = function (c) {
  5789. function a() {
  5790. c.call(this);
  5791. this.targetLevel = Number.MAX_VALUE;
  5792. this.updateCompleteQueue = new e.DepthQueue;
  5793. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  5794. this.invalidatePropertiesQueue = new e.DepthQueue;
  5795. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  5796. this.invalidateSizeQueue = new e.DepthQueue;
  5797. this.invalidateDisplayListFlag = !1;
  5798. this.invalidateDisplayListQueue = new e.DepthQueue;
  5799. this.listenersAttached = !1
  5800. }
  5801. __extends(a, c);
  5802. a.prototype.invalidateProperties =
  5803. function (b) {
  5804. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  5805. this.targetLevel <= b.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  5806. this.invalidatePropertiesQueue.insert(b)
  5807. };
  5808. a.prototype.validateProperties = function () {
  5809. for (var b = this.invalidatePropertiesQueue.shift(); b; )
  5810. b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidatePropertiesQueue.shift();
  5811. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  5812. };
  5813. a.prototype.invalidateSize = function (b) {
  5814. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  5815. this.targetLevel <= b.nestLevel && (this.invalidateClientSizeFlag = !0);
  5816. this.invalidateSizeQueue.insert(b)
  5817. };
  5818. a.prototype.validateSize = function () {
  5819. for (var b = this.invalidateSizeQueue.pop(); b; )
  5820. b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag =
  5821. !0)), b = this.invalidateSizeQueue.pop();
  5822. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  5823. };
  5824. a.prototype.invalidateDisplayList = function (b) {
  5825. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  5826. this.invalidateDisplayListQueue.insert(b)
  5827. };
  5828. a.prototype.validateDisplayList = function () {
  5829. for (var b = this.invalidateDisplayListQueue.shift(); b; )
  5830. b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b),
  5831. b.updateCompletePendingFlag = !0)), b = this.invalidateDisplayListQueue.shift();
  5832. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5833. };
  5834. a.prototype.attachListeners = function () {
  5835. e.UIGlobals.stage.addEventListener(d.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5836. e.UIGlobals.stage.addEventListener(d.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5837. e.UIGlobals.stage.invalidate();
  5838. this.listenersAttached = !0
  5839. };
  5840. a.prototype.doPhasedInstantiationCallBack = function (b) {
  5841. e.UIGlobals.stage.removeEventListener(d.Event.ENTER_FRAME,
  5842. this.doPhasedInstantiationCallBack, this);
  5843. e.UIGlobals.stage.removeEventListener(d.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5844. this.doPhasedInstantiation()
  5845. };
  5846. a.prototype.doPhasedInstantiation = function () {
  5847. this.invalidatePropertiesFlag && this.validateProperties();
  5848. this.invalidateSizeFlag && this.validateSize();
  5849. this.invalidateDisplayListFlag && this.validateDisplayList();
  5850. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag)
  5851. this.attachListeners();
  5852. else {
  5853. this.listenersAttached =
  5854. !1;
  5855. for (var b = this.updateCompleteQueue.pop(); b; )
  5856. b.initialized || (b.initialized = !0), b.hasEventListener(e.UIEvent.UPDATE_COMPLETE) && e.UIEvent.dispatchUIEvent(b, e.UIEvent.UPDATE_COMPLETE), b.updateCompletePendingFlag = !1, b = this.updateCompleteQueue.pop();
  5857. e.UIEvent.dispatchUIEvent(this, e.UIEvent.UPDATE_COMPLETE)
  5858. }
  5859. };
  5860. a.prototype.validateNow = function () {
  5861. for (var b = 0; this.listenersAttached && 100 > b++; )
  5862. this.doPhasedInstantiationCallBack()
  5863. };
  5864. a.prototype.validateClient = function (b, a) {
  5865. "undefined" === typeof a && (a = !1);
  5866. var c,
  5867. d = !1,
  5868. f = this.targetLevel;
  5869. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = b.nestLevel);
  5870. for (; !d; ) {
  5871. d = !0;
  5872. for (c = this.invalidatePropertiesQueue.removeSmallestChild(b); c; )
  5873. c.parent && (c.validateProperties(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0)), c = this.invalidatePropertiesQueue.removeSmallestChild(b);
  5874. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  5875. this.invalidateClientPropertiesFlag = !1;
  5876. for (c = this.invalidateSizeQueue.removeLargestChild(b); c; ) {
  5877. c.parent &&
  5878. (c.validateSize(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0));
  5879. if (this.invalidateClientPropertiesFlag && (c = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5880. this.invalidatePropertiesQueue.insert(c);
  5881. d = !1;
  5882. break
  5883. }
  5884. c = this.invalidateSizeQueue.removeLargestChild(b)
  5885. }
  5886. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  5887. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  5888. if (!a) {
  5889. for (c = this.invalidateDisplayListQueue.removeSmallestChild(b); c; ) {
  5890. c.parent &&
  5891. (c.validateDisplayList(), c.updateCompletePendingFlag || (this.updateCompleteQueue.insert(c), c.updateCompletePendingFlag = !0));
  5892. if (this.invalidateClientPropertiesFlag && (c = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5893. this.invalidatePropertiesQueue.insert(c);
  5894. d = !1;
  5895. break
  5896. }
  5897. if (this.invalidateClientSizeFlag && (c = this.invalidateSizeQueue.removeLargestChild(b))) {
  5898. this.invalidateSizeQueue.insert(c);
  5899. d = !1;
  5900. break
  5901. }
  5902. c = this.invalidateDisplayListQueue.removeSmallestChild(b)
  5903. }
  5904. this.invalidateDisplayListQueue.isEmpty() &&
  5905. (this.invalidateDisplayListFlag = !1)
  5906. }
  5907. }
  5908. if (f == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a))
  5909. for (c = this.updateCompleteQueue.removeLargestChild(b); c; )
  5910. c.initialized || (c.initialized = !0), c.hasEventListener(e.UIEvent.UPDATE_COMPLETE) && e.UIEvent.dispatchUIEvent(c, e.UIEvent.UPDATE_COMPLETE), c.updateCompletePendingFlag = !1, c = this.updateCompleteQueue.removeLargestChild(b)
  5911. };
  5912. return a
  5913. }
  5914. (d.EventDispatcher);
  5915. e.LayoutManager = f;
  5916. f.prototype.__class__ = "egret.gui.LayoutManager"
  5917. })(d.gui || (d.gui = {}))
  5918. })(egret || (egret = {}));
  5919. (function (d) {
  5920. (function (e) {
  5921. var f = function () {
  5922. function a() {
  5923. this.depthBins = [];
  5924. this.minDepth = 0;
  5925. this.maxDepth = -1
  5926. }
  5927. a.prototype.insert = function (b) {
  5928. var a = b.nestLevel,
  5929. d = b.hashCode;
  5930. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a : (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  5931. var e = this.depthBins[a];
  5932. e ? null == e.items[d] && (e.items[d] = b, e.length++) : (e = new c, this.depthBins[a] = e, e.items[d] = b, e.length++)
  5933. };
  5934. a.prototype.pop = function () {
  5935. var b = null;
  5936. if (this.minDepth <= this.maxDepth) {
  5937. for (var a = this.depthBins[this.maxDepth]; !a ||
  5938. 0 == a.length; ) {
  5939. this.maxDepth--;
  5940. if (this.maxDepth < this.minDepth)
  5941. return null;
  5942. a = this.depthBins[this.maxDepth]
  5943. }
  5944. var c = a.items,
  5945. d;
  5946. for (d in c) {
  5947. b = c[d];
  5948. this.remove(b, this.maxDepth);
  5949. break
  5950. }
  5951. for (; !a || 0 == a.length; ) {
  5952. this.maxDepth--;
  5953. if (this.maxDepth < this.minDepth)
  5954. break;
  5955. a = this.depthBins[this.maxDepth]
  5956. }
  5957. }
  5958. return b
  5959. };
  5960. a.prototype.shift = function () {
  5961. var b = null;
  5962. if (this.minDepth <= this.maxDepth) {
  5963. for (var a = this.depthBins[this.minDepth]; !a || 0 == a.length; ) {
  5964. this.minDepth++;
  5965. if (this.minDepth > this.maxDepth)
  5966. return null;
  5967. a = this.depthBins[this.minDepth]
  5968. }
  5969. var c =
  5970. a.items,
  5971. d;
  5972. for (d in c) {
  5973. b = c[d];
  5974. this.remove(b, this.minDepth);
  5975. break
  5976. }
  5977. for (; !a || 0 == a.length; ) {
  5978. this.minDepth++;
  5979. if (this.minDepth > this.maxDepth)
  5980. break;
  5981. a = this.depthBins[this.minDepth]
  5982. }
  5983. }
  5984. return b
  5985. };
  5986. a.prototype.removeLargestChild = function (b) {
  5987. for (var a = this.maxDepth, c = b.nestLevel, e = b.hashCode; c <= a; ) {
  5988. var f = this.depthBins[a];
  5989. if (f && 0 < f.length) {
  5990. if (a == b.nestLevel) {
  5991. if (f.items[e])
  5992. return this.remove(b, a), b
  5993. } else {
  5994. var f = f.items,
  5995. g;
  5996. for (g in f) {
  5997. var l = f[g];
  5998. if (l instanceof d.DisplayObject && b instanceof d.DisplayObjectContainer &&
  5999. b.contains(l))
  6000. return this.remove(l, a), l
  6001. }
  6002. }
  6003. a--
  6004. } else if (a == this.maxDepth && this.maxDepth--, a--, a < c)
  6005. break
  6006. }
  6007. return null
  6008. };
  6009. a.prototype.removeSmallestChild = function (b) {
  6010. for (var a = b.nestLevel, c = b.hashCode; a <= this.maxDepth; ) {
  6011. var e = this.depthBins[a];
  6012. if (e && 0 < e.length) {
  6013. if (a == b.nestLevel) {
  6014. if (e.items[c])
  6015. return this.remove(b, a), b
  6016. } else {
  6017. var e = e.items,
  6018. f;
  6019. for (f in e) {
  6020. var g = e[f];
  6021. if (g instanceof d.DisplayObject && b instanceof d.DisplayObjectContainer && b.contains(g))
  6022. return this.remove(g, a), g
  6023. }
  6024. }
  6025. a++
  6026. } else if (a == this.minDepth && this.minDepth++,
  6027. a++, a > this.maxDepth)
  6028. break
  6029. }
  6030. return null
  6031. };
  6032. a.prototype.remove = function (b, a) {
  6033. "undefined" === typeof a && (a = -1);
  6034. var c = b.hashCode,
  6035. d = this.depthBins[0 <= a ? a : b.nestLevel];
  6036. return d && null != d.items[c] ? (delete d.items[c], d.length--, b) : null
  6037. };
  6038. a.prototype.removeAll = function () {
  6039. this.minDepth = this.depthBins.length = 0;
  6040. this.maxDepth = -1
  6041. };
  6042. a.prototype.isEmpty = function () {
  6043. return this.minDepth > this.maxDepth
  6044. };
  6045. return a
  6046. }
  6047. ();
  6048. e.DepthQueue = f;
  6049. f.prototype.__class__ = "egret.gui.DepthQueue";
  6050. var c = function () {
  6051. return function () {
  6052. this.length = 0;
  6053. this.items =
  6054. []
  6055. }
  6056. }
  6057. ();
  6058. e.DepthBin = c;
  6059. c.prototype.__class__ = "egret.gui.DepthBin"
  6060. })(d.gui || (d.gui = {}))
  6061. })(egret || (egret = {}));
  6062. (function (d) {
  6063. (function (d) {
  6064. var f = function () {
  6065. function c() {}
  6066. Object.defineProperty(c, "stage", {
  6067. get : function () {
  6068. return c._stage
  6069. },
  6070. enumerable : !0,
  6071. configurable : !0
  6072. });
  6073. c._initlize = function (a) {
  6074. c.initlized || (c._stage = a, c._layoutManager = new d.LayoutManager, c.initlized = !0)
  6075. };
  6076. Object.defineProperty(c, "uiStage", {
  6077. get : function () {
  6078. return c._uiStage
  6079. },
  6080. enumerable : !0,
  6081. configurable : !0
  6082. });
  6083. c.initlized = !1;
  6084. return c
  6085. }
  6086. ();
  6087. d.UIGlobals = f;
  6088. f.prototype.__class__ = "egret.gui.UIGlobals"
  6089. })(d.gui || (d.gui = {}))
  6090. })(egret || (egret = {}));
  6091. __extends = this.__extends || function (d, e) {
  6092. function f() {
  6093. this.constructor = d
  6094. }
  6095. for (var c in e)
  6096. e.hasOwnProperty(c) && (d[c] = e[c]);
  6097. f.prototype = e.prototype;
  6098. d.prototype = new f
  6099. };
  6100. (function (d) {
  6101. (function (e) {
  6102. var f = function (c) {
  6103. function a() {
  6104. c.call(this);
  6105. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  6106. this._nestLevel = 0;
  6107. this._enabled = !0;
  6108. this._minWidth = this._height = this._width = 0;
  6109. this._maxWidth = 1E4;
  6110. this._minHeight = 0;
  6111. this._maxHeight = 1E4;
  6112. this._measuredHeight = this._measuredWidth = 0;
  6113. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  6114. this._includeInLayout = !0;
  6115. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet =
  6116. !1;
  6117. this.touchEnabled = !0;
  6118. this.addEventListener(d.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6119. this.addEventListener(d.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  6120. }
  6121. __extends(a, c);
  6122. a.prototype.onAddedToStage = function (b) {
  6123. this.removeEventListener(d.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6124. this._initialize();
  6125. e.UIGlobals._initlize(this.stage);
  6126. 0 < this._nestLevel && this.checkInvalidateFlag()
  6127. };
  6128. Object.defineProperty(a.prototype, "id", {
  6129. get : function () {
  6130. return this._id
  6131. },
  6132. set : function (b) {
  6133. this._id = b
  6134. },
  6135. enumerable : !0,
  6136. configurable : !0
  6137. });
  6138. Object.defineProperty(a.prototype, "isPopUp", {
  6139. get : function () {
  6140. return this._isPopUp
  6141. },
  6142. set : function (b) {
  6143. this._isPopUp = b
  6144. },
  6145. enumerable : !0,
  6146. configurable : !0
  6147. });
  6148. Object.defineProperty(a.prototype, "owner", {
  6149. get : function () {
  6150. return this._owner ? this._owner : this.parent
  6151. },
  6152. enumerable : !0,
  6153. configurable : !0
  6154. });
  6155. a.prototype.ownerChanged = function (b) {
  6156. this._owner = b
  6157. };
  6158. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  6159. get : function () {
  6160. return this._updateCompletePendingFlag
  6161. },
  6162. set : function (b) {
  6163. this._updateCompletePendingFlag =
  6164. b
  6165. },
  6166. enumerable : !0,
  6167. configurable : !0
  6168. });
  6169. Object.defineProperty(a.prototype, "initialized", {
  6170. get : function () {
  6171. return this._initialized
  6172. },
  6173. set : function (b) {
  6174. this._initialized != b && (this._initialized = b) && e.UIEvent.dispatchUIEvent(this, e.UIEvent.CREATION_COMPLETE)
  6175. },
  6176. enumerable : !0,
  6177. configurable : !0
  6178. });
  6179. a.prototype._initialize = function () {
  6180. this.initializeCalled || (e.UIGlobals.stage && this.removeEventListener(d.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, e.UIEvent.dispatchUIEvent(this, e.UIEvent.INITIALIZE),
  6181. this.createChildren(), this.childrenCreated())
  6182. };
  6183. a.prototype.createChildren = function () {};
  6184. a.prototype.childrenCreated = function () {
  6185. this.invalidateProperties();
  6186. this.invalidateSize();
  6187. this.invalidateDisplayList()
  6188. };
  6189. Object.defineProperty(a.prototype, "nestLevel", {
  6190. get : function () {
  6191. return this._nestLevel
  6192. },
  6193. set : function (b) {
  6194. if (this._nestLevel != b)
  6195. for (this._nestLevel = b, 0 == this._nestLevel ? this.addEventListener(d.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(d.Event.ADDED_TO_STAGE, this.checkInvalidateFlag,
  6196. this), b = this.numChildren - 1; 0 <= b; b--) {
  6197. var a = this.getChildAt(b);
  6198. null != a && (a.nestLevel = this._nestLevel + 1)
  6199. }
  6200. },
  6201. enumerable : !0,
  6202. configurable : !0
  6203. });
  6204. a.prototype._addToDisplayList = function (b, a) {
  6205. "undefined" === typeof a && (a = !0);
  6206. var c = this.numChildren;
  6207. b.parent == this && c--;
  6208. this._addingChild(b);
  6209. this._doAddChild(b, c, a);
  6210. this._childAdded(b);
  6211. return b
  6212. };
  6213. a.prototype._addToDisplayListAt = function (b, a, c) {
  6214. "undefined" === typeof c && (c = !0);
  6215. this._addingChild(b);
  6216. this._doAddChild(b, a, c);
  6217. this._childAdded(b);
  6218. return b
  6219. };
  6220. a.prototype._removeFromDisplayList =
  6221. function (b, a) {
  6222. "undefined" === typeof a && (a = !0);
  6223. var c = this._children.indexOf(b);
  6224. if (0 <= c)
  6225. return this._doRemoveChild(c, a), this._childRemoved(b), b;
  6226. d.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  6227. return null
  6228. };
  6229. a.prototype._removeFromDisplayListAt = function (b, a) {
  6230. "undefined" === typeof a && (a = !0);
  6231. if (0 <= b && b < this._children.length) {
  6232. var c = this._doRemoveChild(b, a);
  6233. this._childRemoved(c);
  6234. return c
  6235. }
  6236. d.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  6237. return null
  6238. };
  6239. a.prototype.addChild =
  6240. function (b) {
  6241. this._addingChild(b);
  6242. c.prototype.addChild.call(this, b);
  6243. this._childAdded(b);
  6244. return b
  6245. };
  6246. a.prototype.addChildAt = function (b, a) {
  6247. this._addingChild(b);
  6248. c.prototype.addChildAt.call(this, b, a);
  6249. this._childAdded(b);
  6250. return b
  6251. };
  6252. a.prototype._addingChild = function (b) {
  6253. b && "nestLevel" in b && (b.nestLevel = this._nestLevel + 1)
  6254. };
  6255. a.prototype._childAdded = function (b) {
  6256. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  6257. };
  6258. a.prototype.removeChild = function (b) {
  6259. c.prototype.removeChild.call(this, b);
  6260. this._childRemoved(b);
  6261. return b
  6262. };
  6263. a.prototype.removeChildAt = function (b) {
  6264. b = c.prototype.removeChildAt.call(this, b);
  6265. this._childRemoved(b);
  6266. return b
  6267. };
  6268. a.prototype._childRemoved = function (b) {
  6269. b && "nestLevel" in b && (b.nestLevel = 0)
  6270. };
  6271. a.prototype.checkInvalidateFlag = function (b) {
  6272. e.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && e.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && e.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && e.UIGlobals._layoutManager.invalidateDisplayList(this),
  6273. this._validateNowFlag && (e.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  6274. };
  6275. Object.defineProperty(a.prototype, "enabled", {
  6276. get : function () {
  6277. return this._enabled
  6278. },
  6279. set : function (b) {
  6280. this._enabled = b
  6281. },
  6282. enumerable : !0,
  6283. configurable : !0
  6284. });
  6285. a.prototype._setWidth = function (b) {
  6286. if (this._width != b || this._explicitWidth != b)
  6287. c.prototype._setWidth.call(this, b), isNaN(b) ? this.invalidateSize() : this._width = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6288. };
  6289. Object.defineProperty(a.prototype, "width", {
  6290. get : function () {
  6291. return this._width
  6292. },
  6293. set : function (b) {
  6294. this._setWidth(b)
  6295. },
  6296. enumerable : !0,
  6297. configurable : !0
  6298. });
  6299. a.prototype._setHeight = function (b) {
  6300. if (this._height != b || this._explicitHeight != b)
  6301. c.prototype._setHeight.call(this, b), isNaN(b) ? this.invalidateSize() : this._height = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6302. };
  6303. Object.defineProperty(a.prototype, "height", {
  6304. get : function () {
  6305. return this._height
  6306. },
  6307. set : function (b) {
  6308. this._setHeight(b)
  6309. },
  6310. enumerable : !0,
  6311. configurable : !0
  6312. });
  6313. Object.defineProperty(a.prototype, "scaleX", {
  6314. get : function () {
  6315. return this._scaleX
  6316. },
  6317. set : function (b) {
  6318. this._setScaleX(b)
  6319. },
  6320. enumerable : !0,
  6321. configurable : !0
  6322. });
  6323. a.prototype._setScaleX = function (b) {
  6324. this._scaleX != b && (this._scaleX = b, this.invalidateParentSizeAndDisplayList())
  6325. };
  6326. Object.defineProperty(a.prototype, "scaleY", {
  6327. get : function () {
  6328. return this._scaleY
  6329. },
  6330. set : function (b) {
  6331. this._setScaleY(b)
  6332. },
  6333. enumerable : !0,
  6334. configurable : !0
  6335. });
  6336. a.prototype._setScaleY = function (b) {
  6337. this._scaleY != b && (this._scaleY =
  6338. b, this.invalidateParentSizeAndDisplayList())
  6339. };
  6340. Object.defineProperty(a.prototype, "minWidth", {
  6341. get : function () {
  6342. return this._minWidth
  6343. },
  6344. set : function (b) {
  6345. this._minWidth != b && (this._minWidth = b, this.invalidateSize())
  6346. },
  6347. enumerable : !0,
  6348. configurable : !0
  6349. });
  6350. Object.defineProperty(a.prototype, "maxWidth", {
  6351. get : function () {
  6352. return this._maxWidth
  6353. },
  6354. set : function (b) {
  6355. this._maxWidth != b && (this._maxWidth = b, this.invalidateSize())
  6356. },
  6357. enumerable : !0,
  6358. configurable : !0
  6359. });
  6360. Object.defineProperty(a.prototype, "minHeight", {
  6361. get : function () {
  6362. return this._minHeight
  6363. },
  6364. set : function (b) {
  6365. this._minHeight != b && (this._minHeight = b, this.invalidateSize())
  6366. },
  6367. enumerable : !0,
  6368. configurable : !0
  6369. });
  6370. Object.defineProperty(a.prototype, "maxHeight", {
  6371. get : function () {
  6372. return this._maxHeight
  6373. },
  6374. set : function (b) {
  6375. this._maxHeight != b && (this._maxHeight = b, this.invalidateSize())
  6376. },
  6377. enumerable : !0,
  6378. configurable : !0
  6379. });
  6380. Object.defineProperty(a.prototype, "measuredWidth", {
  6381. get : function () {
  6382. return this._measuredWidth
  6383. },
  6384. set : function (b) {
  6385. this._measuredWidth = b
  6386. },
  6387. enumerable : !0,
  6388. configurable : !0
  6389. });
  6390. Object.defineProperty(a.prototype,
  6391. "measuredHeight", {
  6392. get : function () {
  6393. return this._measuredHeight
  6394. },
  6395. set : function (b) {
  6396. this._measuredHeight = b
  6397. },
  6398. enumerable : !0,
  6399. configurable : !0
  6400. });
  6401. a.prototype.setActualSize = function (b, a) {
  6402. var c = !1;
  6403. this._width != b && (this._width = b, c = !0);
  6404. this._height != a && (this._height = a, c = !0);
  6405. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6406. };
  6407. Object.defineProperty(a.prototype, "x", {
  6408. get : function () {
  6409. return this._x
  6410. },
  6411. set : function (b) {
  6412. this._x != b && (this._x = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof
  6413. a && this.parent._childXYChanged())
  6414. },
  6415. enumerable : !0,
  6416. configurable : !0
  6417. });
  6418. Object.defineProperty(a.prototype, "y", {
  6419. get : function () {
  6420. return this._y
  6421. },
  6422. set : function (b) {
  6423. this._y != b && (this._y = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6424. },
  6425. enumerable : !0,
  6426. configurable : !0
  6427. });
  6428. a.prototype.invalidateProperties = function () {
  6429. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateProperties(this))
  6430. };
  6431. a.prototype.validateProperties = function () {
  6432. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6433. };
  6434. a.prototype.invalidateSize = function () {
  6435. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateSize(this))
  6436. };
  6437. a.prototype.validateSize = function (b) {
  6438. "undefined" === typeof b && (b = !1);
  6439. if (b)
  6440. for (b = 0; b < this.numChildren; b++) {
  6441. var a = this.getChildAt(b);
  6442. "validateSize" in a && a.validateSize(!0)
  6443. }
  6444. this._invalidateSizeFlag &&
  6445. (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6446. };
  6447. a.prototype.measureSizes = function () {
  6448. var b = !1;
  6449. if (!this._invalidateSizeFlag)
  6450. return b;
  6451. 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 =
  6452. this.maxHeight));
  6453. if (isNaN(this._oldPreferWidth))
  6454. this._oldPreferWidth = this.preferredWidth, this._oldPreferHeight = this.preferredHeight, b = !0;
  6455. else {
  6456. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight)
  6457. b = !0;
  6458. this._oldPreferWidth = this.preferredWidth;
  6459. this._oldPreferHeight = this.preferredHeight
  6460. }
  6461. return b
  6462. };
  6463. a.prototype.invalidateDisplayList = function () {
  6464. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateDisplayList(this))
  6465. };
  6466. a.prototype.validateDisplayList = function () {
  6467. if (this._invalidateDisplayListFlag) {
  6468. var b = 0,
  6469. a = 0,
  6470. b = this._layoutWidthExplicitlySet ? this._width : isNaN(this.explicitWidth) ? this.measuredWidth : this._explicitWidth,
  6471. a = this._layoutHeightExplicitlySet ? this._height : isNaN(this.explicitHeight) ? this.measuredHeight : this._explicitHeight;
  6472. isNaN(b) && (b = 0);
  6473. isNaN(a) && (a = 0);
  6474. this.setActualSize(b, a);
  6475. this.updateDisplayList(b, a);
  6476. this._invalidateDisplayListFlag = !1
  6477. }
  6478. };
  6479. a.prototype.validateNow = function (b) {
  6480. "undefined" === typeof b && (b = !1);
  6481. this._validateNowFlag || null == e.UIGlobals._layoutManager ? this._validateNowFlag = !0 : e.UIGlobals._layoutManager.validateClient(this, b)
  6482. };
  6483. a.prototype.invalidateParentSizeAndDisplayList = function () {
  6484. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6485. var b = this.parent;
  6486. b.invalidateSize();
  6487. b.invalidateDisplayList()
  6488. }
  6489. };
  6490. a.prototype.updateDisplayList = function (b, a) {};
  6491. a.prototype.canSkipMeasurement = function () {
  6492. return !isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6493. };
  6494. a.prototype.commitProperties =
  6495. function () {
  6496. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6497. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6498. };
  6499. a.prototype.measure = function () {
  6500. this._measuredWidth = this._measuredHeight = 0
  6501. };
  6502. a.prototype.dispatchMoveEvent = function () {
  6503. this.hasEventListener(e.MoveEvent.MOVE) && e.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  6504. this.oldX = this.x;
  6505. this.oldY = this.y
  6506. };
  6507. a.prototype._childXYChanged = function () {};
  6508. a.prototype.dispatchResizeEvent = function () {
  6509. this.hasEventListener(e.ResizeEvent.RESIZE) &&
  6510. e.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  6511. this.oldWidth = this._width;
  6512. this.oldHeight = this._height
  6513. };
  6514. Object.defineProperty(a.prototype, "includeInLayout", {
  6515. get : function () {
  6516. return this._includeInLayout
  6517. },
  6518. set : function (b) {
  6519. this._includeInLayout != b && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = b)
  6520. },
  6521. enumerable : !0,
  6522. configurable : !0
  6523. });
  6524. Object.defineProperty(a.prototype, "left", {
  6525. get : function () {
  6526. return this._left
  6527. },
  6528. set : function (b) {
  6529. this._left != b && (this._left =
  6530. b, this.invalidateParentSizeAndDisplayList())
  6531. },
  6532. enumerable : !0,
  6533. configurable : !0
  6534. });
  6535. Object.defineProperty(a.prototype, "right", {
  6536. get : function () {
  6537. return this._right
  6538. },
  6539. set : function (b) {
  6540. this._right != b && (this._right = b, this.invalidateParentSizeAndDisplayList())
  6541. },
  6542. enumerable : !0,
  6543. configurable : !0
  6544. });
  6545. Object.defineProperty(a.prototype, "top", {
  6546. get : function () {
  6547. return this._top
  6548. },
  6549. set : function (b) {
  6550. this._top != b && (this._top = b, this.invalidateParentSizeAndDisplayList())
  6551. },
  6552. enumerable : !0,
  6553. configurable : !0
  6554. });
  6555. Object.defineProperty(a.prototype,
  6556. "bottom", {
  6557. get : function () {
  6558. return this._bottom
  6559. },
  6560. set : function (b) {
  6561. this._bottom != b && (this._bottom = b, this.invalidateParentSizeAndDisplayList())
  6562. },
  6563. enumerable : !0,
  6564. configurable : !0
  6565. });
  6566. Object.defineProperty(a.prototype, "horizontalCenter", {
  6567. get : function () {
  6568. return this._horizontalCenter
  6569. },
  6570. set : function (b) {
  6571. this._horizontalCenter != b && (this._horizontalCenter = b, this.invalidateParentSizeAndDisplayList())
  6572. },
  6573. enumerable : !0,
  6574. configurable : !0
  6575. });
  6576. Object.defineProperty(a.prototype, "verticalCenter", {
  6577. get : function () {
  6578. return this._verticalCenter
  6579. },
  6580. set : function (b) {
  6581. this._verticalCenter != b && (this._verticalCenter = b, this.invalidateParentSizeAndDisplayList())
  6582. },
  6583. enumerable : !0,
  6584. configurable : !0
  6585. });
  6586. Object.defineProperty(a.prototype, "percentWidth", {
  6587. get : function () {
  6588. return this._percentWidth
  6589. },
  6590. set : function (b) {
  6591. this._percentWidth != b && (this._percentWidth = b, this.invalidateParentSizeAndDisplayList())
  6592. },
  6593. enumerable : !0,
  6594. configurable : !0
  6595. });
  6596. Object.defineProperty(a.prototype, "percentHeight", {
  6597. get : function () {
  6598. return this._percentHeight
  6599. },
  6600. set : function (b) {
  6601. this._percentHeight !=
  6602. b && (this._percentHeight = b, this.invalidateParentSizeAndDisplayList())
  6603. },
  6604. enumerable : !0,
  6605. configurable : !0
  6606. });
  6607. a.prototype.setLayoutBoundsSize = function (b, a) {
  6608. isNaN(b) ? (this._layoutWidthExplicitlySet = !1, b = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  6609. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  6610. this.setActualSize(b / this._scaleX, a / this._scaleY)
  6611. };
  6612. a.prototype.setLayoutBoundsPosition = function (b, a) {
  6613. 0 > this._scaleX && (b += this.layoutBoundsWidth);
  6614. 0 > this._scaleY &&
  6615. (a += this.layoutBoundsHeight);
  6616. var c = !1;
  6617. this._x != b && (this._x = b, c = !0);
  6618. this._y != a && (this._y = a, c = !0);
  6619. c && this.dispatchMoveEvent()
  6620. };
  6621. Object.defineProperty(a.prototype, "preferredWidth", {
  6622. get : function () {
  6623. var b = this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6624. a = this._scaleX;
  6625. 0 > a && (a = -a);
  6626. return b * a
  6627. },
  6628. enumerable : !0,
  6629. configurable : !0
  6630. });
  6631. Object.defineProperty(a.prototype, "preferredHeight", {
  6632. get : function () {
  6633. var b = this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6634. a = this._scaleY;
  6635. 0 > a && (a = -a);
  6636. return b * a
  6637. },
  6638. enumerable : !0,
  6639. configurable : !0
  6640. });
  6641. Object.defineProperty(a.prototype, "preferredX", {
  6642. get : function () {
  6643. return 0 <= this._scaleX ? this._x : this._x - this.preferredWidth
  6644. },
  6645. enumerable : !0,
  6646. configurable : !0
  6647. });
  6648. Object.defineProperty(a.prototype, "preferredY", {
  6649. get : function () {
  6650. return 0 <= this._scaleY ? this._y : this._y - this.preferredHeight
  6651. },
  6652. enumerable : !0,
  6653. configurable : !0
  6654. });
  6655. Object.defineProperty(a.prototype, "layoutBoundsX", {
  6656. get : function () {
  6657. return 0 <= this._scaleX ? this._x : this._x - this.layoutBoundsWidth
  6658. },
  6659. enumerable : !0,
  6660. configurable : !0
  6661. });
  6662. Object.defineProperty(a.prototype, "layoutBoundsY", {
  6663. get : function () {
  6664. return 0 <= this._scaleY ? this._y : this._y - this.layoutBoundsHeight
  6665. },
  6666. enumerable : !0,
  6667. configurable : !0
  6668. });
  6669. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  6670. get : function () {
  6671. var b = 0,
  6672. b = this._layoutWidthExplicitlySet ? this._width : this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6673. a = this._scaleX;
  6674. 0 > a && (a = -a);
  6675. return b * a
  6676. },
  6677. enumerable : !0,
  6678. configurable : !0
  6679. });
  6680. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  6681. get : function () {
  6682. var b = 0,
  6683. b = this._layoutHeightExplicitlySet ?
  6684. this._height : this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6685. a = this.scaleY;
  6686. 0 > a && (a = -a);
  6687. return b * a
  6688. },
  6689. enumerable : !0,
  6690. configurable : !0
  6691. });
  6692. return a
  6693. }
  6694. (d.DisplayObjectContainer);
  6695. e.UIComponent = f;
  6696. f.prototype.__class__ = "egret.gui.UIComponent"
  6697. })(d.gui || (d.gui = {}))
  6698. })(egret || (egret = {}));
  6699. (function (d) {
  6700. (function (d) {
  6701. var f = function () {
  6702. function c() {}
  6703. c.ABOVE = "above";
  6704. c.BELOW = "below";
  6705. c.CENTER = "center";
  6706. c.TOP_LEFT = "topLeft";
  6707. c.LEFT = "left";
  6708. c.RIGHT = "right";
  6709. return c
  6710. }
  6711. ();
  6712. d.PopUpPosition = f;
  6713. f.prototype.__class__ = "egret.gui.PopUpPosition"
  6714. })(d.gui || (d.gui = {}))
  6715. })(egret || (egret = {}));
  6716. (function (d) {
  6717. (function (d) {
  6718. var f = function () {
  6719. function c() {}
  6720. c.AUTO = "auto";
  6721. c.OFF = "off";
  6722. c.ON = "on";
  6723. return c
  6724. }
  6725. ();
  6726. d.ScrollPolicy = f;
  6727. f.prototype.__class__ = "egret.gui.ScrollPolicy"
  6728. })(d.gui || (d.gui = {}))
  6729. })(egret || (egret = {}));
  6730. __extends = this.__extends || function (d, e) {
  6731. function f() {
  6732. this.constructor = d
  6733. }
  6734. for (var c in e)
  6735. e.hasOwnProperty(c) && (d[c] = e[c]);
  6736. f.prototype = e.prototype;
  6737. d.prototype = new f
  6738. };
  6739. (function (d) {
  6740. (function (e) {
  6741. var f = function (c) {
  6742. function a(b) {
  6743. "undefined" === typeof b && (b = null);
  6744. c.call(this);
  6745. this.generator = b
  6746. }
  6747. __extends(a, c);
  6748. a.prototype.newInstance = function () {
  6749. return new this.generator
  6750. };
  6751. return a
  6752. }
  6753. (d.HashObject);
  6754. e.ClassFactory = f;
  6755. f.prototype.__class__ = "egret.gui.ClassFactory"
  6756. })(d.gui || (d.gui = {}))
  6757. })(egret || (egret = {}));
  6758. __extends = this.__extends || function (d, e) {
  6759. function f() {
  6760. this.constructor = d
  6761. }
  6762. for (var c in e)
  6763. e.hasOwnProperty(c) && (d[c] = e[c]);
  6764. f.prototype = e.prototype;
  6765. d.prototype = new f
  6766. };
  6767. (function (d) {
  6768. (function (e) {
  6769. var f = function (c) {
  6770. function a() {
  6771. c.call(this)
  6772. }
  6773. __extends(a, c);
  6774. a.prototype.initialize = function (b) {};
  6775. a.prototype.apply = function (b) {};
  6776. a.prototype.remove = function (b) {};
  6777. a.prototype.initializeFromObject = function (b) {
  6778. for (var a in b)
  6779. this[a] = b[a];
  6780. return this
  6781. };
  6782. return a
  6783. }
  6784. (d.HashObject);
  6785. e.OverrideBase = f;
  6786. f.prototype.__class__ = "egret.gui.OverrideBase"
  6787. })(d.gui || (d.gui = {}))
  6788. })(egret || (egret = {}));
  6789. __extends = this.__extends || function (d, e) {
  6790. function f() {
  6791. this.constructor = d
  6792. }
  6793. for (var c in e)
  6794. e.hasOwnProperty(c) && (d[c] = e[c]);
  6795. f.prototype = e.prototype;
  6796. d.prototype = new f
  6797. };
  6798. (function (d) {
  6799. (function (d) {
  6800. var f = function (c) {
  6801. function a(b, d, e, f) {
  6802. c.call(this);
  6803. this.propertyName = "";
  6804. this.position = a.LAST;
  6805. this.target = b;
  6806. this.propertyName = d;
  6807. this.position = e;
  6808. this.relativeTo = f
  6809. }
  6810. __extends(a, c);
  6811. a.prototype.initialize = function (b) {
  6812. if ((b = b[this.target]) && !(b instanceof d.SkinnableComponent) && "_initialize" in b)
  6813. try {
  6814. b._initialize()
  6815. } catch (a) {}
  6816. };
  6817. a.prototype.apply = function (b) {
  6818. var c,
  6819. d;
  6820. try {
  6821. d = b[this.relativeTo]
  6822. } catch (e) {}
  6823. var f = b[this.target];
  6824. b = this.propertyName ? b[this.propertyName] : b;
  6825. if (f && b) {
  6826. switch (this.position) {
  6827. case a.FIRST:
  6828. c =
  6829. 0;
  6830. break;
  6831. case a.LAST:
  6832. c = -1;
  6833. break;
  6834. case a.BEFORE:
  6835. c = b.getElementIndex(d);
  6836. break;
  6837. case a.AFTER:
  6838. c = b.getElementIndex(d) + 1
  6839. }
  6840. -1 == c && (c = b.numElements);
  6841. b.addElementAt(f, c)
  6842. }
  6843. };
  6844. a.prototype.remove = function (b) {
  6845. var a = null == this.propertyName || "" == this.propertyName ? b : b[this.propertyName];
  6846. (b = b[this.target]) && a && -1 != a.getElementIndex(b) && a.removeElement(b)
  6847. };
  6848. a.FIRST = "first";
  6849. a.LAST = "last";
  6850. a.BEFORE = "before";
  6851. a.AFTER = "after";
  6852. return a
  6853. }
  6854. (d.OverrideBase);
  6855. d.AddItems = f;
  6856. f.prototype.__class__ = "egret.gui.AddItems"
  6857. })(d.gui || (d.gui = {}))
  6858. })(egret ||
  6859. (egret = {}));
  6860. __extends = this.__extends || function (d, e) {
  6861. function f() {
  6862. this.constructor = d
  6863. }
  6864. for (var c in e)
  6865. e.hasOwnProperty(c) && (d[c] = e[c]);
  6866. f.prototype = e.prototype;
  6867. d.prototype = new f
  6868. };
  6869. (function (d) {
  6870. (function (d) {
  6871. var f = function (c) {
  6872. function a(b, a, d) {
  6873. c.call(this);
  6874. this.target = b;
  6875. this.name = a;
  6876. this.value = d
  6877. }
  6878. __extends(a, c);
  6879. a.prototype.apply = function (b) {
  6880. b = null == this.target || "" == this.target ? b : b[this.target];
  6881. null != b && (this.oldValue = b[this.name], this.setPropertyValue(b, this.name, this.value, this.oldValue))
  6882. };
  6883. a.prototype.remove = function (b) {
  6884. b = null == this.target || "" == this.target ? b : b[this.target];
  6885. null != b && (this.setPropertyValue(b, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  6886. };
  6887. a.prototype.setPropertyValue =
  6888. function (b, a, c, d) {
  6889. b[a] = void 0 === c || null === c ? c : "boolean" == typeof d ? this.toBoolean(c) : c
  6890. };
  6891. a.prototype.toBoolean = function (b) {
  6892. return "string" == typeof b ? "true" == b.toLowerCase() : !1 != b
  6893. };
  6894. return a
  6895. }
  6896. (d.OverrideBase);
  6897. d.SetProperty = f;
  6898. f.prototype.__class__ = "egret.gui.SetProperty"
  6899. })(d.gui || (d.gui = {}))
  6900. })(egret || (egret = {}));
  6901. __extends = this.__extends || function (d, e) {
  6902. function f() {
  6903. this.constructor = d
  6904. }
  6905. for (var c in e)
  6906. e.hasOwnProperty(c) && (d[c] = e[c]);
  6907. f.prototype = e.prototype;
  6908. d.prototype = new f
  6909. };
  6910. (function (d) {
  6911. (function (e) {
  6912. var f = function (c) {
  6913. function a(b, a) {
  6914. c.call(this);
  6915. this.initialized = !1;
  6916. this.name = b;
  6917. this.overrides = a
  6918. }
  6919. __extends(a, c);
  6920. a.prototype.initialize = function (b) {
  6921. if (!this.initialized) {
  6922. this.initialized = !0;
  6923. for (var a = 0; a < this.overrides.length; a++)
  6924. this.overrides[a].initialize(b)
  6925. }
  6926. };
  6927. return a
  6928. }
  6929. (d.HashObject);
  6930. e.State = f;
  6931. f.prototype.__class__ = "egret.gui.State"
  6932. })(d.gui || (d.gui = {}))
  6933. })(egret || (egret = {}));
  6934. (function (d) {
  6935. (function (d) {
  6936. var f = function () {
  6937. function c() {}
  6938. c.adjustRelativeByXY = function (a, b) {
  6939. "undefined" === typeof b && (b = null);
  6940. if (a && (b || (b = a.parent), b)) {
  6941. var c = a.x,
  6942. d = a.y,
  6943. e = a.layoutBoundsHeight,
  6944. f = a.layoutBoundsWidth,
  6945. g = b.width,
  6946. l = b.height;
  6947. isNaN(a.left) || (a.left = c);
  6948. isNaN(a.right) || (a.right = g - c - f);
  6949. isNaN(a.horizontalCenter) || (a.horizontalCenter = c + 0.5 * f - 0.5 * g);
  6950. isNaN(a.top) || (a.top = d);
  6951. isNaN(a.bottom) || (a.bottom = l - d - e);
  6952. isNaN(a.verticalCenter) || (a.verticalCenter = 0.5 * e - 0.5 * l + d)
  6953. }
  6954. };
  6955. return c
  6956. }
  6957. ();
  6958. d.LayoutUtil = f;
  6959. f.prototype.__class__ =
  6960. "egret.gui.LayoutUtil"
  6961. })(d.gui || (d.gui = {}))
  6962. })(egret || (egret = {}));
  6963. (function (d) {
  6964. (function (e) {
  6965. var f = {};
  6966. e.getScale9Grid = function (c) {
  6967. if (f[c])
  6968. return f[c];
  6969. if (!c)
  6970. return null;
  6971. var a = c.split(","),
  6972. a = new d.Rectangle(parseInt(a[0]), parseInt(a[1]), parseInt(a[2]), parseInt(a[3]));
  6973. return f[c] = a
  6974. }
  6975. })(d.gui || (d.gui = {}))
  6976. })(egret || (egret = {}));
  6977. __extends = this.__extends || function (d, e) {
  6978. function f() {
  6979. this.constructor = d
  6980. }
  6981. for (var c in e)
  6982. e.hasOwnProperty(c) && (d[c] = e[c]);
  6983. f.prototype = e.prototype;
  6984. d.prototype = new f
  6985. };
  6986. (function (d) {
  6987. (function (e) {
  6988. var f = function (c) {
  6989. function a(b, a) {
  6990. "undefined" === typeof a && (a = !0);
  6991. c.call(this);
  6992. this.fillMode = "scale";
  6993. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  6994. this.autoScale = !0;
  6995. this.touchChildren = !1;
  6996. b && (this.source = b);
  6997. this.autoScale = a
  6998. }
  6999. __extends(a, c);
  7000. Object.defineProperty(a.prototype, "source", {
  7001. get : function () {
  7002. return this._source
  7003. },
  7004. set : function (b) {
  7005. this._source != b && (this._source = b, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0)
  7006. },
  7007. enumerable : !0,
  7008. configurable : !0
  7009. });
  7010. Object.defineProperty(a.prototype, "content", {
  7011. get : function () {
  7012. return this._content
  7013. },
  7014. enumerable : !0,
  7015. configurable : !0
  7016. });
  7017. a.prototype.createChildren = function () {
  7018. c.prototype.createChildren.call(this);
  7019. this.sourceChanged && this.parseSource();
  7020. this.createChildrenCalled = !0
  7021. };
  7022. a.prototype.parseSource = function () {
  7023. this.sourceChanged = !1;
  7024. var b = a.assetAdapter;
  7025. b || (b = this.getAdapter());
  7026. if (this._source) {
  7027. var c = this.contentReused ? null : this._content;
  7028. this.contentReused = !0;
  7029. b.getAsset(this._source, this.contentChanged, this, c)
  7030. } else
  7031. this.contentChanged(null,
  7032. null)
  7033. };
  7034. a.prototype.getAdapter = function () {
  7035. var b;
  7036. try {
  7037. b = d.Injector.getInstance("egret.gui.IAssetAdapter")
  7038. } catch (c) {
  7039. b = new e.DefaultAssetAdapter
  7040. }
  7041. return a.assetAdapter = b
  7042. };
  7043. a.prototype.contentChanged = function (b, a) {
  7044. if (a === this._source) {
  7045. var c = this._content;
  7046. this._content = b;
  7047. c !== b && (c instanceof d.DisplayObject && this._removeFromDisplayList(c), b instanceof d.DisplayObject && this._addToDisplayListAt(b, 0));
  7048. this.invalidateSize();
  7049. this.invalidateDisplayList();
  7050. this.contentReused = !1;
  7051. this.hasEventListener(e.UIEvent.CONTENT_CHANGED) &&
  7052. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CONTENT_CHANGED)
  7053. }
  7054. };
  7055. a.prototype.measure = function () {
  7056. c.prototype.measure.call(this);
  7057. var b = this._content;
  7058. b instanceof d.DisplayObject ? "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width * b.scaleX, this.measuredHeight = b.height * b.scaleY) : b instanceof d.Texture && (this.measuredWidth = b._textureWidth, this.measuredHeight = b._textureHeight)
  7059. };
  7060. a.prototype.updateDisplayList = function (b, a) {
  7061. c.prototype.updateDisplayList.call(this,
  7062. b, a);
  7063. var e = this._content;
  7064. this.autoScale && e instanceof d.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : (e.width = b / e.scaleX, e.height = a / e.scaleY));
  7065. this._setSizeDirty()
  7066. };
  7067. a.prototype._render = function (b) {
  7068. if (this._content instanceof d.Texture) {
  7069. var a = this._content;
  7070. this._texture_to_render = a;
  7071. var e;
  7072. this.autoScale ? (e = this._width, a = this._height) : (e = a.textureWidth, a = a.textureHeight);
  7073. d.Bitmap._drawBitmap(b, e, a, this)
  7074. } else
  7075. this._texture_to_render = null;
  7076. c.prototype._render.call(this, b)
  7077. };
  7078. a.prototype._measureBounds =
  7079. function () {
  7080. var b = c.prototype._measureBounds.call(this);
  7081. if (this._content instanceof d.Texture) {
  7082. var a = this._content,
  7083. e = this.width,
  7084. f = this.height,
  7085. h = Math.floor(a._offsetX * e / a._textureWidth),
  7086. a = Math.floor(a._offsetY * f / a._textureHeight);
  7087. h < b.x && (b.x = h);
  7088. a < b.y && (b.y = a);
  7089. h + e > b.right && (b.right = h + e);
  7090. a + f > b.bottom && (b.bottom = a + f)
  7091. }
  7092. return b
  7093. };
  7094. a.prototype.addChild = function (b) {
  7095. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  7096. };
  7097. a.prototype.addChildAt = function (b, c) {
  7098. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  7099. };
  7100. a.prototype.removeChild = function (b) {
  7101. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  7102. };
  7103. a.prototype.removeChildAt = function (b) {
  7104. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  7105. };
  7106. a.prototype.setChildIndex = function (b, c) {
  7107. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  7108. };
  7109. a.prototype.swapChildren = function (b, c) {
  7110. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  7111. };
  7112. a.prototype.swapChildrenAt = function (b, c) {
  7113. throw Error("swapChildrenAt()" +
  7114. a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  7115. };
  7116. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  7117. return a
  7118. }
  7119. (e.UIComponent);
  7120. e.UIAsset = f;
  7121. f.prototype.__class__ = "egret.gui.UIAsset"
  7122. })(d.gui || (d.gui = {}))
  7123. })(egret || (egret = {}));
  7124. __extends = this.__extends || function (d, e) {
  7125. function f() {
  7126. this.constructor = d
  7127. }
  7128. for (var c in e)
  7129. e.hasOwnProperty(c) && (d[c] = e[c]);
  7130. f.prototype = e.prototype;
  7131. d.prototype = new f
  7132. };
  7133. (function (d) {
  7134. (function (e) {
  7135. var f = function (c) {
  7136. function a() {
  7137. c.call(this);
  7138. this.hostComponentKey = "egret.gui.SkinnableComponent";
  7139. this.stateIsDirty = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  7140. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  7141. }
  7142. __extends(a, c);
  7143. Object.defineProperty(a.prototype, "skinName", {
  7144. get : function () {
  7145. return this._skinName
  7146. },
  7147. set : function (b) {
  7148. this._skinName != b && (this._skinName = b, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  7149. },
  7150. enumerable : !0,
  7151. configurable : !0
  7152. });
  7153. Object.defineProperty(a.prototype, "skin", {
  7154. get : function () {
  7155. return this._skin
  7156. },
  7157. enumerable : !0,
  7158. configurable : !0
  7159. });
  7160. a.prototype.createChildren = function () {
  7161. c.prototype.createChildren.call(this);
  7162. this.parseSkinName();
  7163. this.createChildrenCalled = !0
  7164. };
  7165. a.prototype.parseSkinName = function () {
  7166. var b = a.skinAdapter;
  7167. b || (b = this.getSkinAdapter());
  7168. var b = b.getSkin(this._skinName, this.hostComponentKey),
  7169. c = this._skin;
  7170. this.detachSkin(c);
  7171. c instanceof d.DisplayObject && this._removeFromDisplayList(c);
  7172. this._skin =
  7173. b;
  7174. b instanceof d.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  7175. this.attachSkin(b);
  7176. this.invalidateSkinState();
  7177. this.invalidateSize();
  7178. this.invalidateDisplayList();
  7179. this.hasEventListener(e.UIEvent.SKIN_CHANGED) && e.UIEvent.dispatchUIEvent(this, e.UIEvent.SKIN_CHANGED)
  7180. };
  7181. a.prototype.getSkinAdapter = function () {
  7182. var b;
  7183. try {
  7184. b = d.Injector.getInstance("egret.gui.ISkinAdapter")
  7185. } catch (c) {
  7186. b = new e.DefaultSkinAdapter
  7187. }
  7188. return a.skinAdapter = b
  7189. };
  7190. a.prototype.attachSkin = function (b) {
  7191. b && "hostComponent" in b && (b.hostComponent =
  7192. this, this.findSkinParts());
  7193. b && "hostComponent" in b && b instanceof d.DisplayObject ? this._setSkinLayoutEnabled(!1) : this._setSkinLayoutEnabled(!0)
  7194. };
  7195. a.prototype.findSkinParts = function () {
  7196. var b = this._skin;
  7197. if (b && "skinParts" in b)
  7198. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  7199. var e = a[d];
  7200. if (e in b)
  7201. try {
  7202. this[e] = b[e],
  7203. this.partAdded(e, b[e])
  7204. } catch (f) {}
  7205. }
  7206. };
  7207. a.prototype.detachSkin = function (b) {
  7208. if (b && "skinParts" in b) {
  7209. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  7210. var e = a[d];
  7211. e in this && (null != this[e] && this.partRemoved(e, this[e]),
  7212. this[e] = null)
  7213. }
  7214. b.hostComponent = null
  7215. }
  7216. };
  7217. a.prototype.partAdded = function (b, a) {
  7218. e.SkinPartEvent.dispatchSkinPartEvent(this, e.SkinPartEvent.PART_ADDED, b, a)
  7219. };
  7220. a.prototype.partRemoved = function (b, a) {
  7221. e.SkinPartEvent.dispatchSkinPartEvent(this, e.SkinPartEvent.PART_REMOVED, b, a)
  7222. };
  7223. a.prototype.invalidateSkinState = function () {
  7224. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  7225. };
  7226. a.prototype.validateSkinState = function () {
  7227. var b = this.getCurrentSkinState(),
  7228. a = this._skin;
  7229. a && "currentState" in a && (a.currentState =
  7230. b);
  7231. this.hasEventListener("stateChanged") && this.dispatchEventWith("stateChanged")
  7232. };
  7233. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  7234. get : function () {
  7235. return this._autoMouseEnabled
  7236. },
  7237. set : function (b) {
  7238. this._autoMouseEnabled != b && ((this._autoMouseEnabled = b) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren : !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled : !1) : (this._touchChildren = this.explicitMouseChildren, this._touchEnabled = this.explicitMouseEnabled))
  7239. },
  7240. enumerable : !0,
  7241. configurable : !0
  7242. });
  7243. Object.defineProperty(a.prototype, "touchChildren", {
  7244. get : function () {
  7245. return this._touchChildren
  7246. },
  7247. set : function (b) {
  7248. this.enabled && (this._touchChildren = b);
  7249. this.explicitMouseChildren = b
  7250. },
  7251. enumerable : !0,
  7252. configurable : !0
  7253. });
  7254. Object.defineProperty(a.prototype, "touchEnabled", {
  7255. get : function () {
  7256. return this._touchEnabled
  7257. },
  7258. set : function (b) {
  7259. this.enabled && (this._touchEnabled = b);
  7260. this.explicitMouseEnabled = b
  7261. },
  7262. enumerable : !0,
  7263. configurable : !0
  7264. });
  7265. Object.defineProperty(a.prototype, "enabled", {
  7266. get : function () {
  7267. return this._enabled
  7268. },
  7269. set : function (b) {
  7270. this._setEnabled(b)
  7271. },
  7272. enumerable : !0,
  7273. configurable : !0
  7274. });
  7275. a.prototype._setEnabled = function (b) {
  7276. this._enabled != b && (this._enabled = b, this._autoMouseEnabled && (this._touchChildren = b ? this.explicitMouseChildren : !1, this._touchEnabled = b ? this.explicitMouseEnabled : !1), this.invalidateSkinState())
  7277. };
  7278. a.prototype.getCurrentSkinState = function () {
  7279. return this.enabled ? "normal" : "disabled"
  7280. };
  7281. a.prototype.commitProperties = function () {
  7282. c.prototype.commitProperties.call(this);
  7283. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  7284. };
  7285. a.prototype._setSkinLayoutEnabled =
  7286. function (b) {
  7287. null != this.skinLayout != b && (b ? (this.skinLayout = new e.SkinBasicLayout, this.skinLayout.target = this) : this.skinLayout = this.skinLayout.target = null, this.invalidateSize(), this.invalidateDisplayList())
  7288. };
  7289. a.prototype._childXYChanged = function () {
  7290. this.skinLayout && (this.invalidateSize(), this.invalidateDisplayList())
  7291. };
  7292. a.prototype.measure = function () {
  7293. c.prototype.measure.call(this);
  7294. var b = this._skin;
  7295. if (b) {
  7296. var a = b instanceof d.DisplayObject;
  7297. a && (b && "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth,
  7298. this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width, this.measuredHeight = b.height));
  7299. this.skinLayout && this.skinLayout.measure();
  7300. if (!a) {
  7301. var a = this.measuredWidth,
  7302. e = this.measuredHeight;
  7303. try {
  7304. isNaN(b.width) || (a = Math.ceil(b.width)),
  7305. isNaN(b.height) || (e = Math.ceil(b.height)),
  7306. b.hasOwnProperty("minWidth") && a < b.minWidth && (a = b.minWidth),
  7307. b.hasOwnProperty("maxWidth") && a > b.maxWidth && (a = b.maxWidth),
  7308. b.hasOwnProperty("minHeight") && e < b.minHeight && (e = b.minHeight),
  7309. b.hasOwnProperty("maxHeight") && e > b.maxHeight &&
  7310. (e = b.maxHeight),
  7311. this.measuredWidth = a,
  7312. this.measuredHeight = e
  7313. } catch (f) {}
  7314. }
  7315. }
  7316. };
  7317. a.prototype.updateDisplayList = function (b, a) {
  7318. c.prototype.updateDisplayList.call(this, b, a);
  7319. var e = this._skin;
  7320. e && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : e instanceof d.DisplayObject && (e.scaleX = 0 == e.width ? 1 : b / e.width, e.scaleY = 0 == e.height ? 1 : a / e.height));
  7321. this.skinLayout && this.skinLayout.updateDisplayList(b, a)
  7322. };
  7323. a.prototype.addChild = function (b) {
  7324. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  7325. };
  7326. a.prototype.addChildAt =
  7327. function (b, c) {
  7328. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  7329. };
  7330. a.prototype.removeChild = function (b) {
  7331. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  7332. };
  7333. a.prototype.removeChildAt = function (b) {
  7334. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  7335. };
  7336. a.prototype.setChildIndex = function (b, c) {
  7337. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  7338. };
  7339. a.prototype.swapChildren = function (b, c) {
  7340. throw Error("swapChildren()" + a.errorStr +
  7341. "swapElements()\u4ee3\u66ff");
  7342. };
  7343. a.prototype.swapChildrenAt = function (b, c) {
  7344. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  7345. };
  7346. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  7347. return a
  7348. }
  7349. (e.UIComponent);
  7350. e.SkinnableComponent = f;
  7351. f.prototype.__class__ = "egret.gui.SkinnableComponent"
  7352. })(d.gui || (d.gui = {}))
  7353. })(egret || (egret = {}));
  7354. (function (d) {
  7355. (function (e) {
  7356. var f = function () {
  7357. function c() {}
  7358. c.prototype.getSkin = function (a, b) {
  7359. if (!a)
  7360. return null;
  7361. if (a.prototype)
  7362. return new a;
  7363. if ("string" == typeof a) {
  7364. var c = d.getDefinitionByName(a);
  7365. return c ? new c : null
  7366. }
  7367. return a
  7368. };
  7369. return c
  7370. }
  7371. ();
  7372. e.DefaultSkinAdapter = f;
  7373. f.prototype.__class__ = "egret.gui.DefaultSkinAdapter"
  7374. })(d.gui || (d.gui = {}))
  7375. })(egret || (egret = {}));
  7376. (function (d) {
  7377. (function (e) {
  7378. var f = function () {
  7379. function c() {}
  7380. c.prototype.getAsset = function (a, b, c, e) {
  7381. var f = a;
  7382. a.prototype && (f = new a);
  7383. if (f instanceof d.DisplayObject || f instanceof d.Texture)
  7384. b.call(c, f, a);
  7385. else if ("string" == typeof a) {
  7386. var h = new d.URLLoader;
  7387. h.dataFormat = d.URLLoaderDataFormat.TEXTURE;
  7388. h.addEventListener(d.Event.COMPLETE, function (d) {
  7389. f = h.data;
  7390. b.call(c, f, a)
  7391. }, this);
  7392. h.load(new d.URLRequest(a))
  7393. } else
  7394. b.call(c, f, a)
  7395. };
  7396. return c
  7397. }
  7398. ();
  7399. e.DefaultAssetAdapter = f;
  7400. f.prototype.__class__ = "egret.gui.DefaultAssetAdapter"
  7401. })(d.gui ||
  7402. (d.gui = {}))
  7403. })(egret || (egret = {}));
  7404. __extends = this.__extends || function (d, e) {
  7405. function f() {
  7406. this.constructor = d
  7407. }
  7408. for (var c in e)
  7409. e.hasOwnProperty(c) && (d[c] = e[c]);
  7410. f.prototype = e.prototype;
  7411. d.prototype = new f
  7412. };
  7413. (function (d) {
  7414. (function (e) {
  7415. var f = function (c) {
  7416. function a() {
  7417. c.call(this)
  7418. }
  7419. __extends(a, c);
  7420. Object.defineProperty(a.prototype, "target", {
  7421. get : function () {
  7422. return this._target
  7423. },
  7424. set : function (b) {
  7425. this._target = b
  7426. },
  7427. enumerable : !0,
  7428. configurable : !0
  7429. });
  7430. a.prototype.measure = function () {
  7431. if (null != this.target) {
  7432. for (var b = 0, a = 0, c = this._target.skin, d = this.target.numChildren, e = 0; e < d; e++) {
  7433. var f = this.target.getChildAt(e);
  7434. if (f && f != c && f.includeInLayout) {
  7435. var l = f.horizontalCenter,
  7436. k = f.verticalCenter,
  7437. n = f.left,
  7438. q = f.right,
  7439. p = f.top,
  7440. r = f.bottom;
  7441. isNaN(n) || isNaN(q) ? isNaN(l) ? isNaN(n) && isNaN(q) ? l = f.preferredX : (l = isNaN(n) ? 0 : n, l += isNaN(q) ? 0 : q) : l = 2 * Math.abs(l) : l = n + q;
  7442. isNaN(p) || isNaN(r) ? isNaN(k) ? isNaN(p) && isNaN(r) ? k = f.preferredY : (k = isNaN(p) ? 0 : p, k += isNaN(r) ? 0 : r) : k = 2 * Math.abs(k) : k = p + r;
  7443. r = f.preferredHeight;
  7444. b = Math.ceil(Math.max(b, l + f.preferredWidth));
  7445. a = Math.ceil(Math.max(a, k + r))
  7446. }
  7447. }
  7448. this.target.measuredWidth = Math.max(b, this.target.measuredWidth);
  7449. this.target.measuredHeight = Math.max(a, this.target.measuredHeight)
  7450. }
  7451. };
  7452. a.prototype.updateDisplayList = function (b,
  7453. a) {
  7454. if (null != this.target)
  7455. for (var c = this.target.numChildren, d = this._target.skin, e = 0; e < c; e++) {
  7456. var f = this.target.getChildAt(e);
  7457. if (null != f && f != d && f.includeInLayout) {
  7458. var l = f.horizontalCenter,
  7459. k = f.verticalCenter,
  7460. n = f.left,
  7461. q = f.right,
  7462. p = f.top,
  7463. r = f.bottom,
  7464. x = f.percentWidth,
  7465. z = f.percentHeight,
  7466. v = NaN,
  7467. A = NaN;
  7468. isNaN(n) || isNaN(q) ? isNaN(x) || (v = Math.round(b * Math.min(0.01 * x, 1))) : v = b - q - n;
  7469. isNaN(p) || isNaN(r) ? isNaN(z) || (A = Math.round(a * Math.min(0.01 * z, 1))) : A = a - r - p;
  7470. f.setLayoutBoundsSize(v, A);
  7471. x = f.layoutBoundsWidth;
  7472. z = f.layoutBoundsHeight;
  7473. A = v = NaN;
  7474. v = isNaN(l) ? isNaN(n) ? isNaN(q) ? f.layoutBoundsX : b - x - q : n : Math.round((b - x) / 2 + l);
  7475. A = isNaN(k) ? isNaN(p) ? isNaN(r) ? f.layoutBoundsY : a - z - r : p : Math.round((a - z) / 2 + k);
  7476. f.setLayoutBoundsPosition(v, A)
  7477. }
  7478. }
  7479. };
  7480. return a
  7481. }
  7482. (d.HashObject);
  7483. e.SkinBasicLayout = f;
  7484. f.prototype.__class__ = "egret.gui.SkinBasicLayout"
  7485. })(d.gui || (d.gui = {}))
  7486. })(egret || (egret = {}));
  7487. __extends = this.__extends || function (d, e) {
  7488. function f() {
  7489. this.constructor = d
  7490. }
  7491. for (var c in e)
  7492. e.hasOwnProperty(c) && (d[c] = e[c]);
  7493. f.prototype = e.prototype;
  7494. d.prototype = new f
  7495. };
  7496. (function (d) {
  7497. (function (e) {
  7498. var f = function (c) {
  7499. function a() {
  7500. c.call(this);
  7501. this._autoRepeat = this._downEventFired = !1;
  7502. this._repeatInterval = this._repeatDelay = 35;
  7503. this._keepDown = this._hovered = !1;
  7504. this._label = "";
  7505. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  7506. this.addHandlers()
  7507. }
  7508. __extends(a, c);
  7509. Object.defineProperty(a.prototype, "autoRepeat", {
  7510. get : function () {
  7511. return this._autoRepeat
  7512. },
  7513. set : function (b) {
  7514. b != this._autoRepeat && (this._autoRepeat = b, this.checkAutoRepeatTimerConditions(this.isDown()))
  7515. },
  7516. enumerable : !0,
  7517. configurable : !0
  7518. });
  7519. Object.defineProperty(a.prototype, "repeatDelay", {
  7520. get : function () {
  7521. return this._repeatDelay
  7522. },
  7523. set : function (b) {
  7524. this._repeatDelay = b
  7525. },
  7526. enumerable : !0,
  7527. configurable : !0
  7528. });
  7529. Object.defineProperty(a.prototype, "repeatInterval", {
  7530. get : function () {
  7531. return this._repeatInterval
  7532. },
  7533. set : function (b) {
  7534. this._repeatInterval = b
  7535. },
  7536. enumerable : !0,
  7537. configurable : !0
  7538. });
  7539. Object.defineProperty(a.prototype, "hovered", {
  7540. get : function () {
  7541. return this._hovered
  7542. },
  7543. set : function (b) {
  7544. b != this._hovered && (this._hovered = b, this.invalidateSkinState(),
  7545. this.checkButtonDownConditions())
  7546. },
  7547. enumerable : !0,
  7548. configurable : !0
  7549. });
  7550. a.prototype._setKeepDown = function (b) {
  7551. this._keepDown != b && (this._keepDown = b, this.invalidateSkinState())
  7552. };
  7553. Object.defineProperty(a.prototype, "label", {
  7554. get : function () {
  7555. return this._getLabel()
  7556. },
  7557. set : function (b) {
  7558. this._setLabel(b)
  7559. },
  7560. enumerable : !0,
  7561. configurable : !0
  7562. });
  7563. a.prototype._getLabel = function () {
  7564. return this.labelDisplay ? this.labelDisplay.text : this._label
  7565. };
  7566. a.prototype._setLabel = function (b) {
  7567. this._label = b;
  7568. this.labelDisplay && (this.labelDisplay.text =
  7569. b)
  7570. };
  7571. Object.defineProperty(a.prototype, "mouseCaptured", {
  7572. get : function () {
  7573. return this._mouseCaptured
  7574. },
  7575. set : function (b) {
  7576. b != this._mouseCaptured && (this._mouseCaptured = b, this.invalidateSkinState(), b || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  7577. },
  7578. enumerable : !0,
  7579. configurable : !0
  7580. });
  7581. Object.defineProperty(a.prototype, "stickyHighlighting", {
  7582. get : function () {
  7583. return this._stickyHighlighting
  7584. },
  7585. set : function (b) {
  7586. b != this._stickyHighlighting && (this._stickyHighlighting = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7587. },
  7588. enumerable : !0,
  7589. configurable : !0
  7590. });
  7591. a.prototype.checkButtonDownConditions = function () {
  7592. var b = this.isDown();
  7593. this._downEventFired != b && (b && e.UIEvent.dispatchUIEvent(this, e.UIEvent.BUTTON_DOWN), this._downEventFired = b, this.checkAutoRepeatTimerConditions(b))
  7594. };
  7595. a.prototype.addHandlers = function () {
  7596. this.addEventListener(d.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  7597. this.addEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  7598. this.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler,
  7599. this);
  7600. this.addEventListener(d.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  7601. this.addEventListener(d.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  7602. };
  7603. a.prototype.addStageMouseHandlers = function () {
  7604. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7605. e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7606. };
  7607. a.prototype.removeStageMouseHandlers = function () {
  7608. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler,
  7609. this);
  7610. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7611. };
  7612. a.prototype.isDown = function () {
  7613. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  7614. };
  7615. a.prototype.checkAutoRepeatTimerConditions = function (b) {
  7616. b = this.autoRepeat && b;
  7617. b != (null != this.autoRepeatTimer) && (b ? this.startTimer() : this.stopTimer())
  7618. };
  7619. a.prototype.startTimer = function () {
  7620. this.autoRepeatTimer = new d.Timer(1);
  7621. this.autoRepeatTimer.delay = this._repeatDelay;
  7622. this.autoRepeatTimer.addEventListener(d.TimerEvent.TIMER,
  7623. this.autoRepeat_timerDelayHandler, this);
  7624. this.autoRepeatTimer.start()
  7625. };
  7626. a.prototype.stopTimer = function () {
  7627. this.autoRepeatTimer.stop();
  7628. this.autoRepeatTimer = null
  7629. };
  7630. a.prototype.mouseEventHandler = function (b) {
  7631. switch (b.type) {
  7632. case d.TouchEvent.TOUCH_ROLL_OVER:
  7633. if (b.touchDown && !this.mouseCaptured)
  7634. break;
  7635. this.hovered = !0;
  7636. break;
  7637. case d.TouchEvent.TOUCH_ROLL_OUT:
  7638. this.hovered = !1;
  7639. break;
  7640. case d.TouchEvent.TOUCH_BEGIN:
  7641. this.addStageMouseHandlers();
  7642. d.InteractionMode.mode == d.InteractionMode.TOUCH && (this.hovered = !0);
  7643. this.mouseCaptured =
  7644. !0;
  7645. break;
  7646. case d.TouchEvent.TOUCH_END:
  7647. b.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  7648. break;
  7649. case d.TouchEvent.TOUCH_TAP:
  7650. this.enabled ? this.clickHandler(b) : b.stopImmediatePropagation()
  7651. }
  7652. };
  7653. a.prototype.buttonReleased = function () {};
  7654. a.prototype.clickHandler = function (b) {};
  7655. a.prototype.stage_mouseUpHandler = function (b) {
  7656. b.target != this && (this.mouseCaptured = !1)
  7657. };
  7658. a.prototype.autoRepeat_timerDelayHandler = function (b) {
  7659. this.autoRepeatTimer.reset();
  7660. this.autoRepeatTimer.removeEventListener(d.TimerEvent.TIMER,
  7661. this.autoRepeat_timerDelayHandler, this);
  7662. this.autoRepeatTimer.delay = this._repeatInterval;
  7663. this.autoRepeatTimer.addEventListener(d.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  7664. this.autoRepeatTimer.start()
  7665. };
  7666. a.prototype.autoRepeat_timerHandler = function (b) {
  7667. e.UIEvent.dispatchUIEvent(this, e.UIEvent.BUTTON_DOWN)
  7668. };
  7669. a.prototype.getCurrentSkinState = function () {
  7670. return this.enabled ? this.isDown() || this._keepDown ? "down" : d.InteractionMode.mode == d.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over" :
  7671. "up" : c.prototype.getCurrentSkinState.call(this)
  7672. };
  7673. a.prototype.partAdded = function (b, a) {
  7674. c.prototype.partAdded.call(this, b, a);
  7675. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  7676. };
  7677. return a
  7678. }
  7679. (e.SkinnableComponent);
  7680. e.ButtonBase = f;
  7681. f.prototype.__class__ = "egret.gui.ButtonBase"
  7682. })(d.gui || (d.gui = {}))
  7683. })(egret || (egret = {}));
  7684. __extends = this.__extends || function (d, e) {
  7685. function f() {
  7686. this.constructor = d
  7687. }
  7688. for (var c in e)
  7689. e.hasOwnProperty(c) && (d[c] = e[c]);
  7690. f.prototype = e.prototype;
  7691. d.prototype = new f
  7692. };
  7693. (function (d) {
  7694. (function (e) {
  7695. var f = function (c) {
  7696. function a() {
  7697. c.call(this);
  7698. this._autoSelected = !0
  7699. }
  7700. __extends(a, c);
  7701. Object.defineProperty(a.prototype, "selected", {
  7702. get : function () {
  7703. return this._selected
  7704. },
  7705. set : function (b) {
  7706. this._setSelected(b)
  7707. },
  7708. enumerable : !0,
  7709. configurable : !0
  7710. });
  7711. a.prototype._setSelected = function (b) {
  7712. b != this._selected && (this._selected = b, e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  7713. };
  7714. a.prototype.getCurrentSkinState = function () {
  7715. return this.selected ? c.prototype.getCurrentSkinState.call(this) +
  7716. "AndSelected" : c.prototype.getCurrentSkinState.call(this)
  7717. };
  7718. a.prototype.buttonReleased = function () {
  7719. c.prototype.buttonReleased.call(this);
  7720. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(d.Event.CHANGE))
  7721. };
  7722. return a
  7723. }
  7724. (e.ButtonBase);
  7725. e.ToggleButtonBase = f;
  7726. f.prototype.__class__ = "egret.gui.ToggleButtonBase"
  7727. })(d.gui || (d.gui = {}))
  7728. })(egret || (egret = {}));
  7729. __extends = this.__extends || function (d, e) {
  7730. function f() {
  7731. this.constructor = d
  7732. }
  7733. for (var c in e)
  7734. e.hasOwnProperty(c) && (d[c] = e[c]);
  7735. f.prototype = e.prototype;
  7736. d.prototype = new f
  7737. };
  7738. (function (d) {
  7739. (function (e) {
  7740. var f = function (c) {
  7741. function a() {
  7742. c.call(this);
  7743. this._fontFamily = "SimSun";
  7744. this._size = 30;
  7745. this._textAlign = d.HorizontalAlign.LEFT;
  7746. this._verticalAlign = d.VerticalAlign.TOP;
  7747. this._lineSpacing = 0;
  7748. this._textColor = 16777215;
  7749. this._text = ""
  7750. }
  7751. __extends(a, c);
  7752. Object.defineProperty(a.prototype, "fontFamily", {
  7753. get : function () {
  7754. return this._fontFamily
  7755. },
  7756. set : function (b) {
  7757. this._fontFamily != b && (this._fontFamily = b, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7758. },
  7759. enumerable : !0,
  7760. configurable : !0
  7761. });
  7762. Object.defineProperty(a.prototype, "size", {
  7763. get : function () {
  7764. return this._size
  7765. },
  7766. set : function (b) {
  7767. this._size != b && (this._size = b, this.sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7768. },
  7769. enumerable : !0,
  7770. configurable : !0
  7771. });
  7772. Object.defineProperty(a.prototype, "bold", {
  7773. get : function () {
  7774. return this._bold
  7775. },
  7776. set : function (b) {
  7777. this._bold != b && (this._bold = b, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7778. },
  7779. enumerable : !0,
  7780. configurable : !0
  7781. });
  7782. Object.defineProperty(a.prototype, "italic", {
  7783. get : function () {
  7784. return this._italic
  7785. },
  7786. set : function (b) {
  7787. this._italic != b && (this._italic = b, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7788. },
  7789. enumerable : !0,
  7790. configurable : !0
  7791. });
  7792. Object.defineProperty(a.prototype, "textAlign", {
  7793. get : function () {
  7794. return this._textAlign
  7795. },
  7796. set : function (b) {
  7797. this._textAlign != b && (this._textAlign = b, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(),
  7798. this.invalidateDisplayList())
  7799. },
  7800. enumerable : !0,
  7801. configurable : !0
  7802. });
  7803. Object.defineProperty(a.prototype, "verticalAlign", {
  7804. get : function () {
  7805. return this._verticalAlign
  7806. },
  7807. set : function (b) {
  7808. this._verticalAlign != b && (this._verticalAlign = b, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7809. },
  7810. enumerable : !0,
  7811. configurable : !0
  7812. });
  7813. Object.defineProperty(a.prototype, "lineSpacing", {
  7814. get : function () {
  7815. return this._lineSpacing
  7816. },
  7817. set : function (b) {
  7818. this._lineSpacing != b && (this._lineSpacing =
  7819. b, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7820. },
  7821. enumerable : !0,
  7822. configurable : !0
  7823. });
  7824. Object.defineProperty(a.prototype, "textColor", {
  7825. get : function () {
  7826. return this._textColor
  7827. },
  7828. set : function (b) {
  7829. this._textColor != b && (this._textColor = b, this.textColorChanged = !0, this.invalidateProperties())
  7830. },
  7831. enumerable : !0,
  7832. configurable : !0
  7833. });
  7834. Object.defineProperty(a.prototype, "text", {
  7835. get : function () {
  7836. return this._text
  7837. },
  7838. set : function (b) {
  7839. b != this._text && (this._text = b, this._textChanged =
  7840. !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7841. },
  7842. enumerable : !0,
  7843. configurable : !0
  7844. });
  7845. a.prototype.createChildren = function () {
  7846. c.prototype.createChildren.call(this);
  7847. this._textField || this.checkTextField()
  7848. };
  7849. a.prototype.commitProperties = function () {
  7850. c.prototype.commitProperties.call(this);
  7851. this._textField || this.checkTextField();
  7852. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7853. this.sizeChanged && (this._textField.size = this._size, this.sizeChanged =
  7854. !1);
  7855. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7856. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7857. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7858. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7859. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7860. this.textColorChanged && (this._textField.textColor = this._textColor,
  7861. this.textColorChanged = !1);
  7862. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7863. };
  7864. a.prototype.checkTextField = function () {
  7865. this._textField || (this.createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7866. };
  7867. a.prototype.createTextField = function () {
  7868. this._textField = new d.TextField;
  7869. this._textField.fontFamily = this._fontFamily;
  7870. this._textField.size = this._size;
  7871. this._textField.textAlign = this._textAlign;
  7872. this._textField.verticalAlign = this._verticalAlign;
  7873. this._textField.lineSpacing = this._lineSpacing;
  7874. this._textField.textColor = this._textColor;
  7875. this._addToDisplayList(this._textField)
  7876. };
  7877. a.prototype.measure = function () {
  7878. c.prototype.measure.call(this);
  7879. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7880. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7881. };
  7882. a.prototype.$updateDisplayList = function (b, a) {
  7883. c.prototype.updateDisplayList.call(this, b, a)
  7884. };
  7885. a.prototype.updateDisplayList = function (b, a) {
  7886. c.prototype.updateDisplayList.call(this, b, a);
  7887. this._textField.width = b;
  7888. this._textField.height =
  7889. a
  7890. };
  7891. a.DEFAULT_MEASURED_WIDTH = 160;
  7892. a.DEFAULT_MEASURED_HEIGHT = 22;
  7893. return a
  7894. }
  7895. (e.UIComponent);
  7896. e.TextBase = f;
  7897. f.prototype.__class__ = "egret.gui.TextBase"
  7898. })(d.gui || (d.gui = {}))
  7899. })(egret || (egret = {}));
  7900. __extends = this.__extends || function (d, e) {
  7901. function f() {
  7902. this.constructor = d
  7903. }
  7904. for (var c in e)
  7905. e.hasOwnProperty(c) && (d[c] = e[c]);
  7906. f.prototype = e.prototype;
  7907. d.prototype = new f
  7908. };
  7909. (function (d) {
  7910. (function (e) {
  7911. var f = function (c) {
  7912. function a() {
  7913. c.call(this);
  7914. this._contentHeight = this._contentWidth = 0;
  7915. this._clipAndEnableScrolling = !1;
  7916. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7917. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7918. }
  7919. __extends(a, c);
  7920. a.prototype.createChildren = function () {
  7921. c.prototype.createChildren.call(this);
  7922. this._layout || (this.layout = new e.BasicLayout)
  7923. };
  7924. Object.defineProperty(a.prototype, "contentWidth", {
  7925. get : function () {
  7926. return this._contentWidth
  7927. },
  7928. enumerable : !0,
  7929. configurable : !0
  7930. });
  7931. a.prototype.setContentWidth = function (b) {
  7932. if (b != this._contentWidth) {
  7933. var a = this._contentWidth;
  7934. this._contentWidth = b;
  7935. this.hasEventListener("propertyChange") && e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "contentWidth", a, b, this)
  7936. }
  7937. };
  7938. Object.defineProperty(a.prototype, "contentHeight", {
  7939. get : function () {
  7940. return this._contentHeight
  7941. },
  7942. enumerable : !0,
  7943. configurable : !0
  7944. });
  7945. a.prototype.setContentHeight = function (b) {
  7946. if (b != this._contentHeight) {
  7947. var a = this._contentHeight;
  7948. this._contentHeight = b;
  7949. this.hasEventListener("propertyChange") && e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "contentHeight", a, b, this)
  7950. }
  7951. };
  7952. a.prototype.setContentSize = function (b, a) {
  7953. if (b != this._contentWidth || a != this._contentHeight)
  7954. this.setContentWidth(b), this.setContentHeight(a)
  7955. };
  7956. Object.defineProperty(a.prototype, "layout", {
  7957. get : function () {
  7958. return this._layout
  7959. },
  7960. set : function (b) {
  7961. this._setLayout(b)
  7962. },
  7963. enumerable : !0,
  7964. configurable : !0
  7965. });
  7966. a.prototype._setLayout = function (b) {
  7967. if (this._layout !=
  7968. b) {
  7969. this._layout && (this._layout.target = null);
  7970. if (this._layout = b)
  7971. this._layout.target = this;
  7972. this.invalidateSize();
  7973. this.invalidateDisplayList();
  7974. this.dispatchEventWith("layoutChanged")
  7975. }
  7976. };
  7977. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7978. get : function () {
  7979. return this._clipAndEnableScrolling
  7980. },
  7981. set : function (b) {
  7982. b != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = b) ? new d.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7983. },
  7984. enumerable : !0,
  7985. configurable : !0
  7986. });
  7987. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7988. get : function () {
  7989. return this._horizontalScrollPosition
  7990. },
  7991. set : function (b) {
  7992. if (b != this._horizontalScrollPosition) {
  7993. var a = this._horizontalScrollPosition;
  7994. this._horizontalScrollPosition = b;
  7995. this.scrollPositionChanged();
  7996. e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, b, this)
  7997. }
  7998. },
  7999. enumerable : !0,
  8000. configurable : !0
  8001. });
  8002. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  8003. get : function () {
  8004. return this._verticalScrollPosition
  8005. },
  8006. set : function (b) {
  8007. if (b != this._verticalScrollPosition) {
  8008. var a = this._verticalScrollPosition;
  8009. this._verticalScrollPosition = b;
  8010. this.scrollPositionChanged();
  8011. e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, b, this)
  8012. }
  8013. },
  8014. enumerable : !0,
  8015. configurable : !0
  8016. });
  8017. a.prototype.scrollPositionChanged = function () {
  8018. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(),
  8019. this._layout && this._layout.scrollPositionChanged())
  8020. };
  8021. a.prototype.updateScrollRect = function (b, a) {
  8022. var c = this._scrollRect;
  8023. this._clipAndEnableScrolling ? c ? (c.x = this._horizontalScrollPosition, c.y = this._verticalScrollPosition, c.width = b, c.height = a) : this._scrollRect = new d.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, b, a) : c && (this._scrollRect = null)
  8024. };
  8025. a.prototype.measure = function () {
  8026. this._layout && this._layoutInvalidateSizeFlag && (c.prototype.measure.call(this), this._layout.measure())
  8027. };
  8028. a.prototype._invalidateDisplayListExceptLayout = function () {
  8029. c.prototype.invalidateDisplayList.call(this)
  8030. };
  8031. a.prototype.invalidateDisplayList = function () {
  8032. c.prototype.invalidateDisplayList.call(this);
  8033. this._layoutInvalidateDisplayListFlag = !0
  8034. };
  8035. a.prototype._childXYChanged = function () {
  8036. this.invalidateSize();
  8037. this.invalidateDisplayList()
  8038. };
  8039. a.prototype._invalidateSizeExceptLayout = function () {
  8040. c.prototype.invalidateSize.call(this)
  8041. };
  8042. a.prototype.invalidateSize = function () {
  8043. c.prototype.invalidateSize.call(this);
  8044. this._layoutInvalidateSizeFlag =
  8045. !0
  8046. };
  8047. a.prototype.updateDisplayList = function (b, a) {
  8048. c.prototype.updateDisplayList.call(this, b, a);
  8049. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(b, a), this.updateScrollRect(b, a))
  8050. };
  8051. Object.defineProperty(a.prototype, "numElements", {
  8052. get : function () {
  8053. return -1
  8054. },
  8055. enumerable : !0,
  8056. configurable : !0
  8057. });
  8058. a.prototype.getElementAt = function (b) {
  8059. return null
  8060. };
  8061. a.prototype.getElementIndex = function (b) {
  8062. return -1
  8063. };
  8064. a.prototype.getElementIndicesInView = function () {
  8065. var b =
  8066. [],
  8067. a;
  8068. if (this.scrollRect)
  8069. for (a = 0; a < this.numChildren; a++) {
  8070. var c = this.getChildAt(a);
  8071. if (c) {
  8072. var e = new d.Rectangle;
  8073. e.x = c.layoutBoundsX;
  8074. e.y = c.layoutBoundsY;
  8075. e.width = c.layoutBoundsWidth;
  8076. e.height = c.layoutBoundsHeight;
  8077. this.scrollRect.intersects(e) && b.push(a)
  8078. }
  8079. }
  8080. else
  8081. for (a = 0; a < this.numChildren; a++)
  8082. b.push(a);
  8083. return b
  8084. };
  8085. a.prototype.setVirtualElementIndicesInView = function (b, a) {};
  8086. a.prototype.getVirtualElementAt = function (b) {
  8087. return this.getElementAt(b)
  8088. };
  8089. return a
  8090. }
  8091. (e.UIComponent);
  8092. e.GroupBase = f;
  8093. f.prototype.__class__ = "egret.gui.GroupBase"
  8094. })(d.gui ||
  8095. (d.gui = {}))
  8096. })(egret || (egret = {}));
  8097. __extends = this.__extends || function (d, e) {
  8098. function f() {
  8099. this.constructor = d
  8100. }
  8101. for (var c in e)
  8102. e.hasOwnProperty(c) && (d[c] = e[c]);
  8103. f.prototype = e.prototype;
  8104. d.prototype = new f
  8105. };
  8106. (function (d) {
  8107. (function (d) {
  8108. var f = function (c) {
  8109. function a() {
  8110. c.call(this);
  8111. this._selected = this.dataChangedFlag = !1;
  8112. this._itemIndex = -1;
  8113. this.touchChildren = !0
  8114. }
  8115. __extends(a, c);
  8116. Object.defineProperty(a.prototype, "data", {
  8117. get : function () {
  8118. return this._data
  8119. },
  8120. set : function (b) {
  8121. this._data = b;
  8122. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  8123. },
  8124. enumerable : !0,
  8125. configurable : !0
  8126. });
  8127. a.prototype.dataChanged = function () {};
  8128. Object.defineProperty(a.prototype,
  8129. "selected", {
  8130. get : function () {
  8131. return this._selected
  8132. },
  8133. set : function (b) {
  8134. this._selected != b && (this._selected = b, this.invalidateSkinState())
  8135. },
  8136. enumerable : !0,
  8137. configurable : !0
  8138. });
  8139. Object.defineProperty(a.prototype, "itemIndex", {
  8140. get : function () {
  8141. return this._itemIndex
  8142. },
  8143. set : function (b) {
  8144. this._itemIndex = b
  8145. },
  8146. enumerable : !0,
  8147. configurable : !0
  8148. });
  8149. a.prototype.commitProperties = function () {
  8150. c.prototype.commitProperties.call(this);
  8151. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  8152. };
  8153. a.prototype.getCurrentSkinState = function () {
  8154. return this._selected ?
  8155. "down" : c.prototype.getCurrentSkinState.call(this)
  8156. };
  8157. return a
  8158. }
  8159. (d.ButtonBase);
  8160. d.ItemRenderer = f;
  8161. f.prototype.__class__ = "egret.gui.ItemRenderer"
  8162. })(d.gui || (d.gui = {}))
  8163. })(egret || (egret = {}));
  8164. __extends = this.__extends || function (d, e) {
  8165. function f() {
  8166. this.constructor = d
  8167. }
  8168. for (var c in e)
  8169. e.hasOwnProperty(c) && (d[c] = e[c]);
  8170. f.prototype = e.prototype;
  8171. d.prototype = new f
  8172. };
  8173. (function (d) {
  8174. (function (e) {
  8175. var f = function (c) {
  8176. function a() {
  8177. c.call(this);
  8178. this._indentation = 17;
  8179. this._depth = 0;
  8180. this._isOpen = this._hasChildren = !1;
  8181. this.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.onItemMouseDown, this, !1, 1E3)
  8182. }
  8183. __extends(a, c);
  8184. a.prototype.onItemMouseDown = function (b) {
  8185. b.target == this.disclosureButton && b.stopImmediatePropagation()
  8186. };
  8187. Object.defineProperty(a.prototype, "indentation", {
  8188. get : function () {
  8189. return this._indentation
  8190. },
  8191. set : function (b) {
  8192. this._indentation = b
  8193. },
  8194. enumerable : !0,
  8195. configurable : !0
  8196. });
  8197. Object.defineProperty(a.prototype,
  8198. "iconSkinName", {
  8199. get : function () {
  8200. return this._iconSkinName
  8201. },
  8202. set : function (b) {
  8203. this._iconSkinName != b && (this._iconSkinName = b, this.iconDisplay && (this.iconDisplay.source = this._iconSkinName))
  8204. },
  8205. enumerable : !0,
  8206. configurable : !0
  8207. });
  8208. Object.defineProperty(a.prototype, "depth", {
  8209. get : function () {
  8210. return this._depth
  8211. },
  8212. set : function (b) {
  8213. b != this._depth && (this._depth = b, this.contentGroup && (this.contentGroup.x = this._depth * this._indentation))
  8214. },
  8215. enumerable : !0,
  8216. configurable : !0
  8217. });
  8218. Object.defineProperty(a.prototype, "hasChildren", {
  8219. get : function () {
  8220. return this._hasChildren
  8221. },
  8222. set : function (b) {
  8223. this._hasChildren != b && (this._hasChildren = b, this.disclosureButton && (this.disclosureButton.visible = this._hasChildren))
  8224. },
  8225. enumerable : !0,
  8226. configurable : !0
  8227. });
  8228. Object.defineProperty(a.prototype, "opened", {
  8229. get : function () {
  8230. return this._isOpen
  8231. },
  8232. set : function (b) {
  8233. this._isOpen != b && (this._isOpen = b, this.disclosureButton && (this.disclosureButton.selected = this._isOpen))
  8234. },
  8235. enumerable : !0,
  8236. configurable : !0
  8237. });
  8238. a.prototype.partAdded = function (b, a) {
  8239. c.prototype.partAdded.call(this, b, a);
  8240. a == this.iconDisplay ? this.iconDisplay.source =
  8241. this._iconSkinName : a == this.disclosureButton ? (this.disclosureButton.visible = this._hasChildren, this.disclosureButton.selected = this._isOpen, this.disclosureButton._autoSelected = !1, this.disclosureButton.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this)) : a == this.contentGroup && (this.contentGroup.x = this._depth * this._indentation)
  8242. };
  8243. a.prototype.partRemoved = function (b, a) {
  8244. c.prototype.partRemoved.call(this, b, a);
  8245. a == this.iconDisplay ? this.iconDisplay.source = null : a == this.disclosureButton &&
  8246. (this.disclosureButton.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this), this.disclosureButton._autoSelected = !0, this.disclosureButton.visible = !0)
  8247. };
  8248. a.prototype.disclosureButton_mouseDownHandler = function (b) {
  8249. e.TreeEvent.dispatchTreeEvent(this, e.TreeEvent.ITEM_OPENING, this.itemIndex, this.data, this, !this._isOpen)
  8250. };
  8251. return a
  8252. }
  8253. (e.ItemRenderer);
  8254. e.TreeItemRenderer = f;
  8255. f.prototype.__class__ = "egret.gui.TreeItemRenderer"
  8256. })(d.gui || (d.gui = {}))
  8257. })(egret || (egret = {}));
  8258. (function (d) {
  8259. (function (e) {
  8260. var f = function () {
  8261. function c(a, b) {
  8262. this.easerFunction = d.Ease.sineInOut;
  8263. this._duration = 500;
  8264. this._startDelay = 0;
  8265. this._repeatCount = 1;
  8266. this._repeatDelay = 0;
  8267. this.motionPaths = [];
  8268. this._currentValue = {};
  8269. this.pauseTime = 0;
  8270. this._isPaused = !1;
  8271. this.startTime = 0;
  8272. this._started = !1;
  8273. this.playedTimes = 0;
  8274. this.updateFunction = a;
  8275. this.thisObject = b
  8276. }
  8277. Object.defineProperty(c.prototype, "isPlaying", {
  8278. get : function () {
  8279. return this._isPlaying
  8280. },
  8281. enumerable : !0,
  8282. configurable : !0
  8283. });
  8284. Object.defineProperty(c.prototype, "duration", {
  8285. get : function () {
  8286. return this._duration
  8287. },
  8288. set : function (a) {
  8289. this._duration = a
  8290. },
  8291. enumerable : !0,
  8292. configurable : !0
  8293. });
  8294. Object.defineProperty(c.prototype, "startDelay", {
  8295. get : function () {
  8296. return this._startDelay
  8297. },
  8298. set : function (a) {
  8299. this._startDelay = a
  8300. },
  8301. enumerable : !0,
  8302. configurable : !0
  8303. });
  8304. Object.defineProperty(c.prototype, "repeatCount", {
  8305. get : function () {
  8306. return this._repeatCount
  8307. },
  8308. set : function (a) {
  8309. this._repeatCount = a
  8310. },
  8311. enumerable : !0,
  8312. configurable : !0
  8313. });
  8314. Object.defineProperty(c.prototype, "repeatDelay", {
  8315. get : function () {
  8316. return this._repeatDelay
  8317. },
  8318. set : function (a) {
  8319. this._repeatDelay = a
  8320. },
  8321. enumerable : !0,
  8322. configurable : !0
  8323. });
  8324. Object.defineProperty(c.prototype, "currentValue", {
  8325. get : function () {
  8326. return this._currentValue
  8327. },
  8328. enumerable : !0,
  8329. configurable : !0
  8330. });
  8331. c.prototype.play = function () {
  8332. this.stopAnimation();
  8333. this.start()
  8334. };
  8335. c.prototype.seek = function (a) {
  8336. a = Math.min(a, this.duration);
  8337. this.caculateCurrentValue(a / this.duration);
  8338. this.startTime = d.getTimer() - a - this._startDelay;
  8339. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  8340. };
  8341. c.prototype.start = function () {
  8342. this.playedTimes =
  8343. 0;
  8344. this._started = !0;
  8345. this._isPlaying = !1;
  8346. this._currentValue = {};
  8347. this.caculateCurrentValue(0);
  8348. this.startTime = d.getTimer();
  8349. c.currentTime = this.startTime;
  8350. this.doInterval();
  8351. c.addAnimation(this)
  8352. };
  8353. c.prototype.end = function () {
  8354. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  8355. this.caculateCurrentValue(1);
  8356. null != this.updateFunction && this.updateFunction.call(this.thisObject,
  8357. this);
  8358. this.stopAnimation();
  8359. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  8360. };
  8361. c.prototype.stop = function () {
  8362. this.stopAnimation();
  8363. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  8364. };
  8365. c.prototype.stopAnimation = function () {
  8366. this.playedTimes = 0;
  8367. this._isPlaying = !1;
  8368. this.startTime = 0;
  8369. this._started = !1;
  8370. c.removeAnimation(this)
  8371. };
  8372. Object.defineProperty(c.prototype, "isPaused", {
  8373. get : function () {
  8374. return this._isPaused
  8375. },
  8376. enumerable : !0,
  8377. configurable : !0
  8378. });
  8379. c.prototype.pause = function () {
  8380. this._started &&
  8381. (this._isPaused = !0, this.pauseTime = d.getTimer(), this._isPlaying = !1, c.removeAnimation(this))
  8382. };
  8383. c.prototype.resume = function () {
  8384. this._started && this._isPaused && (this._isPaused = !1, this.startTime += d.getTimer() - this.pauseTime, this.pauseTime = -1, c.addAnimation(this))
  8385. };
  8386. Object.defineProperty(c.prototype, "started", {
  8387. get : function () {
  8388. return this._started
  8389. },
  8390. enumerable : !0,
  8391. configurable : !0
  8392. });
  8393. c.prototype.doInterval = function () {
  8394. var a = c.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay : this._startDelay);
  8395. if (0 >
  8396. a)
  8397. return !1;
  8398. this._isPlaying || (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  8399. var b = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  8400. this.caculateCurrentValue(b);
  8401. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  8402. if (a = a >= this._duration)
  8403. this.playedTimes++, this._isPlaying = !1, this.startTime = c.currentTime, 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (c.removeAnimation(this), this._started =
  8404. !1, this.playedTimes = 0);
  8405. a && null != this.endFunction && this.endFunction.call(this.thisObject, this);
  8406. return a
  8407. };
  8408. c.prototype.caculateCurrentValue = function (a) {
  8409. this.easerFunction && (a = this.easerFunction(a));
  8410. for (var b = this.motionPaths, c = b.length, d = 0; d < c; d++) {
  8411. var e = b[d];
  8412. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  8413. }
  8414. };
  8415. c.addAnimation = function (a) {
  8416. -1 == c.activeAnimations.indexOf(a) && (c.activeAnimations.push(a), c.registered || (c.registered = !0, d.Ticker.getInstance().register(c.onEnterFrame, null)))
  8417. };
  8418. c.removeAnimation =
  8419. function (a) {
  8420. a = c.activeAnimations.indexOf(a);
  8421. -1 != a && (c.activeAnimations.splice(a, 1), a <= c.currentIntervalIndex && c.currentIntervalIndex--);
  8422. 0 == c.activeAnimations.length && c.registered && (c.registered = !1, d.Ticker.getInstance().unregister(c.onEnterFrame, null))
  8423. };
  8424. c.onEnterFrame = function (a, b) {
  8425. c.currentTime = d.getTimer();
  8426. for (c.currentIntervalIndex = 0; c.currentIntervalIndex < c.activeAnimations.length; )
  8427. c.activeAnimations[c.currentIntervalIndex].doInterval(), c.currentIntervalIndex++;
  8428. c.currentIntervalIndex = -1;
  8429. 0 == c.activeAnimations.length &&
  8430. c.registered && (c.registered = !1, d.Ticker.getInstance().unregister(c.onEnterFrame, null))
  8431. };
  8432. c.currentTime = 0;
  8433. c.TIMER_RESOLUTION = 1E3 / 60;
  8434. c.activeAnimations = [];
  8435. c.currentIntervalIndex = -1;
  8436. return c
  8437. }
  8438. ();
  8439. e.Animation = f;
  8440. f.prototype.__class__ = "egret.gui.Animation"
  8441. })(d.gui || (d.gui = {}))
  8442. })(egret || (egret = {}));
  8443. __extends = this.__extends || function (d, e) {
  8444. function f() {
  8445. this.constructor = d
  8446. }
  8447. for (var c in e)
  8448. e.hasOwnProperty(c) && (d[c] = e[c]);
  8449. f.prototype = e.prototype;
  8450. d.prototype = new f
  8451. };
  8452. (function (d) {
  8453. (function (d) {
  8454. var f = function (c) {
  8455. function a() {
  8456. c.call(this);
  8457. this._maximum = 100;
  8458. this.maxChanged = !1;
  8459. this._minimum = 0;
  8460. this.minChanged = !1;
  8461. this._stepSize = 1;
  8462. this.stepSizeChanged = !1;
  8463. this._changedValue = this._value = 0;
  8464. this.valueChanged = !1;
  8465. this._snapInterval = 1;
  8466. this._explicitSnapInterval = this.snapIntervalChanged = !1
  8467. }
  8468. __extends(a, c);
  8469. Object.defineProperty(a.prototype, "maximum", {
  8470. get : function () {
  8471. return this._maximum
  8472. },
  8473. set : function (b) {
  8474. this._setMaximun(b)
  8475. },
  8476. enumerable : !0,
  8477. configurable : !0
  8478. });
  8479. a.prototype._setMaximun =
  8480. function (b) {
  8481. b != this._maximum && (this._maximum = b, this.maxChanged = !0, this.invalidateProperties())
  8482. };
  8483. Object.defineProperty(a.prototype, "minimum", {
  8484. get : function () {
  8485. return this._minimum
  8486. },
  8487. set : function (b) {
  8488. this._setMinimun(b)
  8489. },
  8490. enumerable : !0,
  8491. configurable : !0
  8492. });
  8493. a.prototype._setMinimun = function (b) {
  8494. b != this._minimum && (this._minimum = b, this.minChanged = !0, this.invalidateProperties())
  8495. };
  8496. Object.defineProperty(a.prototype, "stepSize", {
  8497. get : function () {
  8498. return this._stepSize
  8499. },
  8500. set : function (b) {
  8501. b != this._stepSize && (this._stepSize =
  8502. b, this.stepSizeChanged = !0, this.invalidateProperties())
  8503. },
  8504. enumerable : !0,
  8505. configurable : !0
  8506. });
  8507. Object.defineProperty(a.prototype, "value", {
  8508. get : function () {
  8509. return this._getValue()
  8510. },
  8511. set : function (b) {
  8512. this._setValue(b)
  8513. },
  8514. enumerable : !0,
  8515. configurable : !0
  8516. });
  8517. a.prototype._setValue = function (b) {
  8518. b != this.value && (this._changedValue = b, this.valueChanged = !0, this.invalidateProperties())
  8519. };
  8520. a.prototype._getValue = function () {
  8521. return this.valueChanged ? this._changedValue : this._value
  8522. };
  8523. Object.defineProperty(a.prototype, "snapInterval", {
  8524. get : function () {
  8525. return this._snapInterval
  8526. },
  8527. set : function (b) {
  8528. this._explicitSnapInterval = !0;
  8529. b != this._snapInterval && (isNaN(b) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = b, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  8530. },
  8531. enumerable : !0,
  8532. configurable : !0
  8533. });
  8534. a.prototype.commitProperties = function () {
  8535. c.prototype.commitProperties.call(this);
  8536. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum : this._minimum = this._maximum);
  8537. if (this.valueChanged || this.maxChanged || this.minChanged ||
  8538. this.snapIntervalChanged) {
  8539. var b = this.valueChanged ? this._changedValue : this._value;
  8540. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  8541. this.setValue(this.nearestValidValue(b, this.snapInterval))
  8542. }
  8543. this.stepSizeChanged && (this._explicitSnapInterval ? this._stepSize = this.nearestValidSize(this._stepSize) : (this._snapInterval = this._stepSize, this.setValue(this.nearestValidValue(this._value, this.snapInterval))), this.stepSizeChanged = !1)
  8544. };
  8545. a.prototype.nearestValidSize = function (b) {
  8546. var a = this.snapInterval;
  8547. if (0 == a)
  8548. return b;
  8549. b = Math.round(b / a) * a;
  8550. return Math.abs(b) < a ? a : b
  8551. };
  8552. a.prototype.nearestValidValue = function (b, a) {
  8553. if (0 == a)
  8554. return Math.max(this.minimum, Math.min(this.maximum, b));
  8555. var c = this.maximum - this.minimum,
  8556. d = 1;
  8557. b -= this.minimum;
  8558. a != Math.round(a) && (d = (1 + a).toString().split("."), d = Math.pow(10, d[1].length), c *= d, b = Math.round(b * d), a = Math.round(a * d));
  8559. var e = Math.max(0, Math.floor(b / a) * a),
  8560. c = Math.min(c, Math.floor((b + a) / a) * a);
  8561. return (b - e >= (c - e) / 2 ? c : e) / d + this.minimum
  8562. };
  8563. a.prototype.setValue = function (b) {
  8564. this._value != b &&
  8565. (isNaN(b) && (b = 0), !isNaN(this.maximum) && !isNaN(this.minimum) && this.maximum > this.minimum ? this._value = Math.min(this.maximum, Math.max(this.minimum, b)) : this._value = b, this.valueChanged = !1)
  8566. };
  8567. a.prototype.changeValueByStep = function (b) {
  8568. "undefined" === typeof b && (b = !0);
  8569. 0 != this.stepSize && this.setValue(this.nearestValidValue(b ? this.value + this.stepSize : this.value - this.stepSize, this.snapInterval))
  8570. };
  8571. return a
  8572. }
  8573. (d.SkinnableComponent);
  8574. d.Range = f;
  8575. f.prototype.__class__ = "egret.gui.Range"
  8576. })(d.gui || (d.gui = {}))
  8577. })(egret || (egret = {}));
  8578. __extends = this.__extends || function (d, e) {
  8579. function f() {
  8580. this.constructor = d
  8581. }
  8582. for (var c in e)
  8583. e.hasOwnProperty(c) && (d[c] = e[c]);
  8584. f.prototype = e.prototype;
  8585. d.prototype = new f
  8586. };
  8587. (function (d) {
  8588. (function (e) {
  8589. var f = function (c) {
  8590. function a() {
  8591. c.call(this);
  8592. this._slideDuration = 300;
  8593. this.needUpdateValue = !1;
  8594. this.addEventListener(d.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  8595. this.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  8596. }
  8597. __extends(a, c);
  8598. Object.defineProperty(a.prototype, "slideDuration", {
  8599. get : function () {
  8600. return this._slideDuration
  8601. },
  8602. set : function (b) {
  8603. this._slideDuration = b
  8604. },
  8605. enumerable : !0,
  8606. configurable : !0
  8607. });
  8608. Object.defineProperty(a.prototype, "maximum", {
  8609. get : function () {
  8610. return this._maximum
  8611. },
  8612. set : function (b) {
  8613. b != this._maximum && (this._setMaximun(b), this.invalidateDisplayList())
  8614. },
  8615. enumerable : !0,
  8616. configurable : !0
  8617. });
  8618. Object.defineProperty(a.prototype, "minimum", {
  8619. get : function () {
  8620. return this._minimum
  8621. },
  8622. set : function (b) {
  8623. b != this._minimum && (this._setMinimun(b), this.invalidateDisplayList())
  8624. },
  8625. enumerable : !0,
  8626. configurable : !0
  8627. });
  8628. Object.defineProperty(a.prototype, "value", {
  8629. get : function () {
  8630. return this._getValue()
  8631. },
  8632. set : function (b) {
  8633. b != this._getValue() && (this._setValue(b), this.invalidateDisplayList())
  8634. },
  8635. enumerable : !0,
  8636. configurable : !0
  8637. });
  8638. a.prototype.setValue = function (b) {
  8639. c.prototype.setValue.call(this, b);
  8640. this.invalidateDisplayList()
  8641. };
  8642. a.prototype.pointToValue = function (b, a) {
  8643. return this.minimum
  8644. };
  8645. a.prototype.changeValueByStep = function (b) {
  8646. "undefined" === typeof b && (b = !0);
  8647. var a = this.value;
  8648. c.prototype.changeValueByStep.call(this, b);
  8649. this.value != a && this.dispatchEventWith(d.Event.CHANGE)
  8650. };
  8651. a.prototype.partAdded = function (b, a) {
  8652. c.prototype.partAdded.call(this, b, a);
  8653. a == this.thumb ? (this.thumb.addEventListener(d.TouchEvent.TOUCH_BEGIN,
  8654. this.thumb_mouseDownHandler, this), this.thumb.addEventListener(e.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.addEventListener(e.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this), this.thumb.stickyHighlighting = !0) : a == this.track && (this.track.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.addEventListener(e.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8655. };
  8656. a.prototype.partRemoved = function (b, a) {
  8657. c.prototype.partRemoved.call(this, b, a);
  8658. a == this.thumb ? (this.thumb.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.removeEventListener(e.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.removeEventListener(e.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)) : a == this.track && (this.track.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.removeEventListener(e.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8659. };
  8660. a.prototype.updateDisplayList =
  8661. function (b, a) {
  8662. c.prototype.updateDisplayList.call(this, b, a);
  8663. this.updateSkinDisplayList()
  8664. };
  8665. a.prototype.updateSkinDisplayList = function () {};
  8666. a.prototype.addedToStageHandler = function (b) {
  8667. this.updateSkinDisplayList()
  8668. };
  8669. a.prototype.track_resizeHandler = function (b) {
  8670. this.updateSkinDisplayList()
  8671. };
  8672. a.prototype.thumb_resizeHandler = function (b) {
  8673. this.updateSkinDisplayList()
  8674. };
  8675. a.prototype.thumb_updateCompleteHandler = function (b) {
  8676. this.updateSkinDisplayList();
  8677. this.thumb.removeEventListener(e.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler,
  8678. this)
  8679. };
  8680. a.prototype.thumb_mouseDownHandler = function (b) {
  8681. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8682. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8683. e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8684. this.addEventListener(d.Event.ENTER_FRAME, this.onEnterFrame, this);
  8685. b = this.thumb.globalToLocal(b.stageX, b.stageY, d.Point.identity);
  8686. this._clickOffsetX = b.x;
  8687. this._clickOffsetY = b.y;
  8688. e.TrackBaseEvent.dispatchTrackBaseEvent(this,
  8689. e.TrackBaseEvent.THUMB_PRESS);
  8690. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_START)
  8691. };
  8692. a.prototype.onEnterFrame = function (b) {
  8693. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  8694. };
  8695. a.prototype.updateWhenMouseMove = function () {
  8696. if (this.track) {
  8697. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, d.Point.identity),
  8698. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8699. b = this.nearestValidValue(b, this.snapInterval);
  8700. b != this.value && (this.setValue(b), this.validateDisplayList(),
  8701. e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(d.Event.CHANGE))
  8702. }
  8703. };
  8704. a.prototype.stage_mouseMoveHandler = function (b) {
  8705. this._moveStageX = b.stageX;
  8706. this._moveStageY = b.stageY;
  8707. this.needUpdateValue || (this.needUpdateValue = !0)
  8708. };
  8709. a.prototype.stage_mouseUpHandler = function (b) {
  8710. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8711. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8712. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE,
  8713. this.stage_mouseUpHandler, this);
  8714. this.removeEventListener(d.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  8715. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  8716. e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_RELEASE);
  8717. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  8718. };
  8719. a.prototype.track_mouseDownHandler = function (b) {};
  8720. a.prototype.mouseDownHandler = function (b) {
  8721. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8722. e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8723. this.mouseDownTarget = b.target
  8724. };
  8725. a.prototype.stage_mouseUpSomewhereHandler = function (b) {
  8726. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8727. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8728. if (this.mouseDownTarget != b.target && b instanceof d.TouchEvent && this.contains(b.target)) {
  8729. var a = b.target.localToGlobal(b.localX,
  8730. b.localY);
  8731. d.TouchEvent.dispatchTouchEvent(this, d.TouchEvent.TOUCH_TAP, b.touchPointID, a.x, a.y, b.ctrlKey, b.altKey, b.shiftKey, b.touchDown)
  8732. }
  8733. this.mouseDownTarget = null
  8734. };
  8735. return a
  8736. }
  8737. (e.Range);
  8738. e.TrackBase = f;
  8739. f.prototype.__class__ = "egret.gui.TrackBase"
  8740. })(d.gui || (d.gui = {}))
  8741. })(egret || (egret = {}));
  8742. __extends = this.__extends || function (d, e) {
  8743. function f() {
  8744. this.constructor = d
  8745. }
  8746. for (var c in e)
  8747. e.hasOwnProperty(c) && (d[c] = e[c]);
  8748. f.prototype = e.prototype;
  8749. d.prototype = new f
  8750. };
  8751. (function (d) {
  8752. (function (e) {
  8753. var f = function (c) {
  8754. function a() {
  8755. c.call(this);
  8756. this._showTrackHighlight = !0;
  8757. this._pendingValue = 0;
  8758. this._liveDragging = !0;
  8759. this.maximum = 10
  8760. }
  8761. __extends(a, c);
  8762. Object.defineProperty(a.prototype, "showTrackHighlight", {
  8763. get : function () {
  8764. return this._showTrackHighlight
  8765. },
  8766. set : function (b) {
  8767. this._showTrackHighlight != b && (this._showTrackHighlight = b, this.trackHighlight && (this.trackHighlight.visible = b), this.invalidateDisplayList())
  8768. },
  8769. enumerable : !0,
  8770. configurable : !0
  8771. });
  8772. Object.defineProperty(a.prototype, "pendingValue", {
  8773. get : function () {
  8774. return this._pendingValue
  8775. },
  8776. set : function (b) {
  8777. b != this._pendingValue && (this._pendingValue = b, this.invalidateDisplayList())
  8778. },
  8779. enumerable : !0,
  8780. configurable : !0
  8781. });
  8782. a.prototype.setValue = function (b) {
  8783. this._pendingValue = b;
  8784. c.prototype.setValue.call(this, b)
  8785. };
  8786. a.prototype.animationUpdateHandler = function (b) {
  8787. this.pendingValue = b.currentValue.value
  8788. };
  8789. a.prototype.animationEndHandler = function (b) {
  8790. this.setValue(this.slideToValue);
  8791. this.dispatchEventWith(d.Event.CHANGE);
  8792. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  8793. };
  8794. a.prototype.stopAnimation = function () {
  8795. this.animator.stop();
  8796. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  8797. this.dispatchEventWith(d.Event.CHANGE);
  8798. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  8799. };
  8800. a.prototype.thumb_mouseDownHandler = function (b) {
  8801. this.animator && this.animator.isPlaying && this.stopAnimation();
  8802. c.prototype.thumb_mouseDownHandler.call(this, b)
  8803. };
  8804. Object.defineProperty(a.prototype, "liveDragging", {
  8805. get : function () {
  8806. return this._liveDragging
  8807. },
  8808. set : function (b) {
  8809. this._liveDragging =
  8810. b
  8811. },
  8812. enumerable : !0,
  8813. configurable : !0
  8814. });
  8815. a.prototype.updateWhenMouseMove = function () {
  8816. if (this.track) {
  8817. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, d.Point.identity),
  8818. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8819. b = this.nearestValidValue(b, this.snapInterval);
  8820. b != this.pendingValue && (e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_DRAG), !0 == this.liveDragging ? (this.setValue(b), this.dispatchEventWith(d.Event.CHANGE)) : this.pendingValue = b)
  8821. }
  8822. };
  8823. a.prototype.stage_mouseUpHandler =
  8824. function (b) {
  8825. c.prototype.stage_mouseUpHandler.call(this, b);
  8826. !1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(d.Event.CHANGE))
  8827. };
  8828. a.prototype.track_mouseDownHandler = function (b) {
  8829. this.enabled && (b = this.track.globalToLocal(b.stageX - (this.thumb ? this.thumb.width : 0) / 2, b.stageY - (this.thumb ? this.thumb.height : 0) / 2, d.Point.identity), b = this.pointToValue(b.x, b.y), b = this.nearestValidValue(b, this.snapInterval), b != this.pendingValue && (0 != this.slideDuration ?
  8830. (this.animator || (this.animator = new e.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler), this.animator.isPlaying && this.stopAnimation(), this.slideToValue = b, this.animator.duration = this.slideDuration * (Math.abs(this.pendingValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.motionPaths = [{
  8831. prop : "value",
  8832. from : this.pendingValue,
  8833. to : this.slideToValue
  8834. }
  8835. ], e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(b), this.dispatchEventWith(d.Event.CHANGE))))
  8836. };
  8837. a.prototype.partAdded = function (b, a) {
  8838. c.prototype.partAdded.call(this, b, a);
  8839. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof d.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  8840. };
  8841. return a
  8842. }
  8843. (e.TrackBase);
  8844. e.SliderBase = f;
  8845. f.prototype.__class__ = "egret.gui.SliderBase"
  8846. })(d.gui || (d.gui = {}))
  8847. })(egret || (egret = {}));
  8848. __extends = this.__extends || function (d, e) {
  8849. function f() {
  8850. this.constructor = d
  8851. }
  8852. for (var c in e)
  8853. e.hasOwnProperty(c) && (d[c] = e[c]);
  8854. f.prototype = e.prototype;
  8855. d.prototype = new f
  8856. };
  8857. (function (d) {
  8858. (function (d) {
  8859. var f = function (c) {
  8860. function a() {
  8861. c.call(this);
  8862. this._maxDisplayedLines = 0;
  8863. this.lastUnscaledWidth = NaN;
  8864. this._padding = 0;
  8865. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  8866. this.addEventListener(d.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  8867. }
  8868. __extends(a, c);
  8869. a.prototype.updateCompleteHandler = function (b) {
  8870. this.lastUnscaledWidth = NaN
  8871. };
  8872. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  8873. get : function () {
  8874. return this._maxDisplayedLines
  8875. },
  8876. set : function (b) {
  8877. this._maxDisplayedLines !=
  8878. b && (this._maxDisplayedLines = b, this.invalidateSize(), this.invalidateDisplayList())
  8879. },
  8880. enumerable : !0,
  8881. configurable : !0
  8882. });
  8883. Object.defineProperty(a.prototype, "padding", {
  8884. get : function () {
  8885. return this._padding
  8886. },
  8887. set : function (b) {
  8888. this._padding != b && (this._padding = b, this.invalidateSize(), this.invalidateDisplayList())
  8889. },
  8890. enumerable : !0,
  8891. configurable : !0
  8892. });
  8893. Object.defineProperty(a.prototype, "paddingLeft", {
  8894. get : function () {
  8895. return this._paddingLeft
  8896. },
  8897. set : function (b) {
  8898. this._paddingLeft != b && (this._paddingLeft = b, this.invalidateSize(),
  8899. this.invalidateDisplayList())
  8900. },
  8901. enumerable : !0,
  8902. configurable : !0
  8903. });
  8904. Object.defineProperty(a.prototype, "paddingRight", {
  8905. get : function () {
  8906. return this._paddingRight
  8907. },
  8908. set : function (b) {
  8909. this._paddingRight != b && (this._paddingRight = b, this.invalidateSize(), this.invalidateDisplayList())
  8910. },
  8911. enumerable : !0,
  8912. configurable : !0
  8913. });
  8914. Object.defineProperty(a.prototype, "paddingTop", {
  8915. get : function () {
  8916. return this._paddingTop
  8917. },
  8918. set : function (b) {
  8919. this._paddingTop != b && (this._paddingTop = b, this.invalidateSize(), this.invalidateDisplayList())
  8920. },
  8921. enumerable : !0,
  8922. configurable : !0
  8923. });
  8924. Object.defineProperty(a.prototype, "paddingBottom", {
  8925. get : function () {
  8926. return this._paddingBottom
  8927. },
  8928. set : function (b) {
  8929. this._paddingBottom != b && (this._paddingBottom = b, this.invalidateSize(), this.invalidateDisplayList())
  8930. },
  8931. enumerable : !0,
  8932. configurable : !0
  8933. });
  8934. a.prototype.measure = function () {
  8935. this._invalidatePropertiesFlag && this.validateProperties();
  8936. if (this.isSpecialCase())
  8937. if (isNaN(this.lastUnscaledWidth))
  8938. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8939. else {
  8940. this.measureUsingWidth(this.lastUnscaledWidth);
  8941. return
  8942. }
  8943. var b;
  8944. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (b = this.maxWidth) : b = this.explicitWidth;
  8945. this.measureUsingWidth(b)
  8946. };
  8947. a.prototype.isSpecialCase = function () {
  8948. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  8949. };
  8950. a.prototype.measureUsingWidth = function (b) {
  8951. var a = this._textField.text;
  8952. this._textChanged && (this._textField.text = this._text);
  8953. var c = isNaN(this._padding) ? 0 : this._padding,
  8954. d = isNaN(this._paddingLeft) ?
  8955. c : this._paddingLeft,
  8956. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8957. f = isNaN(this._paddingTop) ? c : this._paddingTop,
  8958. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8959. this._textField.width = NaN;
  8960. this._textField.height = NaN;
  8961. isNaN(b) || (this._textField.width = b - d - e);
  8962. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  8963. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  8964. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (b = this._textField.lineSpacing, this.measuredHeight =
  8965. (this._textField.size + b) * this._maxDisplayedLines - b);
  8966. this.measuredWidth += d + e;
  8967. this.measuredHeight += f + c;
  8968. this._textField.text = a
  8969. };
  8970. a.prototype.updateDisplayList = function (b, a) {
  8971. this.$updateDisplayList(b, a);
  8972. var c = isNaN(this._padding) ? 0 : this._padding,
  8973. d = isNaN(this._paddingLeft) ? c : this._paddingLeft,
  8974. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8975. f = isNaN(this._paddingTop) ? c : this._paddingTop,
  8976. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8977. this._textField.x = d;
  8978. this._textField.y = f;
  8979. if (this.isSpecialCase()) {
  8980. var l =
  8981. isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != b;
  8982. this.lastUnscaledWidth = b;
  8983. if (l) {
  8984. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8985. this.invalidateSize();
  8986. return
  8987. }
  8988. }
  8989. this._invalidateSizeFlag && this.validateSize();
  8990. this._textField.visible || (this._textField.visible = !0);
  8991. this._textField.width = b - d - e;
  8992. d = a - f - c;
  8993. this._textField.height = d;
  8994. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(d, (this._textField.size + e) * this._maxDisplayedLines -
  8995. e))
  8996. };
  8997. return a
  8998. }
  8999. (d.TextBase);
  9000. d.Label = f;
  9001. f.prototype.__class__ = "egret.gui.Label"
  9002. })(d.gui || (d.gui = {}))
  9003. })(egret || (egret = {}));
  9004. __extends = this.__extends || function (d, e) {
  9005. function f() {
  9006. this.constructor = d
  9007. }
  9008. for (var c in e)
  9009. e.hasOwnProperty(c) && (d[c] = e[c]);
  9010. f.prototype = e.prototype;
  9011. d.prototype = new f
  9012. };
  9013. (function (d) {
  9014. (function (e) {
  9015. var f = function (c) {
  9016. function a() {
  9017. c.call(this);
  9018. this._fillColor = 16777215;
  9019. this._fillAlpha = 1;
  9020. this._strokeColor = 4473924;
  9021. this._strokeAlpha = 0;
  9022. this._strokeWeight = 1;
  9023. this.touchChildren = !1
  9024. }
  9025. __extends(a, c);
  9026. Object.defineProperty(a.prototype, "graphics", {
  9027. get : function () {
  9028. this._graphics || (this._graphics = new d.Graphics);
  9029. return this._graphics
  9030. },
  9031. enumerable : !0,
  9032. configurable : !0
  9033. });
  9034. a.prototype._render = function (b) {
  9035. this._graphics && this._graphics._draw(b);
  9036. c.prototype._render.call(this, b)
  9037. };
  9038. Object.defineProperty(a.prototype,
  9039. "fillColor", {
  9040. get : function () {
  9041. return this._fillColor
  9042. },
  9043. set : function (b) {
  9044. this._fillColor != b && (this._fillColor = b, this.invalidateDisplayList())
  9045. },
  9046. enumerable : !0,
  9047. configurable : !0
  9048. });
  9049. Object.defineProperty(a.prototype, "fillAlpha", {
  9050. get : function () {
  9051. return this._fillAlpha
  9052. },
  9053. set : function (b) {
  9054. this._fillAlpha != b && (this._fillAlpha = b, this.invalidateDisplayList())
  9055. },
  9056. enumerable : !0,
  9057. configurable : !0
  9058. });
  9059. Object.defineProperty(a.prototype, "strokeColor", {
  9060. get : function () {
  9061. return this._strokeColor
  9062. },
  9063. set : function (b) {
  9064. this._strokeColor != b &&
  9065. (this._strokeColor = b, this.invalidateDisplayList())
  9066. },
  9067. enumerable : !0,
  9068. configurable : !0
  9069. });
  9070. Object.defineProperty(a.prototype, "strokeAlpha", {
  9071. get : function () {
  9072. return this._strokeAlpha
  9073. },
  9074. set : function (b) {
  9075. this._strokeAlpha != b && (this._strokeAlpha = b, this.invalidateDisplayList())
  9076. },
  9077. enumerable : !0,
  9078. configurable : !0
  9079. });
  9080. Object.defineProperty(a.prototype, "strokeWeight", {
  9081. get : function () {
  9082. return this._strokeWeight
  9083. },
  9084. set : function (b) {
  9085. this._strokeWeight != b && (this._strokeWeight = b, this.invalidateDisplayList())
  9086. },
  9087. enumerable : !0,
  9088. configurable : !0
  9089. });
  9090. a.prototype._measureBounds = function () {
  9091. var b = c.prototype._measureBounds.call(this),
  9092. a = this.width,
  9093. d = this.height;
  9094. 0 < b.x && (b.x = 0);
  9095. 0 < b.y && (b.y = 0);
  9096. 0 + a > b.right && (b.right = 0 + a);
  9097. 0 + d > b.bottom && (b.bottom = 0 + d);
  9098. return b
  9099. };
  9100. a.prototype.updateDisplayList = function (b, a) {
  9101. c.prototype.updateDisplayList.call(this, b, b);
  9102. var d = this.graphics;
  9103. d.clear();
  9104. d.beginFill(this._fillColor, this._fillAlpha);
  9105. 0 < this._strokeAlpha && d.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  9106. d.drawRect(0, 0,
  9107. b, a);
  9108. d.endFill()
  9109. };
  9110. return a
  9111. }
  9112. (e.UIComponent);
  9113. e.Rect = f;
  9114. f.prototype.__class__ = "egret.gui.Rect"
  9115. })(d.gui || (d.gui = {}))
  9116. })(egret || (egret = {}));
  9117. __extends = this.__extends || function (d, e) {
  9118. function f() {
  9119. this.constructor = d
  9120. }
  9121. for (var c in e)
  9122. e.hasOwnProperty(c) && (d[c] = e[c]);
  9123. f.prototype = e.prototype;
  9124. d.prototype = new f
  9125. };
  9126. (function (d) {
  9127. (function (d) {
  9128. var f = function (c) {
  9129. function a() {
  9130. c.call(this);
  9131. this.hostComponentKey = "egret.gui.Button"
  9132. }
  9133. __extends(a, c);
  9134. return a
  9135. }
  9136. (d.ButtonBase);
  9137. d.Button = f;
  9138. f.prototype.__class__ = "egret.gui.Button"
  9139. })(d.gui || (d.gui = {}))
  9140. })(egret || (egret = {}));
  9141. __extends = this.__extends || function (d, e) {
  9142. function f() {
  9143. this.constructor = d
  9144. }
  9145. for (var c in e)
  9146. e.hasOwnProperty(c) && (d[c] = e[c]);
  9147. f.prototype = e.prototype;
  9148. d.prototype = new f
  9149. };
  9150. (function (d) {
  9151. (function (d) {
  9152. var f = function (c) {
  9153. function a() {
  9154. c.call(this);
  9155. this.hostComponentKey = "egret.gui.ToggleButton"
  9156. }
  9157. __extends(a, c);
  9158. return a
  9159. }
  9160. (d.ToggleButtonBase);
  9161. d.ToggleButton = f;
  9162. f.prototype.__class__ = "egret.gui.ToggleButton"
  9163. })(d.gui || (d.gui = {}))
  9164. })(egret || (egret = {}));
  9165. __extends = this.__extends || function (d, e) {
  9166. function f() {
  9167. this.constructor = d
  9168. }
  9169. for (var c in e)
  9170. e.hasOwnProperty(c) && (d[c] = e[c]);
  9171. f.prototype = e.prototype;
  9172. d.prototype = new f
  9173. };
  9174. (function (d) {
  9175. (function (d) {
  9176. var f = function (c) {
  9177. function a() {
  9178. c.call(this);
  9179. this.hostComponentKey = "egret.gui.CheckBox"
  9180. }
  9181. __extends(a, c);
  9182. return a
  9183. }
  9184. (d.ToggleButtonBase);
  9185. d.CheckBox = f;
  9186. f.prototype.__class__ = "egret.gui.CheckBox"
  9187. })(d.gui || (d.gui = {}))
  9188. })(egret || (egret = {}));
  9189. __extends = this.__extends || function (d, e) {
  9190. function f() {
  9191. this.constructor = d
  9192. }
  9193. for (var c in e)
  9194. e.hasOwnProperty(c) && (d[c] = e[c]);
  9195. f.prototype = e.prototype;
  9196. d.prototype = new f
  9197. };
  9198. (function (d) {
  9199. (function (e) {
  9200. var f = function (c) {
  9201. function a() {
  9202. c.call(this);
  9203. this.radioButtons = [];
  9204. this._enabled = !0;
  9205. this._name = "_radioButtonGroup" + a.groupCount;
  9206. a.groupCount++
  9207. }
  9208. __extends(a, c);
  9209. Object.defineProperty(a.prototype, "enabled", {
  9210. get : function () {
  9211. return this._enabled
  9212. },
  9213. set : function (b) {
  9214. if (this._enabled != b)
  9215. for (this._enabled = b, b = 0; b < this.numRadioButtons; b++)
  9216. this.getRadioButtonAt(b).invalidateSkinState()
  9217. },
  9218. enumerable : !0,
  9219. configurable : !0
  9220. });
  9221. Object.defineProperty(a.prototype, "numRadioButtons", {
  9222. get : function () {
  9223. return this.radioButtons.length
  9224. },
  9225. enumerable : !0,
  9226. configurable : !0
  9227. });
  9228. Object.defineProperty(a.prototype, "selectedValue", {
  9229. get : function () {
  9230. return this.selection ? null != this.selection.value ? this.selection.value : this.selection.label : null
  9231. },
  9232. set : function (b) {
  9233. this._selectedValue = b;
  9234. if (null == b)
  9235. this._setSelection(null, !1);
  9236. else
  9237. for (var a = this.numRadioButtons, c = 0; c < a; c++) {
  9238. var d = this.getRadioButtonAt(c);
  9239. if (d.value == b || d.label == b) {
  9240. this.changeSelection(c, !1);
  9241. this._selectedValue = null;
  9242. e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT);
  9243. break
  9244. }
  9245. }
  9246. },
  9247. enumerable : !0,
  9248. configurable : !0
  9249. });
  9250. Object.defineProperty(a.prototype, "selection", {
  9251. get : function () {
  9252. return this._selection
  9253. },
  9254. set : function (b) {
  9255. this._selection != b && this._setSelection(b, !1)
  9256. },
  9257. enumerable : !0,
  9258. configurable : !0
  9259. });
  9260. a.prototype.getRadioButtonAt = function (b) {
  9261. return 0 <= b && b < this.numRadioButtons ? this.radioButtons[b] : null
  9262. };
  9263. a.prototype._addInstance = function (b) {
  9264. function a(b, c) {
  9265. var d = b.parent,
  9266. f = c.parent;
  9267. if (!d || !f)
  9268. return 0;
  9269. var u = b instanceof e.UIComponent ? b.nestLevel : -1,
  9270. n = c instanceof e.UIComponent ? c.nestLevel : -1,
  9271. q = 0,
  9272. p = 0;
  9273. d ==
  9274. f && (q = "getElementIndex" in d && "ownerChanged" in b ? d.getElementIndex(b) : d.getChildIndex(b), p = "getElementIndex" in f && "ownerChanged" in c ? f.getElementIndex(c) : f.getChildIndex(c));
  9275. return u > n || q > p ? 1 : u < n || p > q ? -1 : b == c ? 0 : a(d, f)
  9276. }
  9277. b.addEventListener(d.Event.REMOVED, this.radioButton_removedHandler, this);
  9278. this.radioButtons.push(b);
  9279. this.radioButtons.sort(a);
  9280. for (var c = 0; c < this.radioButtons.length; c++)
  9281. this.radioButtons[c]._indexNumber = c;
  9282. this._selectedValue && (this.selectedValue = this._selectedValue);
  9283. !0 == b.selected && (this.selection =
  9284. b);
  9285. b._radioButtonGroup = this;
  9286. b.invalidateSkinState();
  9287. this.dispatchEventWith("numRadioButtonsChanged")
  9288. };
  9289. a.prototype._removeInstance = function (b) {
  9290. this.doRemoveInstance(b, !1)
  9291. };
  9292. a.prototype.doRemoveInstance = function (b, a) {
  9293. "undefined" === typeof a && (a = !0);
  9294. if (b) {
  9295. for (var c = !1, e = 0; e < this.numRadioButtons; e++) {
  9296. var f = this.getRadioButtonAt(e);
  9297. c ? f._indexNumber -= 1 : f == b && (a && b.addEventListener(d.Event.ADDED, this.radioButton_addedHandler, this), b == this._selection && (this._selection = null), b._radioButtonGroup = null, b.invalidateSkinState(),
  9298. this.radioButtons.splice(e, 1), c = !0, e--)
  9299. }
  9300. c && this.dispatchEventWith("numRadioButtonsChanged")
  9301. }
  9302. };
  9303. a.prototype._setSelection = function (b, a) {
  9304. "undefined" === typeof a && (a = !0);
  9305. if (this._selection != b) {
  9306. if (b)
  9307. for (var c = this.numRadioButtons, f = 0; f < c; f++) {
  9308. if (b == this.getRadioButtonAt(f)) {
  9309. this.changeSelection(f, a);
  9310. break
  9311. }
  9312. }
  9313. else
  9314. this.selection && (this._selection.selected = !1, this._selection = null, a && this.dispatchEventWith(d.Event.CHANGE));
  9315. e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT)
  9316. }
  9317. };
  9318. a.prototype.changeSelection =
  9319. function (b, a) {
  9320. "undefined" === typeof a && (a = !0);
  9321. var c = this.getRadioButtonAt(b);
  9322. c && c != this._selection && (this._selection && (this._selection.selected = !1), this._selection = c, this._selection.selected = !0, a && this.dispatchEventWith(d.Event.CHANGE))
  9323. };
  9324. a.prototype.radioButton_addedHandler = function (b) {
  9325. if (b = b.target)
  9326. b.removeEventListener(d.Event.ADDED, this.radioButton_addedHandler, this), this._addInstance(b)
  9327. };
  9328. a.prototype.radioButton_removedHandler = function (b) {
  9329. if (b = b.target)
  9330. b.removeEventListener(d.Event.REMOVED, this.radioButton_removedHandler,
  9331. this), this.doRemoveInstance(b)
  9332. };
  9333. a.groupCount = 0;
  9334. return a
  9335. }
  9336. (d.EventDispatcher);
  9337. e.RadioButtonGroup = f;
  9338. f.prototype.__class__ = "egret.gui.RadioButtonGroup"
  9339. })(d.gui || (d.gui = {}))
  9340. })(egret || (egret = {}));
  9341. __extends = this.__extends || function (d, e) {
  9342. function f() {
  9343. this.constructor = d
  9344. }
  9345. for (var c in e)
  9346. e.hasOwnProperty(c) && (d[c] = e[c]);
  9347. f.prototype = e.prototype;
  9348. d.prototype = new f
  9349. };
  9350. (function (d) {
  9351. (function (d) {
  9352. var f = function (c) {
  9353. function a() {
  9354. c.call(this);
  9355. this._indexNumber = 0;
  9356. this._radioButtonGroup = null;
  9357. this.groupChanged = !1;
  9358. this._groupName = "radioGroup";
  9359. this.hostComponentKey = "egret.gui.RadioButton";
  9360. this.groupName = "radioGroup"
  9361. }
  9362. __extends(a, c);
  9363. Object.defineProperty(a.prototype, "enabled", {
  9364. get : function () {
  9365. return this._enabled ? !this._radioButtonGroup || this._radioButtonGroup.enabled : !1
  9366. },
  9367. set : function (b) {
  9368. this._setEnabled(b)
  9369. },
  9370. enumerable : !0,
  9371. configurable : !0
  9372. });
  9373. Object.defineProperty(a.prototype,
  9374. "group", {
  9375. get : function () {
  9376. if (!this._group && this._groupName) {
  9377. a.automaticRadioButtonGroups || (a.automaticRadioButtonGroups = {});
  9378. var b = a.automaticRadioButtonGroups[this._groupName];
  9379. b || (b = new d.RadioButtonGroup, b._name = this._groupName, a.automaticRadioButtonGroups[this._groupName] = b);
  9380. this._group = b
  9381. }
  9382. return this._group
  9383. },
  9384. set : function (b) {
  9385. this._group != b && (this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._groupName = (this._group = b) ? this.group._name : "radioGroup", this.groupChanged = !0, this.invalidateProperties(),
  9386. this.invalidateDisplayList())
  9387. },
  9388. enumerable : !0,
  9389. configurable : !0
  9390. });
  9391. Object.defineProperty(a.prototype, "groupName", {
  9392. get : function () {
  9393. return this._groupName
  9394. },
  9395. set : function (b) {
  9396. b && "" != b && (this._groupName = b, this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._group = null, this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  9397. },
  9398. enumerable : !0,
  9399. configurable : !0
  9400. });
  9401. a.prototype._setSelected = function (b) {
  9402. c.prototype._setSelected.call(this, b);
  9403. this.invalidateDisplayList()
  9404. };
  9405. Object.defineProperty(a.prototype,
  9406. "value", {
  9407. get : function () {
  9408. return this._value
  9409. },
  9410. set : function (b) {
  9411. this._value != b && (this._value = b, this.selected && this.group && d.UIEvent.dispatchUIEvent(this.group, d.UIEvent.VALUE_COMMIT))
  9412. },
  9413. enumerable : !0,
  9414. configurable : !0
  9415. });
  9416. a.prototype.commitProperties = function () {
  9417. this.groupChanged && (this.addToGroup(), this.groupChanged = !1);
  9418. c.prototype.commitProperties.call(this)
  9419. };
  9420. a.prototype.updateDisplayList = function (b, a) {
  9421. c.prototype.updateDisplayList.call(this, b, a);
  9422. this.group && (this.selected ? this._group.selection = this : this.group.selection ==
  9423. this && (this._group.selection = null))
  9424. };
  9425. a.prototype.buttonReleased = function () {
  9426. this.enabled && !this.selected && (this._radioButtonGroup || this.addToGroup(), c.prototype.buttonReleased.call(this), this.group._setSelection(this))
  9427. };
  9428. a.prototype.addToGroup = function () {
  9429. var b = this.group;
  9430. b && b._addInstance(this);
  9431. return b
  9432. };
  9433. return a
  9434. }
  9435. (d.ToggleButtonBase);
  9436. d.RadioButton = f;
  9437. f.prototype.__class__ = "egret.gui.RadioButton"
  9438. })(d.gui || (d.gui = {}))
  9439. })(egret || (egret = {}));
  9440. __extends = this.__extends || function (d, e) {
  9441. function f() {
  9442. this.constructor = d
  9443. }
  9444. for (var c in e)
  9445. e.hasOwnProperty(c) && (d[c] = e[c]);
  9446. f.prototype = e.prototype;
  9447. d.prototype = new f
  9448. };
  9449. (function (d) {
  9450. (function (e) {
  9451. var f = function (c) {
  9452. function a() {
  9453. c.call(this);
  9454. this.elementsContentChanged = this.createChildrenCalled = !1;
  9455. this._elementsContent = []
  9456. }
  9457. __extends(a, c);
  9458. a.prototype.createChildren = function () {
  9459. c.prototype.createChildren.call(this);
  9460. this.createChildrenCalled = !0;
  9461. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  9462. };
  9463. a.prototype._getElementsContent = function () {
  9464. return this._elementsContent
  9465. };
  9466. Object.defineProperty(a.prototype, "elementsContent", {
  9467. set : function (b) {
  9468. null == b && (b = []);
  9469. if (b != this._elementsContent)
  9470. if (this.createChildrenCalled)
  9471. this.setElementsContent(b);
  9472. else {
  9473. this.elementsContentChanged = !0;
  9474. for (var a = this._elementsContent.length - 1; 0 <= a; a--)
  9475. this._elementRemoved(this._elementsContent[a], a);
  9476. this._elementsContent = b
  9477. }
  9478. },
  9479. enumerable : !0,
  9480. configurable : !0
  9481. });
  9482. a.prototype.setElementsContent = function (b) {
  9483. var a;
  9484. for (a = this._elementsContent.length - 1; 0 <= a; a--)
  9485. this._elementRemoved(this._elementsContent[a], a);
  9486. this._elementsContent = b.concat();
  9487. b = this._elementsContent.length;
  9488. for (a = 0; a < b; a++) {
  9489. var c = this._elementsContent[a];
  9490. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9491. this._elementAdded(c, a)
  9492. }
  9493. };
  9494. Object.defineProperty(a.prototype, "numElements", {
  9495. get : function () {
  9496. return this._elementsContent.length
  9497. },
  9498. enumerable : !0,
  9499. configurable : !0
  9500. });
  9501. a.prototype.getElementAt = function (b) {
  9502. this.checkForRangeError(b);
  9503. return this._elementsContent[b]
  9504. };
  9505. a.prototype.checkForRangeError = function (b, a) {
  9506. "undefined" === typeof a && (a = !1);
  9507. var c = this._elementsContent.length - 1;
  9508. a && c++;
  9509. if (0 > b || b > c)
  9510. throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9511. };
  9512. a.prototype.addElement = function (b) {
  9513. var a = this.numElements;
  9514. b.parent == this && (a = this.numElements - 1);
  9515. return this.addElementAt(b, a)
  9516. };
  9517. a.prototype.addElementAt = function (b, a) {
  9518. if (b == this)
  9519. return b;
  9520. this.checkForRangeError(a, !0);
  9521. var c = b.owner;
  9522. if (c == this || b.parent == this)
  9523. return this.setElementIndex(b, a), b;
  9524. c && "removeElement" in c && b.owner.removeElement(b);
  9525. this._elementsContent.splice(a, 0, b);
  9526. this.elementsContentChanged || this._elementAdded(b, a);
  9527. return b
  9528. };
  9529. a.prototype.removeElement = function (b) {
  9530. return this.removeElementAt(this.getElementIndex(b))
  9531. };
  9532. a.prototype.removeElementAt = function (b) {
  9533. this.checkForRangeError(b);
  9534. var a = this._elementsContent[b];
  9535. this.elementsContentChanged || this._elementRemoved(a, b);
  9536. this._elementsContent.splice(b, 1);
  9537. return a
  9538. };
  9539. a.prototype.removeAllElements = function () {
  9540. for (var b = this.numElements - 1; 0 <= b; b--)
  9541. this.removeElementAt(b)
  9542. };
  9543. a.prototype.getElementIndex =
  9544. function (b) {
  9545. return this._elementsContent.indexOf(b)
  9546. };
  9547. a.prototype.setElementIndex = function (b, a) {
  9548. this.checkForRangeError(a);
  9549. var c = this.getElementIndex(b);
  9550. -1 != c && c != a && (this.elementsContentChanged || this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this.elementsContentChanged || this._elementAdded(b, a, !1))
  9551. };
  9552. a.prototype.swapElements = function (b, a) {
  9553. this.swapElementsAt(this.getElementIndex(b), this.getElementIndex(a))
  9554. };
  9555. a.prototype.swapElementsAt = function (b, a) {
  9556. this.checkForRangeError(b);
  9557. this.checkForRangeError(a);
  9558. if (b > a) {
  9559. var c = a;
  9560. a = b;
  9561. b = c
  9562. } else if (b == a)
  9563. return;
  9564. var c = this._elementsContent,
  9565. d = c[b],
  9566. e = c[a];
  9567. this.elementsContentChanged || (this._elementRemoved(d, b, !1), this._elementRemoved(e, a, !1));
  9568. c[b] = e;
  9569. c[a] = d;
  9570. this.elementsContentChanged || (this._elementAdded(e, b, !1), this._elementAdded(d, a, !1))
  9571. };
  9572. a.prototype._elementAdded = function (b, a, c) {
  9573. "undefined" === typeof c && (c = !0);
  9574. b instanceof d.DisplayObject && this._addToDisplayListAt(b, a, c);
  9575. c && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_ADD) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this,
  9576. e.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9577. this.invalidateSize();
  9578. this.invalidateDisplayList()
  9579. };
  9580. a.prototype._elementRemoved = function (b, a, c) {
  9581. "undefined" === typeof c && (c = !0);
  9582. c && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_REMOVE) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9583. b instanceof d.DisplayObject && b.parent == this && this._removeFromDisplayList(b, c);
  9584. this.invalidateSize();
  9585. this.invalidateDisplayList()
  9586. };
  9587. a.prototype.addChild = function (b) {
  9588. throw Error("addChild()" +
  9589. a.errorStr + "addElement()\u4ee3\u66ff");
  9590. };
  9591. a.prototype.addChildAt = function (b, c) {
  9592. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9593. };
  9594. a.prototype.removeChild = function (b) {
  9595. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9596. };
  9597. a.prototype.removeChildAt = function (b) {
  9598. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9599. };
  9600. a.prototype.setChildIndex = function (b, c) {
  9601. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9602. };
  9603. a.prototype.swapChildren =
  9604. function (b, c) {
  9605. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9606. };
  9607. a.prototype.swapChildrenAt = function (b, c) {
  9608. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9609. };
  9610. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9611. return a
  9612. }
  9613. (e.GroupBase);
  9614. e.Group = f;
  9615. f.prototype.__class__ = "egret.gui.Group"
  9616. })(d.gui || (d.gui = {}))
  9617. })(egret || (egret = {}));
  9618. __extends = this.__extends || function (d, e) {
  9619. function f() {
  9620. this.constructor = d
  9621. }
  9622. for (var c in e)
  9623. e.hasOwnProperty(c) && (d[c] = e[c]);
  9624. f.prototype = e.prototype;
  9625. d.prototype = new f
  9626. };
  9627. (function (d) {
  9628. (function (e) {
  9629. var f = function (c) {
  9630. function a() {
  9631. c.call(this);
  9632. this._createAllChildren = !1;
  9633. this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  9634. this._selectedIndex = -1;
  9635. this.childOrderingChanged = this.notifyTabBar = !1;
  9636. this._setLayout(new e.BasicLayout)
  9637. }
  9638. __extends(a, c);
  9639. Object.defineProperty(a.prototype, "layout", {
  9640. get : function () {
  9641. return this._layout
  9642. },
  9643. set : function (b) {},
  9644. enumerable : !0,
  9645. configurable : !0
  9646. });
  9647. Object.defineProperty(a.prototype, "createAllChildren", {
  9648. get : function () {
  9649. return this._createAllChildren
  9650. },
  9651. set : function (b) {
  9652. if (this._createAllChildren !=
  9653. b && (this._createAllChildren = b)) {
  9654. b = this._getElementsContent();
  9655. for (var a = b.length, c = 0; c < a; c++) {
  9656. var e = b[c];
  9657. e instanceof d.DisplayObject && e.parent != this && (this.childOrderingChanged = !0, this._addToDisplayList(e))
  9658. }
  9659. this.childOrderingChanged && this.invalidateProperties()
  9660. }
  9661. },
  9662. enumerable : !0,
  9663. configurable : !0
  9664. });
  9665. Object.defineProperty(a.prototype, "selectedChild", {
  9666. get : function () {
  9667. var b = this.selectedIndex;
  9668. return 0 <= b && b < this.numElements ? this.getElementAt(b) : null
  9669. },
  9670. set : function (b) {
  9671. b = this.getElementIndex(b);
  9672. 0 <= b && b < this.numElements &&
  9673. this._setSelectedIndex(b)
  9674. },
  9675. enumerable : !0,
  9676. configurable : !0
  9677. });
  9678. Object.defineProperty(a.prototype, "selectedIndex", {
  9679. get : function () {
  9680. return this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this.proposedSelectedIndex : this._selectedIndex
  9681. },
  9682. set : function (b) {
  9683. this._setSelectedIndex(b)
  9684. },
  9685. enumerable : !0,
  9686. configurable : !0
  9687. });
  9688. a.prototype._setSelectedIndex = function (b, a) {
  9689. "undefined" === typeof a && (a = !0);
  9690. b != this.selectedIndex && (this.proposedSelectedIndex = b, this.invalidateProperties(), e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT),
  9691. this.notifyTabBar = this.notifyTabBar || a)
  9692. };
  9693. a.prototype._elementAdded = function (b, a, c) {
  9694. "undefined" === typeof c && (c = !0);
  9695. this._createAllChildren && b instanceof d.DisplayObject && this._addToDisplayListAt(b, a, c);
  9696. c && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_ADD) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9697. b.visible = !1;
  9698. b.includeInLayout = !1;
  9699. -1 == this.selectedIndex ? this._setSelectedIndex(a, !1) : a <= this.selectedIndex && this.initialized && this._setSelectedIndex(this.selectedIndex +
  9700. 1);
  9701. this.dispatchCoEvent(e.CollectionEventKind.ADD, a, -1, [b.name])
  9702. };
  9703. a.prototype._elementRemoved = function (b, a, d) {
  9704. "undefined" === typeof d && (d = !0);
  9705. c.prototype._elementRemoved.call(this, b, a, d);
  9706. b.visible = !0;
  9707. b.includeInLayout = !0;
  9708. a == this.selectedIndex ? 0 < this.numElements ? 0 == a ? (this.proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this._setSelectedIndex(-1) : a < this.selectedIndex && this._setSelectedIndex(this.selectedIndex - 1);
  9709. this.dispatchCoEvent(e.CollectionEventKind.REMOVE, a, -1,
  9710. [b.name])
  9711. };
  9712. a.prototype.commitProperties = function () {
  9713. c.prototype.commitProperties.call(this);
  9714. this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (this.commitSelection(this.proposedSelectedIndex), this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION);
  9715. if (this.childOrderingChanged) {
  9716. this.childOrderingChanged = !1;
  9717. for (var b = this._getElementsContent(), e = b.length, f = 0; f < e; f++) {
  9718. var y = b[f];
  9719. y instanceof d.DisplayObject && y.parent == this && this._addToDisplayList(y)
  9720. }
  9721. }
  9722. this.notifyTabBar && (this.notifyTabBar = !0, this.dispatchEventWith("IndexChanged"))
  9723. };
  9724. a.prototype.commitSelection = function (b) {
  9725. 0 <= b && b < this.numElements ? (this._selectedIndex = b, this._selectedChild && this._selectedChild.parent == this && (this._selectedChild.visible = !1, this._selectedChild.includeInLayout = !1), this._selectedChild = this.getElementAt(this._selectedIndex), this._selectedChild.visible = !0, this._selectedChild.includeInLayout = !0, this._selectedChild.parent != this && this._selectedChild instanceof d.DisplayObject && (this._addToDisplayList(this._selectedChild), this.childOrderingChanged || (this.childOrderingChanged =
  9726. !0))) : (this._selectedChild = null, this._selectedIndex = -1);
  9727. this.invalidateSize();
  9728. this.invalidateDisplayList()
  9729. };
  9730. Object.defineProperty(a.prototype, "length", {
  9731. get : function () {
  9732. return this.numElements
  9733. },
  9734. enumerable : !0,
  9735. configurable : !0
  9736. });
  9737. a.prototype.getItemAt = function (b) {
  9738. return (b = this.getElementAt(b)) ? b.name : ""
  9739. };
  9740. a.prototype.getItemIndex = function (b) {
  9741. for (var a = this._getElementsContent(), c = a.length, d = 0; d < c; d++)
  9742. if (a[d].name === b)
  9743. return d;
  9744. return -1
  9745. };
  9746. a.prototype.dispatchCoEvent = function (b, a, c, d, f) {
  9747. "undefined" === typeof b &&
  9748. (b = null);
  9749. "undefined" === typeof a && (a = -1);
  9750. "undefined" === typeof c && (c = -1);
  9751. "undefined" === typeof d && (d = null);
  9752. "undefined" === typeof f && (f = null);
  9753. e.CollectionEvent.dispatchCollectionEvent(this, e.CollectionEvent.COLLECTION_CHANGE, b, a, c, d, f)
  9754. };
  9755. a.NO_PROPOSED_SELECTION = -2;
  9756. return a
  9757. }
  9758. (e.Group);
  9759. e.ViewStack = f;
  9760. f.prototype.__class__ = "egret.gui.ViewStack"
  9761. })(d.gui || (d.gui = {}))
  9762. })(egret || (egret = {}));
  9763. __extends = this.__extends || function (d, e) {
  9764. function f() {
  9765. this.constructor = d
  9766. }
  9767. for (var c in e)
  9768. e.hasOwnProperty(c) && (d[c] = e[c]);
  9769. f.prototype = e.prototype;
  9770. d.prototype = new f
  9771. };
  9772. (function (d) {
  9773. (function (e) {
  9774. var f = function (c) {
  9775. function a() {
  9776. c.call(this);
  9777. this.maxWidth = 1E4;
  9778. this.minWidth = 0;
  9779. this.maxHeight = 1E4;
  9780. this.minHeight = 0;
  9781. this.height = this.width = NaN;
  9782. this._initialized = !1;
  9783. this._elementsContent = [];
  9784. this._states = [];
  9785. this.initialized = !1
  9786. }
  9787. __extends(a, c);
  9788. a.prototype.createChildren = function () {};
  9789. Object.defineProperty(a.prototype, "hostComponent", {
  9790. get : function () {
  9791. return this._hostComponent
  9792. },
  9793. set : function (b) {
  9794. this._setHostComponent(b)
  9795. },
  9796. enumerable : !0,
  9797. configurable : !0
  9798. });
  9799. a.prototype._setHostComponent =
  9800. function (b) {
  9801. if (this._hostComponent != b) {
  9802. var a;
  9803. if (this._hostComponent)
  9804. for (a = this._elementsContent.length - 1; 0 <= a; a--)
  9805. this._elementRemoved(this._elementsContent[a], a);
  9806. this._hostComponent = b;
  9807. this._initialized || (this._initialized = !0, this.createChildren());
  9808. if (this._hostComponent) {
  9809. b = this._elementsContent.length;
  9810. for (a = 0; a < b; a++)
  9811. this._elementAdded(this._elementsContent[a], a);
  9812. this.initializeStates();
  9813. this.currentStateChanged && this.commitCurrentState()
  9814. }
  9815. }
  9816. };
  9817. a.prototype._getElementsContent = function () {
  9818. return this._elementsContent
  9819. };
  9820. Object.defineProperty(a.prototype, "elementsContent", {
  9821. set : function (b) {
  9822. null == b && (b = []);
  9823. if (b != this._elementsContent)
  9824. if (this._hostComponent) {
  9825. var a;
  9826. for (a = this._elementsContent.length - 1; 0 <= a; a--)
  9827. this._elementRemoved(this._elementsContent[a], a);
  9828. this._elementsContent = b.concat();
  9829. b = this._elementsContent.length;
  9830. for (a = 0; a < b; a++) {
  9831. var c = this._elementsContent[a];
  9832. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9833. this._elementAdded(c, a)
  9834. }
  9835. } else
  9836. this._elementsContent =
  9837. b.concat()
  9838. },
  9839. enumerable : !0,
  9840. configurable : !0
  9841. });
  9842. Object.defineProperty(a.prototype, "numElements", {
  9843. get : function () {
  9844. return this._elementsContent.length
  9845. },
  9846. enumerable : !0,
  9847. configurable : !0
  9848. });
  9849. a.prototype.getElementAt = function (b) {
  9850. this.checkForRangeError(b);
  9851. return this._elementsContent[b]
  9852. };
  9853. a.prototype.checkForRangeError = function (b, a) {
  9854. "undefined" === typeof a && (a = !1);
  9855. var c = this._elementsContent.length - 1;
  9856. a && c++;
  9857. if (0 > b || b > c)
  9858. throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9859. };
  9860. a.prototype.addElement = function (b) {
  9861. var a = this.numElements;
  9862. b.owner == this && (a = this.numElements - 1);
  9863. return this.addElementAt(b, a)
  9864. };
  9865. a.prototype.addElementAt = function (b, a) {
  9866. this.checkForRangeError(a, !0);
  9867. var c = b.owner;
  9868. if (c == this)
  9869. return this.setElementIndex(b, a), b;
  9870. c && "removeElement" in c && c.removeElement(b);
  9871. this._elementsContent.splice(a, 0, b);
  9872. this._hostComponent ? this._elementAdded(b, a) : b.ownerChanged(this);
  9873. return b
  9874. };
  9875. a.prototype.removeElement = function (b) {
  9876. return this.removeElementAt(this.getElementIndex(b))
  9877. };
  9878. a.prototype.removeElementAt = function (b) {
  9879. this.checkForRangeError(b);
  9880. var a = this._elementsContent[b];
  9881. this._hostComponent ? this._elementRemoved(a, b) : a.ownerChanged(null);
  9882. this._elementsContent.splice(b, 1);
  9883. return a
  9884. };
  9885. a.prototype.getElementIndex = function (b) {
  9886. return this._elementsContent.indexOf(b)
  9887. };
  9888. a.prototype.setElementIndex = function (b, a) {
  9889. this.checkForRangeError(a);
  9890. var c = this.getElementIndex(b);
  9891. -1 != c && c != a && (this._hostComponent && this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a,
  9892. 0, b), this._hostComponent && this._elementAdded(b, a, !1))
  9893. };
  9894. a.prototype._elementAdded = function (b, a, c) {
  9895. "undefined" === typeof c && (c = !0);
  9896. b.ownerChanged(this);
  9897. b instanceof d.DisplayObject && this._hostComponent._addToDisplayListAt(b, a, c);
  9898. c && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_ADD) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9899. this._hostComponent.invalidateSize();
  9900. this._hostComponent.invalidateDisplayList()
  9901. };
  9902. a.prototype._elementRemoved = function (b,
  9903. a, c) {
  9904. "undefined" === typeof c && (c = !0);
  9905. c && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_REMOVE) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9906. b instanceof d.DisplayObject && b.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(b, c);
  9907. b.ownerChanged(null);
  9908. this._hostComponent.invalidateSize();
  9909. this._hostComponent.invalidateDisplayList()
  9910. };
  9911. Object.defineProperty(a.prototype, "states", {
  9912. get : function () {
  9913. return this._states
  9914. },
  9915. set : function (b) {
  9916. this._setStates(b)
  9917. },
  9918. enumerable : !0,
  9919. configurable : !0
  9920. });
  9921. a.prototype._setStates = function (b) {
  9922. b || (b = []);
  9923. if ("string" == typeof b[0])
  9924. for (var a = b.length, c = 0; c < a; c++) {
  9925. var d = new e.State(b[c], []);
  9926. b[c] = d
  9927. }
  9928. this._states = b;
  9929. this.currentStateChanged = !0;
  9930. this.requestedCurrentState = this._currentState;
  9931. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  9932. };
  9933. Object.defineProperty(a.prototype, "currentState", {
  9934. get : function () {
  9935. return this.currentStateChanged ? this.requestedCurrentState : this._currentState ? this._currentState :
  9936. this.getDefaultState()
  9937. },
  9938. set : function (b) {
  9939. b || (b = this.getDefaultState());
  9940. b != this.currentState && b && this.currentState && (this.requestedCurrentState = b, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  9941. },
  9942. enumerable : !0,
  9943. configurable : !0
  9944. });
  9945. a.prototype.hasState = function (b) {
  9946. return null != this.getState(b)
  9947. };
  9948. a.prototype.getDefaultState = function () {
  9949. return 0 < this._states.length ? this._states[0].name : null
  9950. };
  9951. a.prototype.commitCurrentState = function () {
  9952. if (this.currentStateChanged) {
  9953. this.currentStateChanged =
  9954. !1;
  9955. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  9956. var b = this._currentState ? this._currentState : "";
  9957. this.hasEventListener(e.StateChangeEvent.CURRENT_STATE_CHANGING) && e.StateChangeEvent.dispatchStateChangeEvent(this, e.StateChangeEvent.CURRENT_STATE_CHANGING, b, this.requestedCurrentState ? this.requestedCurrentState : "");
  9958. this.removeState(this._currentState);
  9959. (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  9960. this.hasEventListener(e.StateChangeEvent.CURRENT_STATE_CHANGE) &&
  9961. e.StateChangeEvent.dispatchStateChangeEvent(this, e.StateChangeEvent.CURRENT_STATE_CHANGE, b, this._currentState ? this._currentState : "")
  9962. }
  9963. };
  9964. a.prototype.getState = function (b) {
  9965. if (!b)
  9966. return null;
  9967. for (var a = this._states, c = a.length, d = 0; d < c; d++) {
  9968. var e = a[d];
  9969. if (e.name == b)
  9970. return e
  9971. }
  9972. return null
  9973. };
  9974. a.prototype.removeState = function (b) {
  9975. if (b = this.getState(b)) {
  9976. b = b.overrides;
  9977. for (var a = b.length - 1; 0 <= a; a--)
  9978. b[a].remove(this)
  9979. }
  9980. };
  9981. a.prototype.applyState = function (b) {
  9982. if (b = this.getState(b)) {
  9983. b = b.overrides;
  9984. for (var a = b.length, c = 0; c < a; c++)
  9985. b[c].apply(this)
  9986. }
  9987. };
  9988. a.prototype.initializeStates = function () {
  9989. if (!this.initialized) {
  9990. this.initialized = !0;
  9991. for (var b = this._states, a = b.length, c = 0; c < a; c++)
  9992. b[c].initialize(this)
  9993. }
  9994. };
  9995. return a
  9996. }
  9997. (d.EventDispatcher);
  9998. e.Skin = f;
  9999. f.prototype.__class__ = "egret.gui.Skin"
  10000. })(d.gui || (d.gui = {}))
  10001. })(egret || (egret = {}));
  10002. __extends = this.__extends || function (d, e) {
  10003. function f() {
  10004. this.constructor = d
  10005. }
  10006. for (var c in e)
  10007. e.hasOwnProperty(c) && (d[c] = e[c]);
  10008. f.prototype = e.prototype;
  10009. d.prototype = new f
  10010. };
  10011. (function (d) {
  10012. (function (e) {
  10013. var f = function (c) {
  10014. function a() {
  10015. c.call(this);
  10016. this.useVirtualLayoutChanged = !1;
  10017. this.rendererToClassMap = [];
  10018. this.freeRenderers = [];
  10019. this.dataProviderChanged = this.createNewRendererFlag = !1;
  10020. this.recyclerDic = [];
  10021. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  10022. this.indexToRenderer = [];
  10023. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  10024. }
  10025. __extends(a, c);
  10026. Object.defineProperty(a.prototype, "layout", {
  10027. get : function () {
  10028. return this._layout
  10029. },
  10030. set : function (b) {
  10031. b !=
  10032. this.layout && (this.layout && (this.layout.typicalLayoutRect = null, this.layout.removeEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)), this.layout && b && this.layout.useVirtualLayout != b.useVirtualLayout && this.changeUseVirtualLayout(), this._setLayout(b), b && (b.typicalLayoutRect = this.typicalLayoutRect, b.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)))
  10033. },
  10034. enumerable : !0,
  10035. configurable : !0
  10036. });
  10037. a.prototype.layout_useVirtualLayoutChangedHandler =
  10038. function (b) {
  10039. this.changeUseVirtualLayout()
  10040. };
  10041. a.prototype.setVirtualElementIndicesInView = function (b, a) {
  10042. if (this.layout && this.layout.useVirtualLayout) {
  10043. this.virtualRendererIndices = [];
  10044. for (var c = b; c <= a; c++)
  10045. this.virtualRendererIndices.push(c);
  10046. for (var d in this.indexToRenderer)
  10047. d = parseInt(d), -1 == this.virtualRendererIndices.indexOf(d) && this.freeRendererByIndex(d)
  10048. }
  10049. };
  10050. a.prototype.getVirtualElementAt = function (b) {
  10051. if (0 > b || b >= this.dataProvider.length)
  10052. return null;
  10053. var a = this.indexToRenderer[b];
  10054. if (!a) {
  10055. var a = this.dataProvider.getItemAt(b),
  10056. c = this.createVirtualRenderer(b);
  10057. this.indexToRenderer[b] = c;
  10058. this.updateRenderer(c, b, a);
  10059. this.createNewRendererFlag && ("validateNow" in c && c.validateNow(), this.createNewRendererFlag = !1, e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_ADD, c, b, a));
  10060. a = c
  10061. }
  10062. return a
  10063. };
  10064. a.prototype.freeRendererByIndex = function (b) {
  10065. if (this.indexToRenderer[b]) {
  10066. var a = this.indexToRenderer[b];
  10067. delete this.indexToRenderer[b];
  10068. a && a instanceof d.DisplayObject && this.doFreeRenderer(a)
  10069. }
  10070. };
  10071. a.prototype.doFreeRenderer =
  10072. function (b) {
  10073. var a = this.rendererToClassMap[b.hashCode].hashCode;
  10074. this.freeRenderers[a] || (this.freeRenderers[a] = []);
  10075. this.freeRenderers[a].push(b);
  10076. b.visible = !1
  10077. };
  10078. a.prototype.invalidateSize = function () {
  10079. this.createNewRendererFlag || c.prototype.invalidateSize.call(this)
  10080. };
  10081. a.prototype.createVirtualRenderer = function (b) {
  10082. b = this.dataProvider.getItemAt(b);
  10083. b = this.itemToRendererClass(b);
  10084. var a = b.hashCode,
  10085. c = this.freeRenderers;
  10086. if (c[a] && 0 < c[a].length)
  10087. return b = c[a].pop(), b.visible = !0, b;
  10088. this.createNewRendererFlag = !0;
  10089. return this.createOneRenderer(b)
  10090. };
  10091. a.prototype.createOneRenderer = function (b) {
  10092. var a,
  10093. c = b.hashCode,
  10094. e = this.recyclerDic[c];
  10095. e && (a = e.pop(), 0 == e.length && delete this.recyclerDic[c]);
  10096. a || (a = b.newInstance(), this.rendererToClassMap[a.hashCode] = b);
  10097. if (!(a && a instanceof d.DisplayObject))
  10098. return null;
  10099. this._itemRendererSkinName && this.setItemRenderSkinName(a);
  10100. this._addToDisplayList(a);
  10101. a.setLayoutBoundsSize(NaN, NaN);
  10102. return a
  10103. };
  10104. a.prototype.setItemRenderSkinName = function (b) {
  10105. b && (b ? b._skinNameExplicitlySet || (b.skinName = this._itemRendererSkinName) : b && !b.skinName &&
  10106. (b.skinName = this._itemRendererSkinName))
  10107. };
  10108. a.prototype.finishVirtualLayout = function () {
  10109. if (this.virtualLayoutUnderway) {
  10110. var b = this.virtualLayoutUnderway = !1,
  10111. a;
  10112. for (a in this.freeRenderers)
  10113. if (0 < this.freeRenderers[a].length) {
  10114. b = !0;
  10115. break
  10116. }
  10117. b && (this.cleanTimer || (this.cleanTimer = new d.Timer(3E3, 1), this.cleanTimer.addEventListener(d.TimerEvent.TIMER, this.cleanAllFreeRenderer, this)), this.cleanTimer.reset(), this.cleanTimer.start())
  10118. }
  10119. };
  10120. a.prototype.cleanAllFreeRenderer = function (b) {
  10121. var a = this.freeRenderers,
  10122. c;
  10123. for (c in a)
  10124. for (var d =
  10125. a[c], e = d.length, f = 0; f < e; f++)
  10126. b = d[f], b.visible = !0, this.recycle(b);
  10127. this.freeRenderers = [];
  10128. this.cleanFreeRenderer = !1
  10129. };
  10130. a.prototype.getElementIndicesInView = function () {
  10131. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices : [] : c.prototype.getElementIndicesInView.call(this)
  10132. };
  10133. a.prototype.changeUseVirtualLayout = function () {
  10134. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  10135. this.removeDataProviderListener();
  10136. this.invalidateProperties()
  10137. };
  10138. Object.defineProperty(a.prototype,
  10139. "dataProvider", {
  10140. get : function () {
  10141. return this._dataProvider
  10142. },
  10143. set : function (b) {
  10144. this._dataProvider != b && (this.removeDataProviderListener(), this._dataProvider = b, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  10145. },
  10146. enumerable : !0,
  10147. configurable : !0
  10148. });
  10149. a.prototype.removeDataProviderListener = function () {
  10150. this._dataProvider && this._dataProvider.removeEventListener(e.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  10151. };
  10152. a.prototype.onCollectionChange =
  10153. function (b) {
  10154. switch (b.kind) {
  10155. case e.CollectionEventKind.ADD:
  10156. this.itemAddedHandler(b.items, b.location);
  10157. break;
  10158. case e.CollectionEventKind.MOVE:
  10159. this.itemMovedHandler(b.items[0], b.location, b.oldLocation);
  10160. break;
  10161. case e.CollectionEventKind.REMOVE:
  10162. this.itemRemovedHandler(b.items, b.location);
  10163. break;
  10164. case e.CollectionEventKind.UPDATE:
  10165. this.itemUpdatedHandler(b.items[0], b.location);
  10166. break;
  10167. case e.CollectionEventKind.REPLACE:
  10168. this.itemRemoved(b.oldItems[0], b.location);
  10169. this.itemAdded(b.items[0], b.location);
  10170. break;
  10171. case e.CollectionEventKind.RESET:
  10172. case e.CollectionEventKind.REFRESH:
  10173. if (this.layout &&
  10174. this.layout.useVirtualLayout)
  10175. for (var a in this.indexToRenderer)
  10176. a = parseInt(a), this.freeRendererByIndex(a);
  10177. this.dataProviderChanged = !0;
  10178. this.invalidateProperties()
  10179. }
  10180. this.invalidateSize();
  10181. this.invalidateDisplayList()
  10182. };
  10183. a.prototype.itemAddedHandler = function (b, a) {
  10184. for (var c = b.length, d = 0; d < c; d++)
  10185. this.itemAdded(b[d], a + d);
  10186. this.resetRenderersIndices()
  10187. };
  10188. a.prototype.itemMovedHandler = function (b, a, c) {
  10189. this.itemRemoved(b, c);
  10190. this.itemAdded(b, a);
  10191. this.resetRenderersIndices()
  10192. };
  10193. a.prototype.itemRemovedHandler = function (b,
  10194. a) {
  10195. for (var c = b.length - 1; 0 <= c; c--)
  10196. this.itemRemoved(b[c], a + c);
  10197. this.resetRenderersIndices()
  10198. };
  10199. a.prototype.itemAdded = function (b, a) {
  10200. this.layout && this.layout.elementAdded(a);
  10201. if (this.layout && this.layout.useVirtualLayout) {
  10202. var c = this.virtualRendererIndices;
  10203. if (c) {
  10204. for (var d = c.length, f = 0; f < d; f++) {
  10205. var g = c[f];
  10206. g >= a && (c[f] = g + 1)
  10207. }
  10208. this.indexToRenderer.splice(a, 0, null)
  10209. }
  10210. } else
  10211. c = this.itemToRendererClass(b), c = this.createOneRenderer(c), this.indexToRenderer.splice(a, 0, c), c && (this.updateRenderer(c, a, b), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this,
  10212. e.RendererExistenceEvent.RENDERER_ADD, c, a, b))
  10213. };
  10214. a.prototype.itemRemoved = function (b, a) {
  10215. this.layout && this.layout.elementRemoved(a);
  10216. var c = this.virtualRendererIndices;
  10217. if (c && 0 < c.length) {
  10218. for (var f = -1, h = c.length, g = 0; g < h; g++) {
  10219. var l = c[g];
  10220. l == a ? f = g : l > a && (c[g] = l - 1)
  10221. }
  10222. -1 != f && c.splice(f, 1)
  10223. }
  10224. c = this.indexToRenderer[a];
  10225. this.indexToRenderer.length > a && this.indexToRenderer.splice(a, 1);
  10226. e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_REMOVE, c, a, b);
  10227. c && c instanceof d.DisplayObject &&
  10228. this.recycle(c)
  10229. };
  10230. a.prototype.recycle = function (b) {
  10231. this._removeFromDisplayList(b);
  10232. "ownerChanged" in b && b.ownerChanged(null);
  10233. var a = this.rendererToClassMap[b.hashCode].hashCode;
  10234. this.recyclerDic[a] || (this.recyclerDic[a] = new d.Recycler);
  10235. this.recyclerDic[a].push(b)
  10236. };
  10237. a.prototype.resetRenderersIndices = function () {
  10238. if (0 != this.indexToRenderer.length)
  10239. if (this.layout && this.layout.useVirtualLayout)
  10240. for (var b = this.virtualRendererIndices, a = b.length, c = 0; c < a; c++) {
  10241. var d = b[c];
  10242. this.resetRendererItemIndex(d)
  10243. }
  10244. else
  10245. for (b = this.indexToRenderer.length,
  10246. d = 0; d < b; d++)
  10247. this.resetRendererItemIndex(d)
  10248. };
  10249. a.prototype.itemUpdatedHandler = function (b, a) {
  10250. if (!this.renderersBeingUpdated) {
  10251. var c = this.indexToRenderer[a];
  10252. c && this.updateRenderer(c, a, b)
  10253. }
  10254. };
  10255. a.prototype.resetRendererItemIndex = function (b) {
  10256. var a = this.indexToRenderer[b];
  10257. a && (a.itemIndex = b)
  10258. };
  10259. Object.defineProperty(a.prototype, "itemRenderer", {
  10260. get : function () {
  10261. return this._itemRenderer
  10262. },
  10263. set : function (b) {
  10264. this._itemRenderer !== b && (this._itemRenderer = b, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged =
  10265. !0, this.removeDataProviderListener(), this.invalidateProperties())
  10266. },
  10267. enumerable : !0,
  10268. configurable : !0
  10269. });
  10270. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  10271. get : function () {
  10272. return this._itemRendererSkinName
  10273. },
  10274. set : function (b) {
  10275. this._itemRendererSkinName != b && (this._itemRendererSkinName = b) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  10276. },
  10277. enumerable : !0,
  10278. configurable : !0
  10279. });
  10280. Object.defineProperty(a.prototype, "itemRendererFunction", {
  10281. get : function () {
  10282. return this._itemRendererFunction
  10283. },
  10284. set : function (b) {
  10285. this._itemRendererFunction != b && (this._itemRendererFunction = b, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  10286. },
  10287. enumerable : !0,
  10288. configurable : !0
  10289. });
  10290. a.prototype.itemToRendererClass = function (b) {
  10291. null != this._itemRendererFunction ? (b = this._itemRendererFunction(b), b || (b = this._itemRenderer)) : b = this._itemRenderer;
  10292. return b ? b : a.defaultRendererFactory
  10293. };
  10294. a.prototype.createChildren = function () {
  10295. if (!this.layout) {
  10296. var b = new e.VerticalLayout;
  10297. b.gap = 0;
  10298. b.horizontalAlign = d.HorizontalAlign.CONTENT_JUSTIFY;
  10299. this.layout = b
  10300. }
  10301. c.prototype.createChildren.call(this)
  10302. };
  10303. a.prototype.commitProperties = function () {
  10304. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged)
  10305. this.removeAllRenderers(), this.layout && this.layout.clearVirtualLayoutCache(), this.setTypicalLayoutRect(null), this.itemRendererChanged = this.useVirtualLayoutChanged = !1, this._dataProvider && this._dataProvider.addEventListener(e.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange,
  10306. this), this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(), this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  10307. c.prototype.commitProperties.call(this);
  10308. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  10309. if (this.itemRendererSkinNameChange) {
  10310. this.itemRendererSkinNameChange =
  10311. !1;
  10312. for (var b = this.indexToRenderer.length, a = 0; a < b; a++)
  10313. this.setItemRenderSkinName(this.indexToRenderer[a]);
  10314. var d = this.freeRenderers,
  10315. f;
  10316. for (f in d) {
  10317. var h = d[f];
  10318. if (h)
  10319. for (b = h.length, a = 0; a < b; a++)
  10320. this.setItemRenderSkinName(h[a])
  10321. }
  10322. }
  10323. };
  10324. a.prototype.measure = function () {
  10325. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  10326. c.prototype.measure.call(this)
  10327. };
  10328. a.prototype.updateDisplayList = function (b, a) {
  10329. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway =
  10330. !0, this.ensureTypicalLayoutElement());
  10331. c.prototype.updateDisplayList.call(this, b, a);
  10332. this.virtualLayoutUnderway && this.finishVirtualLayout()
  10333. };
  10334. a.prototype.ensureTypicalLayoutElement = function () {
  10335. !this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  10336. };
  10337. a.prototype.measureRendererSize = function () {
  10338. if (this.typicalItem) {
  10339. var b = this.itemToRendererClass(this.typicalItem);
  10340. if (b = this.createOneRenderer(b)) {
  10341. this.createNewRendererFlag =
  10342. !0;
  10343. this.updateRenderer(b, 0, this.typicalItem);
  10344. "validateNow" in b && b.validateNow();
  10345. var a = new d.Rectangle(0, 0, b.preferredWidth, b.preferredHeight);
  10346. this.recycle(b);
  10347. this.setTypicalLayoutRect(a);
  10348. this.createNewRendererFlag = !1
  10349. } else
  10350. this.setTypicalLayoutRect(null)
  10351. } else
  10352. this.setTypicalLayoutRect(null)
  10353. };
  10354. a.prototype.setTypicalLayoutRect = function (b) {
  10355. this.typicalLayoutRect = b;
  10356. this.layout && (this.layout.typicalLayoutRect = b)
  10357. };
  10358. a.prototype.removeAllRenderers = function () {
  10359. for (var b = this.indexToRenderer.length, a, c = 0; c < b; c++)
  10360. if (a =
  10361. this.indexToRenderer[c])
  10362. this.recycle(a), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_REMOVE, a, a.itemIndex, a.data);
  10363. this.indexToRenderer = [];
  10364. this.virtualRendererIndices = null;
  10365. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  10366. };
  10367. a.prototype.createRenderers = function () {
  10368. if (this._dataProvider)
  10369. for (var b = 0, a = this._dataProvider.length, c = 0; c < a; c++) {
  10370. var d = this._dataProvider.getItemAt(c),
  10371. f = this.itemToRendererClass(d);
  10372. if (f = this.createOneRenderer(f))
  10373. this.indexToRenderer[b] =
  10374. f, this.updateRenderer(f, b, d), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_ADD, f, b, d), b++
  10375. }
  10376. };
  10377. a.prototype.updateRenderer = function (b, a, c) {
  10378. this.renderersBeingUpdated = !0;
  10379. this._rendererOwner ? b = this._rendererOwner.updateRenderer(b, a, c) : ("ownerChanged" in b && b.ownerChanged(this), b.itemIndex = a, b.label = this.itemToLabel(c), b.data = c);
  10380. this.renderersBeingUpdated = !1;
  10381. return b
  10382. };
  10383. a.prototype.itemToLabel = function (b) {
  10384. return b ? b.toString() : " "
  10385. };
  10386. a.prototype.getElementAt = function (b) {
  10387. return this.indexToRenderer[b]
  10388. };
  10389. a.prototype.getElementIndex = function (b) {
  10390. return b ? this.indexToRenderer.indexOf(b) : -1
  10391. };
  10392. Object.defineProperty(a.prototype, "numElements", {
  10393. get : function () {
  10394. return this._dataProvider ? this._dataProvider.length : 0
  10395. },
  10396. enumerable : !0,
  10397. configurable : !0
  10398. });
  10399. a.prototype.addChild = function (b) {
  10400. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  10401. };
  10402. a.prototype.addChildAt = function (b, c) {
  10403. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  10404. };
  10405. a.prototype.removeChild = function (b) {
  10406. throw Error("removeChild()" +
  10407. a.errorStr + "removeElement()\u4ee3\u66ff");
  10408. };
  10409. a.prototype.removeChildAt = function (b) {
  10410. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  10411. };
  10412. a.prototype.setChildIndex = function (b, c) {
  10413. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  10414. };
  10415. a.prototype.swapChildren = function (b, c) {
  10416. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  10417. };
  10418. a.prototype.swapChildrenAt = function (b, c) {
  10419. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  10420. };
  10421. a.defaultRendererFactory = new e.ClassFactory(e.ItemRenderer);
  10422. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  10423. return a
  10424. }
  10425. (e.GroupBase);
  10426. e.DataGroup = f;
  10427. f.prototype.__class__ = "egret.gui.DataGroup"
  10428. })(d.gui || (d.gui = {}))
  10429. })(egret || (egret = {}));
  10430. __extends = this.__extends || function (d, e) {
  10431. function f() {
  10432. this.constructor = d
  10433. }
  10434. for (var c in e)
  10435. e.hasOwnProperty(c) && (d[c] = e[c]);
  10436. f.prototype = e.prototype;
  10437. d.prototype = new f
  10438. };
  10439. (function (d) {
  10440. (function (d) {
  10441. var f = function (c) {
  10442. function a() {
  10443. c.call(this);
  10444. this.contentGroupProperties = {};
  10445. this.hostComponentKey = "egret.gui.SkinnableContainer"
  10446. }
  10447. __extends(a, c);
  10448. a.prototype._getCurrentContentGroup = function () {
  10449. return null == this.contentGroup ? (null == this._placeHolderGroup && (this._placeHolderGroup = new d.Group, this._placeHolderGroup.visible = !1, this._addToDisplayList(this._placeHolderGroup)), this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler,
  10450. this), this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this._placeHolderGroup) : this.contentGroup
  10451. };
  10452. Object.defineProperty(a.prototype, "elementsContent", {
  10453. set : function (b) {
  10454. this._getCurrentContentGroup().elementsContent = b
  10455. },
  10456. enumerable : !0,
  10457. configurable : !0
  10458. });
  10459. Object.defineProperty(a.prototype, "numElements", {
  10460. get : function () {
  10461. return this._getCurrentContentGroup().numElements
  10462. },
  10463. enumerable : !0,
  10464. configurable : !0
  10465. });
  10466. a.prototype.getElementAt = function (b) {
  10467. return this._getCurrentContentGroup().getElementAt(b)
  10468. };
  10469. a.prototype.addElement = function (b) {
  10470. return this._getCurrentContentGroup().addElement(b)
  10471. };
  10472. a.prototype.addElementAt = function (b, a) {
  10473. return this._getCurrentContentGroup().addElementAt(b, a)
  10474. };
  10475. a.prototype.removeElement = function (b) {
  10476. return this._getCurrentContentGroup().removeElement(b)
  10477. };
  10478. a.prototype.removeElementAt = function (b) {
  10479. return this._getCurrentContentGroup().removeElementAt(b)
  10480. };
  10481. a.prototype.removeAllElements = function () {
  10482. this._getCurrentContentGroup().removeAllElements()
  10483. };
  10484. a.prototype.getElementIndex = function (b) {
  10485. return this._getCurrentContentGroup().getElementIndex(b)
  10486. };
  10487. a.prototype.setElementIndex = function (b, a) {
  10488. this._getCurrentContentGroup().setElementIndex(b, a)
  10489. };
  10490. a.prototype.swapElements = function (b, a) {
  10491. this._getCurrentContentGroup().swapElements(b, a)
  10492. };
  10493. a.prototype.swapElementsAt = function (b, a) {
  10494. this._getCurrentContentGroup().swapElementsAt(b, a)
  10495. };
  10496. Object.defineProperty(a.prototype, "layout", {
  10497. get : function () {
  10498. return null != this.contentGroup ? this.contentGroup.layout : this.contentGroupProperties.layout
  10499. },
  10500. set : function (b) {
  10501. null != this.contentGroup ? this.contentGroup.layout = b : this.contentGroupProperties.layout =
  10502. b
  10503. },
  10504. enumerable : !0,
  10505. configurable : !0
  10506. });
  10507. a.prototype.partAdded = function (b, a) {
  10508. c.prototype.partAdded.call(this, b, a);
  10509. if (a == this.contentGroup) {
  10510. void 0 !== this.contentGroupProperties.layout && (this.contentGroup.layout = this.contentGroupProperties.layout, this.contentGroupProperties = {});
  10511. if (this._placeHolderGroup) {
  10512. this._placeHolderGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  10513. this._placeHolderGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,
  10514. this._contentGroup_elementRemovedHandler, this);
  10515. for (var f = this._placeHolderGroup._getElementsContent().concat(), y = this._placeHolderGroup.numElements; 0 < y; y--) {
  10516. var h = this._placeHolderGroup.removeElementAt(0);
  10517. h.ownerChanged(null)
  10518. }
  10519. this._removeFromDisplayList(this._placeHolderGroup);
  10520. this.contentGroup.elementsContent = f;
  10521. for (y = f.length - 1; 0 <= y; y--)
  10522. h = f[y], h.ownerChanged(this);
  10523. this._placeHolderGroup = null
  10524. }
  10525. this.contentGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler,
  10526. this);
  10527. this.contentGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  10528. }
  10529. };
  10530. a.prototype.partRemoved = function (b, a) {
  10531. c.prototype.partRemoved.call(this, b, a);
  10532. if (a == this.contentGroup && (this.contentGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this.contentGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this.contentGroupProperties.layout =
  10533. this.contentGroup.layout, this.contentGroup.layout = null, 0 < this.contentGroup.numElements)) {
  10534. for (this._placeHolderGroup = new d.Group; 0 < this.contentGroup.numElements; )
  10535. this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));
  10536. this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  10537. this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  10538. }
  10539. };
  10540. a.prototype._contentGroup_elementAddedHandler =
  10541. function (b) {
  10542. b.element.ownerChanged(this);
  10543. this.dispatchEvent(b)
  10544. };
  10545. a.prototype._contentGroup_elementRemovedHandler = function (b) {
  10546. b.element.ownerChanged(null);
  10547. this.dispatchEvent(b)
  10548. };
  10549. return a
  10550. }
  10551. (d.SkinnableComponent);
  10552. d.SkinnableContainer = f;
  10553. f.prototype.__class__ = "egret.gui.SkinnableContainer"
  10554. })(d.gui || (d.gui = {}))
  10555. })(egret || (egret = {}));
  10556. __extends = this.__extends || function (d, e) {
  10557. function f() {
  10558. this.constructor = d
  10559. }
  10560. for (var c in e)
  10561. e.hasOwnProperty(c) && (d[c] = e[c]);
  10562. f.prototype = e.prototype;
  10563. d.prototype = new f
  10564. };
  10565. (function (d) {
  10566. (function (d) {
  10567. var f = function (c) {
  10568. function a() {
  10569. c.call(this);
  10570. this._dataGroupProperties = {};
  10571. this.hostComponentKey = "egret.gui.SkinnableDataContainer"
  10572. }
  10573. __extends(a, c);
  10574. a.prototype.updateRenderer = function (b, a, c) {
  10575. "ownerChanged" in b && b.ownerChanged(this);
  10576. b.itemIndex = a;
  10577. b.label = this.itemToLabel(c);
  10578. b.data = c;
  10579. return b
  10580. };
  10581. a.prototype.itemToLabel = function (b) {
  10582. return null !== b ? b.toString() : " "
  10583. };
  10584. Object.defineProperty(a.prototype, "dataProvider", {
  10585. get : function () {
  10586. return this._getDataProvider()
  10587. },
  10588. set : function (b) {
  10589. this._setDataProvider(b)
  10590. },
  10591. enumerable : !0,
  10592. configurable : !0
  10593. });
  10594. a.prototype._getDataProvider = function () {
  10595. return null != this.dataGroup ? this.dataGroup.dataProvider : this._dataGroupProperties.dataProvider
  10596. };
  10597. a.prototype._setDataProvider = function (b) {
  10598. null == this.dataGroup ? this._dataGroupProperties.dataProvider = b : (this.dataGroup.dataProvider = b, this._dataGroupProperties.dataProvider = !0)
  10599. };
  10600. Object.defineProperty(a.prototype, "itemRenderer", {
  10601. get : function () {
  10602. return this.dataGroup ? this.dataGroup.itemRenderer : this._dataGroupProperties.itemRenderer
  10603. },
  10604. set : function (b) {
  10605. null == this.dataGroup ? this._dataGroupProperties.itemRenderer = b : (this.dataGroup.itemRenderer = b, this._dataGroupProperties.itemRenderer = !0)
  10606. },
  10607. enumerable : !0,
  10608. configurable : !0
  10609. });
  10610. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  10611. get : function () {
  10612. return this.dataGroup ? this.dataGroup.itemRendererSkinName : this._dataGroupProperties.itemRendererSkinName
  10613. },
  10614. set : function (b) {
  10615. null == this.dataGroup ? this._dataGroupProperties.itemRendererSkinName = b : (this.dataGroup.itemRendererSkinName = b, this._dataGroupProperties.itemRendererSkinName =
  10616. !0)
  10617. },
  10618. enumerable : !0,
  10619. configurable : !0
  10620. });
  10621. Object.defineProperty(a.prototype, "itemRendererFunction", {
  10622. get : function () {
  10623. return this.dataGroup ? this.dataGroup.itemRendererFunction : this._dataGroupProperties.itemRendererFunction
  10624. },
  10625. set : function (b) {
  10626. null == this.dataGroup ? this._dataGroupProperties.itemRendererFunction = b : (this.dataGroup.itemRendererFunction = b, this._dataGroupProperties.itemRendererFunction = !0)
  10627. },
  10628. enumerable : !0,
  10629. configurable : !0
  10630. });
  10631. Object.defineProperty(a.prototype, "layout", {
  10632. get : function () {
  10633. return this.dataGroup ?
  10634. this.dataGroup.layout : this._dataGroupProperties.layout
  10635. },
  10636. set : function (b) {
  10637. this._setLayout(b)
  10638. },
  10639. enumerable : !0,
  10640. configurable : !0
  10641. });
  10642. a.prototype._setLayout = function (b) {
  10643. null == this.dataGroup ? this._dataGroupProperties.layout = b : (this.dataGroup.layout = b, this._dataGroupProperties.layout = !0)
  10644. };
  10645. a.prototype.partAdded = function (b, a) {
  10646. c.prototype.partAdded.call(this, b, a);
  10647. if (a == this.dataGroup) {
  10648. var f = {};
  10649. void 0 !== this._dataGroupProperties.layout && (this.dataGroup.layout = this._dataGroupProperties.layout, f.layout = !0);
  10650. void 0 !==
  10651. this._dataGroupProperties.dataProvider && (this.dataGroup.dataProvider = this._dataGroupProperties.dataProvider, f.dataProvider = !0);
  10652. void 0 !== this._dataGroupProperties.itemRenderer && (this.dataGroup.itemRenderer = this._dataGroupProperties.itemRenderer, f.itemRenderer = !0);
  10653. void 0 !== this._dataGroupProperties.itemRendererSkinName && (this.dataGroup.itemRendererSkinName = this._dataGroupProperties.itemRendererSkinName, f.itemRendererSkinName = !0);
  10654. void 0 !== this._dataGroupProperties.itemRendererFunction && (this.dataGroup.itemRendererFunction =
  10655. this._dataGroupProperties.itemRendererFunction, f.itemRendererFunction = !0);
  10656. this.dataGroup._rendererOwner = this;
  10657. this._dataGroupProperties = f;
  10658. this.hasEventListener(d.RendererExistenceEvent.RENDERER_ADD) && this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10659. this.hasEventListener(d.RendererExistenceEvent.RENDERER_REMOVE) && this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10660. }
  10661. };
  10662. a.prototype.partRemoved = function (b, a) {
  10663. c.prototype.partRemoved.call(this,
  10664. b, a);
  10665. if (a == this.dataGroup) {
  10666. this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10667. this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this);
  10668. var f = {};
  10669. this._dataGroupProperties.layout && (f.layout = this.dataGroup.layout);
  10670. this._dataGroupProperties.dataProvider && (f.dataProvider = this.dataGroup.dataProvider);
  10671. this._dataGroupProperties.itemRenderer && (f.itemRenderer = this.dataGroup.itemRenderer);
  10672. this._dataGroupProperties.itemRendererSkinName &&
  10673. (f.itemRendererSkinName = this.dataGroup.itemRendererSkinName);
  10674. this._dataGroupProperties.itemRendererFunction && (f.itemRendererFunction = this.dataGroup.itemRendererFunction);
  10675. this._dataGroupProperties = f;
  10676. this.dataGroup._rendererOwner = null;
  10677. this.dataGroup.dataProvider = null;
  10678. this.dataGroup.layout = null
  10679. }
  10680. };
  10681. a.prototype.addEventListener = function (b, a, f, y, h) {
  10682. "undefined" === typeof y && (y = !1);
  10683. "undefined" === typeof h && (h = 0);
  10684. c.prototype.addEventListener.call(this, b, a, f, y, h);
  10685. b == d.RendererExistenceEvent.RENDERER_ADD && this.dataGroup &&
  10686. this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10687. b == d.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10688. };
  10689. a.prototype.removeEventListener = function (b, a, f, y) {
  10690. "undefined" === typeof y && (y = !1);
  10691. c.prototype.removeEventListener.call(this, b, a, f, y);
  10692. b == d.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && (this.hasEventListener(d.RendererExistenceEvent.RENDERER_ADD) ||
  10693. this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this));
  10694. b == d.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && (this.hasEventListener(d.RendererExistenceEvent.RENDERER_REMOVE) || this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this))
  10695. };
  10696. return a
  10697. }
  10698. (d.SkinnableComponent);
  10699. d.SkinnableDataContainer = f;
  10700. f.prototype.__class__ = "egret.gui.SkinnableDataContainer"
  10701. })(d.gui || (d.gui = {}))
  10702. })(egret || (egret = {}));
  10703. __extends = this.__extends || function (d, e) {
  10704. function f() {
  10705. this.constructor = d
  10706. }
  10707. for (var c in e)
  10708. e.hasOwnProperty(c) && (d[c] = e[c]);
  10709. f.prototype = e.prototype;
  10710. d.prototype = new f
  10711. };
  10712. (function (d) {
  10713. (function (e) {
  10714. var f = function (c) {
  10715. function a() {
  10716. c.call(this);
  10717. this._doingWholesaleChanges = !1;
  10718. this._labelField = "label";
  10719. this.requireSelectionChanged = this._requireSelection = !1;
  10720. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10721. this._selectedIndex = a.NO_SELECTION;
  10722. this.selectedIndexAdjusted = this._useVirtualLayout = this._dispatchChangeAfterSelection = this._allowCustomSelectedItem = !1
  10723. }
  10724. __extends(a, c);
  10725. a.prototype._setDataProvider = function (b) {
  10726. this.dataProvider && this.dataProvider.removeEventListener(e.CollectionEvent.COLLECTION_CHANGE,
  10727. this.dataProvider_collectionChangeHandler, this);
  10728. this._doingWholesaleChanges = this.dataProviderChanged = !0;
  10729. b && b.addEventListener(e.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  10730. c.prototype._setDataProvider.call(this, b);
  10731. this.invalidateProperties()
  10732. };
  10733. Object.defineProperty(a.prototype, "layout", {
  10734. get : function () {
  10735. return this.dataGroup ? this.dataGroup.layout : this._dataGroupProperties.layout
  10736. },
  10737. set : function (b) {
  10738. b && this.useVirtualLayout && (b.useVirtualLayout = !0);
  10739. this._setLayout(b)
  10740. },
  10741. enumerable : !0,
  10742. configurable : !0
  10743. });
  10744. Object.defineProperty(a.prototype, "labelField", {
  10745. get : function () {
  10746. return this._labelField
  10747. },
  10748. set : function (b) {
  10749. this._setLabelField(b)
  10750. },
  10751. enumerable : !0,
  10752. configurable : !0
  10753. });
  10754. a.prototype._setLabelField = function (b) {
  10755. b != this._labelField && (this._labelField = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10756. };
  10757. Object.defineProperty(a.prototype, "labelFunction", {
  10758. get : function () {
  10759. return this._labelFunction
  10760. },
  10761. set : function (b) {
  10762. this._setLabelFunction(b)
  10763. },
  10764. enumerable : !0,
  10765. configurable : !0
  10766. });
  10767. a.prototype._setLabelFunction = function (b) {
  10768. b != this._labelFunction && (this._labelFunction = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10769. };
  10770. Object.defineProperty(a.prototype, "requireSelection", {
  10771. get : function () {
  10772. return this._requireSelection
  10773. },
  10774. set : function (b) {
  10775. this._setRequireSelection(b)
  10776. },
  10777. enumerable : !0,
  10778. configurable : !0
  10779. });
  10780. a.prototype._setRequireSelection = function (b) {
  10781. b != this._requireSelection && (this._requireSelection = b) && (this.requireSelectionChanged = !0, this.invalidateProperties())
  10782. };
  10783. Object.defineProperty(a.prototype,
  10784. "selectedIndex", {
  10785. get : function () {
  10786. return this._getSelectedIndex()
  10787. },
  10788. set : function (b) {
  10789. this._setSelectedIndex(b, !1)
  10790. },
  10791. enumerable : !0,
  10792. configurable : !0
  10793. });
  10794. a.prototype._getSelectedIndex = function () {
  10795. return this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex : this._selectedIndex
  10796. };
  10797. a.prototype._setSelectedIndex = function (b, a) {
  10798. "undefined" === typeof a && (a = !1);
  10799. b != this.selectedIndex && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._proposedSelectedIndex = b, this.invalidateProperties())
  10800. };
  10801. Object.defineProperty(a.prototype, "selectedItem", {
  10802. get : function () {
  10803. return void 0 !== this._pendingSelectedItem ? this._pendingSelectedItem : this._allowCustomSelectedItem && this.selectedIndex == a.CUSTOM_SELECTED_ITEM ? this._selectedItem : this.selectedIndex == a.NO_SELECTION || null == this.dataProvider ? void 0 : this.dataProvider.length > this.selectedIndex ? this.dataProvider.getItemAt(this.selectedIndex) : void 0
  10804. },
  10805. set : function (b) {
  10806. this._setSelectedItem(b, !1)
  10807. },
  10808. enumerable : !0,
  10809. configurable : !0
  10810. });
  10811. a.prototype._setSelectedItem = function (b,
  10812. a) {
  10813. "undefined" === typeof a && (a = !1);
  10814. this.selectedItem !== b && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._pendingSelectedItem = b, this.invalidateProperties())
  10815. };
  10816. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10817. get : function () {
  10818. return this._getUseVirtualLayout()
  10819. },
  10820. set : function (b) {
  10821. this._setUseVirtualLayout(b)
  10822. },
  10823. enumerable : !0,
  10824. configurable : !0
  10825. });
  10826. a.prototype._getUseVirtualLayout = function () {
  10827. return this.layout ? this.layout.useVirtualLayout : this._useVirtualLayout
  10828. };
  10829. a.prototype._setUseVirtualLayout =
  10830. function (b) {
  10831. b != this.useVirtualLayout && (this._useVirtualLayout = b, this.layout && (this.layout.useVirtualLayout = b))
  10832. };
  10833. a.prototype.commitProperties = function () {
  10834. c.prototype.commitProperties.call(this);
  10835. this.dataProviderChanged && (this._doingWholesaleChanges = this.dataProviderChanged = !1, 0 <= this.selectedIndex && this.dataProvider && this.selectedIndex < this.dataProvider.length ? this.itemSelected(this.selectedIndex, !0) : this.requireSelection ? this._proposedSelectedIndex = 0 : this._setSelectedIndex(-1, !1));
  10836. this.requireSelectionChanged &&
  10837. (this.requireSelectionChanged = !1, this.requireSelection && this.selectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length && (this._proposedSelectedIndex = 0));
  10838. void 0 !== this._pendingSelectedItem && (this._proposedSelectedIndex = this.dataProvider ? this.dataProvider.getItemIndex(this._pendingSelectedItem) : a.NO_SELECTION, this._allowCustomSelectedItem && -1 == this._proposedSelectedIndex && (this._proposedSelectedIndex = a.CUSTOM_SELECTED_ITEM, this._selectedItem = this._pendingSelectedItem), this._pendingSelectedItem =
  10839. void 0);
  10840. var b = !1;
  10841. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (b = this.commitSelection());
  10842. this.selectedIndexAdjusted && (this.selectedIndexAdjusted = !1, b || e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT));
  10843. if (this.labelFieldOrFunctionChanged) {
  10844. if (null != this.dataGroup)
  10845. if (this.layout && this.layout.useVirtualLayout)
  10846. for (var d = this.dataGroup.getElementIndicesInView(), f = d.length, y = 0; y < f; y++)
  10847. b = d[y], this.updateRendererLabelProperty(b);
  10848. else
  10849. for (d = this.dataGroup.numElements, b = 0; b < d; b++)
  10850. this.updateRendererLabelProperty(b);
  10851. this.labelFieldOrFunctionChanged = !1
  10852. }
  10853. };
  10854. a.prototype.updateRendererLabelProperty = function (b) {
  10855. if (b = this.dataGroup.getElementAt(b))
  10856. b.label = this.itemToLabel(b.data)
  10857. };
  10858. a.prototype.partAdded = function (b, a) {
  10859. c.prototype.partAdded.call(this, b, a);
  10860. a == this.dataGroup && (this._useVirtualLayout && this.dataGroup.layout && (this.dataGroup.layout.useVirtualLayout = !0), this.dataGroup.addEventListener(e.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.addEventListener(e.RendererExistenceEvent.RENDERER_REMOVE,
  10861. this.dataGroup_rendererRemoveHandler, this))
  10862. };
  10863. a.prototype.partRemoved = function (b, a) {
  10864. c.prototype.partRemoved.call(this, b, a);
  10865. a == this.dataGroup && (this.dataGroup.removeEventListener(e.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.removeEventListener(e.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10866. };
  10867. a.prototype.updateRenderer = function (b, a, d) {
  10868. this.itemSelected(a, this._isItemIndexSelected(a));
  10869. return c.prototype.updateRenderer.call(this,
  10870. b, a, d)
  10871. };
  10872. a.prototype.itemToLabel = function (b) {
  10873. if (null != this._labelFunction)
  10874. return this._labelFunction(b);
  10875. if ("string" == typeof b)
  10876. return b;
  10877. if (b instanceof d.XML)
  10878. try {
  10879. 0 != b[this.labelField].length() && (b = b[this.labelField])
  10880. } catch (a) {}
  10881. else if (b instanceof Object)
  10882. try {
  10883. null != b[this.labelField] && (b = b[this.labelField])
  10884. } catch (c) {}
  10885. if ("string" == typeof b)
  10886. return b;
  10887. try {
  10888. if (null !== b)
  10889. return b.toString()
  10890. } catch (e) {}
  10891. return " "
  10892. };
  10893. a.prototype.itemSelected = function (b, a) {
  10894. if (this.dataGroup) {
  10895. var c = this.dataGroup.getElementAt(b);
  10896. null !=
  10897. c && (c.selected = a)
  10898. }
  10899. };
  10900. a.prototype._isItemIndexSelected = function (b) {
  10901. return b == this.selectedIndex
  10902. };
  10903. a.prototype.commitSelection = function (b) {
  10904. "undefined" === typeof b && (b = !0);
  10905. var c = this.dataProvider ? this.dataProvider.length - 1 : -1,
  10906. d = this._selectedIndex;
  10907. if (!this._allowCustomSelectedItem || this._proposedSelectedIndex != a.CUSTOM_SELECTED_ITEM)
  10908. if (this._proposedSelectedIndex < a.NO_SELECTION && (this._proposedSelectedIndex = a.NO_SELECTION), this._proposedSelectedIndex > c && (this._proposedSelectedIndex = c), this.requireSelection &&
  10909. this._proposedSelectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length)
  10910. return this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection = !1;
  10911. c = this._proposedSelectedIndex;
  10912. if (this._dispatchChangeAfterSelection && !e.IndexChangeEvent.dispatchIndexChangeEvent(this, e.IndexChangeEvent.CHANGING, this._selectedIndex, this._proposedSelectedIndex, !0))
  10913. return this.itemSelected(this._proposedSelectedIndex, !1), this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection =
  10914. !1;
  10915. this._selectedIndex = c;
  10916. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10917. d != a.NO_SELECTION && this.itemSelected(d, !1);
  10918. this._selectedIndex != a.NO_SELECTION && this.itemSelected(this._selectedIndex, !0);
  10919. b && (this._dispatchChangeAfterSelection && (e.IndexChangeEvent.dispatchIndexChangeEvent(this, e.IndexChangeEvent.CHANGE, d, this._selectedIndex), this._dispatchChangeAfterSelection = !1), e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT));
  10920. return !0
  10921. };
  10922. a.prototype.adjustSelection = function (b, c) {
  10923. this._proposedSelectedIndex !=
  10924. a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex = b : this._selectedIndex = b;
  10925. this.selectedIndexAdjusted = !0;
  10926. this.invalidateProperties()
  10927. };
  10928. a.prototype.itemAdded = function (b) {
  10929. this._doingWholesaleChanges || (this.selectedIndex == a.NO_SELECTION ? this.requireSelection && this.adjustSelection(b, !0) : b <= this.selectedIndex && this.adjustSelection(this.selectedIndex + 1, !0))
  10930. };
  10931. a.prototype.itemRemoved = function (b) {
  10932. this.selectedIndex == a.NO_SELECTION || this._doingWholesaleChanges || (b == this.selectedIndex ? this.requireSelection &&
  10933. this.dataProvider && 0 < this.dataProvider.length ? 0 == b ? (this._proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this.adjustSelection(-1, !1) : b < this.selectedIndex && this.adjustSelection(this.selectedIndex - 1, !1))
  10934. };
  10935. a.prototype.dataGroup_rendererAddHandler = function (b) {
  10936. b = b.renderer;
  10937. null != b && (b.addEventListener(d.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.addEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10938. };
  10939. a.prototype.dataGroup_rendererRemoveHandler =
  10940. function (b) {
  10941. b = b.renderer;
  10942. null != b && (b.removeEventListener(d.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.removeEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10943. };
  10944. a.prototype.item_mouseEventHandler = function (b) {
  10945. var c = b.type,
  10946. c = a.TYPE_MAP[c];
  10947. this.hasEventListener(c) && this._dispatchListEvent(b, c, b.currentTarget)
  10948. };
  10949. a.prototype._dispatchListEvent = function (b, a, c) {
  10950. var d = -1,
  10951. d = c ? c.itemIndex : this.dataGroup.getElementIndex(b.currentTarget),
  10952. f = this.dataProvider.getItemAt(d);
  10953. e.ListEvent.dispatchListEvent(this, a, b, d, f, c)
  10954. };
  10955. a.prototype.dataProvider_collectionChangeHandler = function (b) {
  10956. var c = b.items;
  10957. if (b.kind == e.CollectionEventKind.ADD)
  10958. for (var c = c.length, d = 0; d < c; d++)
  10959. this.itemAdded(b.location + d);
  10960. else if (b.kind == e.CollectionEventKind.REMOVE)
  10961. for (c = c.length, d = c - 1; 0 <= d; d--)
  10962. this.itemRemoved(b.location + d);
  10963. else
  10964. b.kind == e.CollectionEventKind.MOVE ? (this.itemRemoved(b.oldLocation), this.itemAdded(b.location)) : b.kind == e.CollectionEventKind.RESET ? 0 == this.dataProvider.length ? this._setSelectedIndex(a.NO_SELECTION,
  10965. !1) : (this.dataProviderChanged = !0, this.invalidateProperties()) : b.kind == e.CollectionEventKind.REFRESH && this._setSelectedIndex(a.NO_SELECTION, !1)
  10966. };
  10967. a.NO_SELECTION = -1;
  10968. a.NO_PROPOSED_SELECTION = -2;
  10969. a.CUSTOM_SELECTED_ITEM = -3;
  10970. a.TYPE_MAP = {
  10971. rollOver : "itemRollOver",
  10972. rollOut : "itemRollOut"
  10973. };
  10974. return a
  10975. }
  10976. (e.SkinnableDataContainer);
  10977. e.ListBase = f;
  10978. f.prototype.__class__ = "egret.gui.ListBase"
  10979. })(d.gui || (d.gui = {}))
  10980. })(egret || (egret = {}));
  10981. __extends = this.__extends || function (d, e) {
  10982. function f() {
  10983. this.constructor = d
  10984. }
  10985. for (var c in e)
  10986. e.hasOwnProperty(c) && (d[c] = e[c]);
  10987. f.prototype = e.prototype;
  10988. d.prototype = new f
  10989. };
  10990. (function (d) {
  10991. (function (d) {
  10992. var f = function (c) {
  10993. function a() {
  10994. c.call(this);
  10995. this._title = "";
  10996. this.hostComponentKey = "egret.gui.Panel";
  10997. this.touchEnabled = !1
  10998. }
  10999. __extends(a, c);
  11000. Object.defineProperty(a.prototype, "title", {
  11001. get : function () {
  11002. return this._title
  11003. },
  11004. set : function (b) {
  11005. this._title = b;
  11006. this.titleDisplay && (this.titleDisplay.text = this.title)
  11007. },
  11008. enumerable : !0,
  11009. configurable : !0
  11010. });
  11011. a.prototype.partAdded = function (b, a) {
  11012. c.prototype.partAdded.call(this, b, a);
  11013. a == this.titleDisplay && (this.titleDisplay.text = this.title)
  11014. };
  11015. return a
  11016. }
  11017. (d.SkinnableContainer);
  11018. d.Panel = f;
  11019. f.prototype.__class__ = "egret.gui.Panel"
  11020. })(d.gui || (d.gui = {}))
  11021. })(egret || (egret = {}));
  11022. __extends = this.__extends || function (d, e) {
  11023. function f() {
  11024. this.constructor = d
  11025. }
  11026. for (var c in e)
  11027. e.hasOwnProperty(c) && (d[c] = e[c]);
  11028. f.prototype = e.prototype;
  11029. d.prototype = new f
  11030. };
  11031. (function (d) {
  11032. (function (e) {
  11033. var f = function (c) {
  11034. function a() {
  11035. c.call(this);
  11036. this._autoBackToStage = this._showCloseButton = !0;
  11037. this.hostComponentKey = "egret.gui.TitleWindow";
  11038. this.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.onWindowMouseDown, this, !0, 100)
  11039. }
  11040. __extends(a, c);
  11041. a.prototype.onWindowMouseDown = function (b) {
  11042. this.enabled && this.isPopUp && b.target != this.closeButton && e.PopUpManager.bringToFront(this)
  11043. };
  11044. Object.defineProperty(a.prototype, "showCloseButton", {
  11045. get : function () {
  11046. return this._showCloseButton
  11047. },
  11048. set : function (b) {
  11049. this._showCloseButton !=
  11050. b && (this._showCloseButton = b, this.closeButton && (this.closeButton.visible = this._showCloseButton))
  11051. },
  11052. enumerable : !0,
  11053. configurable : !0
  11054. });
  11055. Object.defineProperty(a.prototype, "autoBackToStage", {
  11056. get : function () {
  11057. return this._autoBackToStage
  11058. },
  11059. set : function (b) {
  11060. this._autoBackToStage = b
  11061. },
  11062. enumerable : !0,
  11063. configurable : !0
  11064. });
  11065. a.prototype.partAdded = function (b, a) {
  11066. c.prototype.partAdded.call(this, b, a);
  11067. a == this.moveArea ? this.moveArea.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton &&
  11068. (this.closeButton.addEventListener(d.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this), this.closeButton.visible = this._showCloseButton)
  11069. };
  11070. a.prototype.partRemoved = function (b, a) {
  11071. c.prototype.partRemoved.call(this, b, a);
  11072. a == this.moveArea ? this.moveArea.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && this.closeButton.removeEventListener(d.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this)
  11073. };
  11074. a.prototype.closeButton_clickHandler = function (b) {
  11075. e.CloseEvent.dispatchCloseEvent(this,
  11076. e.CloseEvent.CLOSE)
  11077. };
  11078. a.prototype.moveArea_mouseDownHandler = function (b) {
  11079. this.enabled && this.isPopUp && (b = this.globalToLocal(b.stageX, b.stageY, d.Point.identity), this._offsetPointX = b.x, this._offsetPointY = b.y, this._includeInLayout = !1, e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this), e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this), e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler,
  11080. this))
  11081. };
  11082. a.prototype.moveArea_mouseMoveHandler = function (b) {
  11083. b = this.globalToLocal(b.stageX, b.stageY, d.Point.identity);
  11084. this.x += b.x - this._offsetPointX;
  11085. this.y += b.y - this._offsetPointY
  11086. };
  11087. a.prototype.moveArea_mouseUpHandler = function (b) {
  11088. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this);
  11089. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this);
  11090. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler,
  11091. this);
  11092. this._autoBackToStage && this.adjustPosForStage();
  11093. e.LayoutUtil.adjustRelativeByXY(this);
  11094. this.includeInLayout = !0
  11095. };
  11096. a.prototype.adjustPosForStage = function () {
  11097. if (this.moveArea && this.stage) {
  11098. var b = this.moveArea.localToGlobal(0, 0),
  11099. a = b.x,
  11100. c = b.y;
  11101. 35 > b.x + this.moveArea.width && (a = 35 - this.moveArea.width);
  11102. b.x > this.stage.stageWidth - 20 && (a = this.stage.stageWidth - 20);
  11103. 20 > b.y + this.moveArea.height && (c = 20 - this.moveArea.height);
  11104. b.y > this.stage.stageHeight - 20 && (c = this.stage.stageHeight - 20);
  11105. this.x += a - b.x;
  11106. this.y += c - b.y
  11107. }
  11108. };
  11109. return a
  11110. }
  11111. (e.Panel);
  11112. e.TitleWindow = f;
  11113. f.prototype.__class__ = "egret.gui.TitleWindow"
  11114. })(d.gui || (d.gui = {}))
  11115. })(egret || (egret = {}));
  11116. __extends = this.__extends || function (d, e) {
  11117. function f() {
  11118. this.constructor = d
  11119. }
  11120. for (var c in e)
  11121. e.hasOwnProperty(c) && (d[c] = e[c]);
  11122. f.prototype = e.prototype;
  11123. d.prototype = new f
  11124. };
  11125. (function (d) {
  11126. (function (e) {
  11127. var f = function (c) {
  11128. function a() {
  11129. c.call(this);
  11130. this._contentText = this._secondButtonLabel = this._firstButtonLabel = "";
  11131. this.hostComponentKey = "egret.gui.Alert"
  11132. }
  11133. __extends(a, c);
  11134. a.show = function (b, c, d, f, h, g, l) {
  11135. "undefined" === typeof b && (b = "");
  11136. "undefined" === typeof c && (c = "");
  11137. "undefined" === typeof d && (d = null);
  11138. "undefined" === typeof f && (f = "\u786e\u5b9a");
  11139. "undefined" === typeof h && (h = "");
  11140. "undefined" === typeof g && (g = !0);
  11141. "undefined" === typeof l && (l = !0);
  11142. var k = new a;
  11143. k.contentText = b;
  11144. k.title = c;
  11145. k._firstButtonLabel =
  11146. f;
  11147. k._secondButtonLabel = h;
  11148. k.closeHandler = d;
  11149. e.PopUpManager.addPopUp(k, g, l);
  11150. return k
  11151. };
  11152. Object.defineProperty(a.prototype, "firstButtonLabel", {
  11153. get : function () {
  11154. return this._firstButtonLabel
  11155. },
  11156. set : function (b) {
  11157. this._firstButtonLabel != b && (this._firstButtonLabel = b, this.firstButton && (this.firstButton.label = b))
  11158. },
  11159. enumerable : !0,
  11160. configurable : !0
  11161. });
  11162. Object.defineProperty(a.prototype, "secondButtonLabel", {
  11163. get : function () {
  11164. return this._secondButtonLabel
  11165. },
  11166. set : function (b) {
  11167. this._secondButtonLabel != b && (this._secondButtonLabel =
  11168. b, !this.secondButton || null != b && "" != b || (this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel))
  11169. },
  11170. enumerable : !0,
  11171. configurable : !0
  11172. });
  11173. Object.defineProperty(a.prototype, "contentText", {
  11174. get : function () {
  11175. return this._contentText
  11176. },
  11177. set : function (b) {
  11178. this._contentText != b && (this._contentText = b, this.contentDisplay && (this.contentDisplay.text = b))
  11179. },
  11180. enumerable : !0,
  11181. configurable : !0
  11182. });
  11183. a.prototype.onClose = function (b) {
  11184. e.PopUpManager.removePopUp(this);
  11185. if (null != this.closeHandler) {
  11186. var c =
  11187. new e.CloseEvent(e.CloseEvent.CLOSE);
  11188. switch (b.currentTarget) {
  11189. case this.firstButton:
  11190. c.detail = a.FIRST_BUTTON;
  11191. break;
  11192. case this.secondButton:
  11193. c.detail = a.SECOND_BUTTON
  11194. }
  11195. this.closeHandler(c)
  11196. }
  11197. };
  11198. a.prototype.closeButton_clickHandler = function (b) {
  11199. c.prototype.closeButton_clickHandler.call(this, b);
  11200. e.PopUpManager.removePopUp(this);
  11201. b = new e.CloseEvent(e.CloseEvent.CLOSE, !1, !1, a.CLOSE_BUTTON);
  11202. null != this.closeHandler && this.closeHandler(b)
  11203. };
  11204. a.prototype.partAdded = function (b, a) {
  11205. c.prototype.partAdded.call(this, b, a);
  11206. a == this.contentDisplay ?
  11207. this.contentDisplay.text = this._contentText : a == this.firstButton ? (this.firstButton.label = this._firstButtonLabel, this.firstButton.addEventListener(d.TouchEvent.TOUCH_TAP, this.onClose, this)) : a == this.secondButton && (this.secondButton.label = this._secondButtonLabel, this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel, this.secondButton.addEventListener(d.TouchEvent.TOUCH_TAP, this.onClose, this))
  11208. };
  11209. a.prototype.partRemoved = function (b, a) {
  11210. c.prototype.partRemoved.call(this,
  11211. b, a);
  11212. a == this.firstButton ? this.firstButton.removeEventListener(d.TouchEvent.TOUCH_TAP, this.onClose, this) : a == this.secondButton && this.secondButton.removeEventListener(d.TouchEvent.TOUCH_TAP, this.onClose, this)
  11213. };
  11214. a.FIRST_BUTTON = "firstButton";
  11215. a.SECOND_BUTTON = "secondButton";
  11216. a.CLOSE_BUTTON = "closeButton";
  11217. return a
  11218. }
  11219. (e.TitleWindow);
  11220. e.Alert = f;
  11221. f.prototype.__class__ = "egret.gui.Alert"
  11222. })(d.gui || (d.gui = {}))
  11223. })(egret || (egret = {}));
  11224. __extends = this.__extends || function (d, e) {
  11225. function f() {
  11226. this.constructor = d
  11227. }
  11228. for (var c in e)
  11229. e.hasOwnProperty(c) && (d[c] = e[c]);
  11230. f.prototype = e.prototype;
  11231. d.prototype = new f
  11232. };
  11233. (function (d) {
  11234. (function (e) {
  11235. var f = function (c) {
  11236. function a() {
  11237. c.call(this);
  11238. this._slideDuration = 500;
  11239. this._direction = e.ProgressBarDirection.LEFT_TO_RIGHT;
  11240. this.animationValue = 0;
  11241. this.trackResizedOrMoved = !1;
  11242. this.hostComponentKey = "egret.gui.ProgressBar"
  11243. }
  11244. __extends(a, c);
  11245. Object.defineProperty(a.prototype, "labelFunction", {
  11246. get : function () {
  11247. return this._labelFunction
  11248. },
  11249. set : function (b) {
  11250. this._labelFunction != b && (this._labelFunction = b, this.invalidateDisplayList())
  11251. },
  11252. enumerable : !0,
  11253. configurable : !0
  11254. });
  11255. a.prototype.valueToLabel =
  11256. function (b, a) {
  11257. return null != this.labelFunction ? this._labelFunction(b, a) : b + " / " + a
  11258. };
  11259. Object.defineProperty(a.prototype, "slideDuration", {
  11260. get : function () {
  11261. return this._slideDuration
  11262. },
  11263. set : function (b) {
  11264. this._slideDuration != b && (this._slideDuration = b, this.animator && this.animator.isPlaying && (this.animator.stop(), this._setValue(this.slideToValue)))
  11265. },
  11266. enumerable : !0,
  11267. configurable : !0
  11268. });
  11269. Object.defineProperty(a.prototype, "direction", {
  11270. get : function () {
  11271. return this._direction
  11272. },
  11273. set : function (b) {
  11274. this._direction != b && (this._direction =
  11275. b, this.invalidateDisplayList())
  11276. },
  11277. enumerable : !0,
  11278. configurable : !0
  11279. });
  11280. Object.defineProperty(a.prototype, "value", {
  11281. get : function () {
  11282. return this._getValue()
  11283. },
  11284. set : function (b) {
  11285. this._getValue() != b && (this._setValue(b), 0 < this._slideDuration && this.stage ? (this.validateProperties(), this.animator || (this.animator = new e.Animation(this.animationUpdateHandler, this)), this.animator.isPlaying && (this.animationValue = this.slideToValue, this.invalidateDisplayList(), this.animator.stop()), this.slideToValue = this.nearestValidValue(b,
  11286. this.snapInterval), this.slideToValue != this.animationValue && (b = this._slideDuration * (Math.abs(this.animationValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.duration = Infinity === b ? 0 : b, this.animator.motionPaths = [{
  11287. prop : "value",
  11288. from : this.animationValue,
  11289. to : this.slideToValue
  11290. }
  11291. ], this.animator.play())) : this.animationValue = this._getValue())
  11292. },
  11293. enumerable : !0,
  11294. configurable : !0
  11295. });
  11296. a.prototype.animationUpdateHandler = function (b) {
  11297. b = this.nearestValidValue(b.currentValue.value, this.snapInterval);
  11298. this.animationValue =
  11299. Math.min(this.maximum, Math.max(this.minimum, b));
  11300. this.invalidateDisplayList()
  11301. };
  11302. a.prototype.setValue = function (b) {
  11303. c.prototype.setValue.call(this, b);
  11304. this.invalidateDisplayList()
  11305. };
  11306. a.prototype.updateDisplayList = function (b, a) {
  11307. c.prototype.updateDisplayList.call(this, b, a);
  11308. this.updateSkinDisplayList()
  11309. };
  11310. a.prototype.partAdded = function (b, a) {
  11311. a == this.track && this.track instanceof e.UIComponent && (this.track.addEventListener(e.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.addEventListener(e.MoveEvent.MOVE,
  11312. this.onTrackResizeOrMove, this))
  11313. };
  11314. a.prototype.partRemoved = function (b, a) {
  11315. a == this.track && this.track instanceof e.UIComponent && (this.track.removeEventListener(e.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.removeEventListener(e.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  11316. };
  11317. a.prototype.onTrackResizeOrMove = function (b) {
  11318. this.trackResizedOrMoved = !0;
  11319. this.invalidateProperties()
  11320. };
  11321. a.prototype.commitProperties = function () {
  11322. c.prototype.commitProperties.call(this);
  11323. this.trackResizedOrMoved && (this.trackResizedOrMoved =
  11324. !1, this.updateSkinDisplayList())
  11325. };
  11326. a.prototype.updateSkinDisplayList = function () {
  11327. this.trackResizedOrMoved = !1;
  11328. var b = this.value;
  11329. this.animator && this.animator.isPlaying ? b = this.animationValue : (b = this.value, isNaN(b) && (b = 0));
  11330. var a = isNaN(this.maximum) ? 0 : this.maximum;
  11331. if (this.thumb && this.track) {
  11332. var c = isNaN(this.track.width) ? 0 : this.track.width,
  11333. c = c * this.track.scaleX,
  11334. f = isNaN(this.track.height) ? 0 : this.track.height,
  11335. f = f * this.track.scaleY,
  11336. h = Math.round(b / a * c);
  11337. if (isNaN(h) || 0 > h || Infinity === h)
  11338. h = 0;
  11339. var g = Math.round(b / a * f);
  11340. if (isNaN(g) || 0 > g || Infinity === g)
  11341. g = 0;
  11342. var l = this.track.localToGlobal(0, 0),
  11343. k = this.globalToLocal(l.x, l.y, d.Point.identity),
  11344. l = k.x,
  11345. k = k.y;
  11346. switch (this._direction) {
  11347. case e.ProgressBarDirection.LEFT_TO_RIGHT:
  11348. this.thumb.width = h;
  11349. this.thumb.height = f;
  11350. this.thumb.x = l;
  11351. break;
  11352. case e.ProgressBarDirection.RIGHT_TO_LEFT:
  11353. this.thumb.width = h;
  11354. this.thumb.height = f;
  11355. this.thumb.x = l + c - h;
  11356. break;
  11357. case e.ProgressBarDirection.TOP_TO_BOTTOM:
  11358. this.thumb.width = c;
  11359. this.thumb.height = g;
  11360. this.thumb.y = k;
  11361. break;
  11362. case e.ProgressBarDirection.BOTTOM_TO_TOP:
  11363. this.thumb.width =
  11364. c,
  11365. this.thumb.height = g,
  11366. this.thumb.y = k + f - g
  11367. }
  11368. }
  11369. this.labelDisplay && (this.labelDisplay.text = this.valueToLabel(b, a))
  11370. };
  11371. return a
  11372. }
  11373. (e.Range);
  11374. e.ProgressBar = f;
  11375. f.prototype.__class__ = "egret.gui.ProgressBar"
  11376. })(d.gui || (d.gui = {}))
  11377. })(egret || (egret = {}));
  11378. (function (d) {
  11379. (function (d) {
  11380. var f = function () {
  11381. function c() {}
  11382. c.LEFT_TO_RIGHT = "leftToRight";
  11383. c.RIGHT_TO_LEFT = "rightToLeft";
  11384. c.TOP_TO_BOTTOM = "topToBottom";
  11385. c.BOTTOM_TO_TOP = "bottomToTop";
  11386. return c
  11387. }
  11388. ();
  11389. d.ProgressBarDirection = f;
  11390. f.prototype.__class__ = "egret.gui.ProgressBarDirection"
  11391. })(d.gui || (d.gui = {}))
  11392. })(egret || (egret = {}));
  11393. __extends = this.__extends || function (d, e) {
  11394. function f() {
  11395. this.constructor = d
  11396. }
  11397. for (var c in e)
  11398. e.hasOwnProperty(c) && (d[c] = e[c]);
  11399. f.prototype = e.prototype;
  11400. d.prototype = new f
  11401. };
  11402. (function (d) {
  11403. (function (e) {
  11404. var f = function (c) {
  11405. function a() {
  11406. c.call(this);
  11407. this.hostComponentKey = "egret.gui.HSlider"
  11408. }
  11409. __extends(a, c);
  11410. a.prototype.pointToValue = function (b, a) {
  11411. if (!this.thumb || !this.track)
  11412. return 0;
  11413. var c = this.maximum - this.minimum,
  11414. d = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  11415. return this.minimum + (0 != d ? b / d * c : 0)
  11416. };
  11417. a.prototype.updateSkinDisplayList = function () {
  11418. if (this.thumb && this.track) {
  11419. var b = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  11420. a = this.maximum - this.minimum,
  11421. b = 0 < a ?
  11422. (this.pendingValue - this.minimum) / a * b : 0,
  11423. c = this.track.localToGlobal(b, 0),
  11424. a = c.x,
  11425. c = c.y,
  11426. e = this.thumb.parent.globalToLocal(a, c, d.Point.identity).x;
  11427. this.thumb.setLayoutBoundsPosition(Math.round(e), this.thumb.layoutBoundsY);
  11428. this.showTrackHighlight && this.trackHighlight && this.trackHighlight.parent && (a = this.trackHighlight.parent.globalToLocal(a, c, d.Point.identity).x - b, this.trackHighlight.x = Math.round(a), this.trackHighlight.width = Math.round(b))
  11429. }
  11430. };
  11431. return a
  11432. }
  11433. (e.SliderBase);
  11434. e.HSlider = f;
  11435. f.prototype.__class__ = "egret.gui.HSlider"
  11436. })(d.gui ||
  11437. (d.gui = {}))
  11438. })(egret || (egret = {}));
  11439. __extends = this.__extends || function (d, e) {
  11440. function f() {
  11441. this.constructor = d
  11442. }
  11443. for (var c in e)
  11444. e.hasOwnProperty(c) && (d[c] = e[c]);
  11445. f.prototype = e.prototype;
  11446. d.prototype = new f
  11447. };
  11448. (function (d) {
  11449. (function (e) {
  11450. var f = function (c) {
  11451. function a() {
  11452. c.call(this);
  11453. this.hostComponentKey = "egret.gui.VSlider"
  11454. }
  11455. __extends(a, c);
  11456. a.prototype.pointToValue = function (b, a) {
  11457. if (!this.thumb || !this.track)
  11458. return 0;
  11459. var c = this.maximum - this.minimum,
  11460. d = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  11461. return this.minimum + (0 != d ? (d - a) / d * c : 0)
  11462. };
  11463. a.prototype.updateSkinDisplayList = function () {
  11464. if (this.thumb && this.track) {
  11465. var b = this.thumb.layoutBoundsHeight,
  11466. a = this.track.layoutBoundsHeight - b,
  11467. c = this.maximum - this.minimum,
  11468. e = this.track.localToGlobal(0, 0 < c ? a - (this.pendingValue - this.minimum) / c * a : 0),
  11469. c = e.x,
  11470. e = e.y,
  11471. f = this.thumb.parent.globalToLocal(c, e, d.Point.identity).y;
  11472. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(f));
  11473. this.showTrackHighlight && this.trackHighlight && this.trackHighlight._parent && (c = this.trackHighlight._parent.globalToLocal(c, e, d.Point.identity).y, this.trackHighlight.y = Math.round(c + b), this.trackHighlight.height = Math.round(a - c))
  11474. }
  11475. };
  11476. return a
  11477. }
  11478. (e.SliderBase);
  11479. e.VSlider = f;
  11480. f.prototype.__class__ =
  11481. "egret.gui.VSlider"
  11482. })(d.gui || (d.gui = {}))
  11483. })(egret || (egret = {}));
  11484. __extends = this.__extends || function (d, e) {
  11485. function f() {
  11486. this.constructor = d
  11487. }
  11488. for (var c in e)
  11489. e.hasOwnProperty(c) && (d[c] = e[c]);
  11490. f.prototype = e.prototype;
  11491. d.prototype = new f
  11492. };
  11493. (function (d) {
  11494. (function (e) {
  11495. var f = function (c) {
  11496. function a() {
  11497. c.call(this);
  11498. this._allowMultipleSelection = !1;
  11499. this._selectedIndices = [];
  11500. this._captureItemRenderer = !0;
  11501. this.hostComponentKey = "egret.gui.List";
  11502. this.useVirtualLayout = !0
  11503. }
  11504. __extends(a, c);
  11505. a.prototype.createChildren = function () {
  11506. this.itemRenderer || (this.itemRenderer = e.DataGroup.defaultRendererFactory);
  11507. c.prototype.createChildren.call(this)
  11508. };
  11509. Object.defineProperty(a.prototype, "useVirtualLayout", {
  11510. get : function () {
  11511. return this._getUseVirtualLayout()
  11512. },
  11513. set : function (b) {
  11514. this._setUseVirtualLayout(b)
  11515. },
  11516. enumerable : !0,
  11517. configurable : !0
  11518. });
  11519. Object.defineProperty(a.prototype, "allowMultipleSelection", {
  11520. get : function () {
  11521. return this._allowMultipleSelection
  11522. },
  11523. set : function (b) {
  11524. this._allowMultipleSelection = b
  11525. },
  11526. enumerable : !0,
  11527. configurable : !0
  11528. });
  11529. Object.defineProperty(a.prototype, "selectedIndices", {
  11530. get : function () {
  11531. return this._proposedSelectedIndices ? this._proposedSelectedIndices : this._selectedIndices
  11532. },
  11533. set : function (b) {
  11534. this._setSelectedIndices(b, !1)
  11535. },
  11536. enumerable : !0,
  11537. configurable : !0
  11538. });
  11539. Object.defineProperty(a.prototype, "selectedIndex", {
  11540. get : function () {
  11541. return this._proposedSelectedIndices ? 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1 : this._getSelectedIndex()
  11542. },
  11543. set : function (b) {
  11544. this._setSelectedIndex(b)
  11545. },
  11546. enumerable : !0,
  11547. configurable : !0
  11548. });
  11549. Object.defineProperty(a.prototype, "selectedItems", {
  11550. get : function () {
  11551. var b = [],
  11552. a = this.selectedIndices;
  11553. if (a)
  11554. for (var c = a.length, d = 0; d < c; d++)
  11555. b[d] = this.dataProvider.getItemAt(a[d]);
  11556. return b
  11557. },
  11558. set : function (b) {
  11559. var a = [];
  11560. if (b)
  11561. for (var c = b.length, d = 0; d < c; d++) {
  11562. var e = this.dataProvider.getItemIndex(b[d]);
  11563. -1 != e && a.splice(0, 0, e);
  11564. if (-1 == e) {
  11565. a = [];
  11566. break
  11567. }
  11568. }
  11569. this._setSelectedIndices(a, !1)
  11570. },
  11571. enumerable : !0,
  11572. configurable : !0
  11573. });
  11574. a.prototype._setSelectedIndices = function (b, a) {
  11575. "undefined" === typeof a && (a = !1);
  11576. a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a);
  11577. this._proposedSelectedIndices = b ? b : [];
  11578. this.invalidateProperties()
  11579. };
  11580. a.prototype.commitProperties = function () {
  11581. c.prototype.commitProperties.call(this);
  11582. this._proposedSelectedIndices && this.commitSelection()
  11583. };
  11584. a.prototype.commitSelection = function (b) {
  11585. "undefined" ===
  11586. typeof b && (b = !0);
  11587. var a = this._selectedIndex;
  11588. if (this._proposedSelectedIndices) {
  11589. this._proposedSelectedIndices = this._proposedSelectedIndices.filter(this.isValidIndex);
  11590. if (!this.allowMultipleSelection && 0 < this._proposedSelectedIndices.length) {
  11591. var d = [];
  11592. d.push(this._proposedSelectedIndices[0]);
  11593. this._proposedSelectedIndices = d
  11594. }
  11595. this._proposedSelectedIndex = 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1
  11596. }
  11597. d = c.prototype.commitSelection.call(this, !1);
  11598. if (!d)
  11599. return this._proposedSelectedIndices =
  11600. null, !1;
  11601. this.selectedIndex > e.ListBase.NO_SELECTION && (this._proposedSelectedIndices ? -1 == this._proposedSelectedIndices.indexOf(this.selectedIndex) && this._proposedSelectedIndices.push(this.selectedIndex) : this._proposedSelectedIndices = [this.selectedIndex]);
  11602. this._proposedSelectedIndices && (-1 != this._proposedSelectedIndices.indexOf(a) && this.itemSelected(a, !0), this.commitMultipleSelection());
  11603. b && d && (this._dispatchChangeAfterSelection && (e.IndexChangeEvent.dispatchIndexChangeEvent(this, e.IndexChangeEvent.CHANGE,
  11604. a, this._selectedIndex), this._dispatchChangeAfterSelection = !1), e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT));
  11605. return d
  11606. };
  11607. a.prototype.isValidIndex = function (b, a, c) {
  11608. return this.dataProvider && 0 <= b && b < this.dataProvider.length
  11609. };
  11610. a.prototype.commitMultipleSelection = function () {
  11611. var b = [],
  11612. a = [],
  11613. c,
  11614. d;
  11615. if (0 < this._selectedIndices.length && 0 < this._proposedSelectedIndices.length) {
  11616. d = this._proposedSelectedIndices.length;
  11617. for (c = 0; c < d; c++)
  11618. - 1 == this._selectedIndices.indexOf(this._proposedSelectedIndices[c]) && a.push(this._proposedSelectedIndices[c]);
  11619. d = this._selectedIndices.length;
  11620. for (c = 0; c < d; c++)
  11621. - 1 == this._proposedSelectedIndices.indexOf(this._selectedIndices[c]) && b.push(this._selectedIndices[c])
  11622. } else
  11623. 0 < this._selectedIndices.length ? b = this._selectedIndices : 0 < this._proposedSelectedIndices.length && (a = this._proposedSelectedIndices);
  11624. this._selectedIndices = this._proposedSelectedIndices;
  11625. if (0 < b.length)
  11626. for (d = b.length, c = 0; c < d; c++)
  11627. this.itemSelected(b[c], !1);
  11628. if (0 < a.length)
  11629. for (d = a.length, c = 0; c < d; c++)
  11630. this.itemSelected(a[c], !0);
  11631. this._proposedSelectedIndices =
  11632. null
  11633. };
  11634. a.prototype._isItemIndexSelected = function (b) {
  11635. return this._allowMultipleSelection ? -1 != this._selectedIndices.indexOf(b) : c.prototype._isItemIndexSelected.call(this, b)
  11636. };
  11637. a.prototype.dataGroup_rendererAddHandler = function (b) {
  11638. c.prototype.dataGroup_rendererAddHandler.call(this, b);
  11639. b = b.renderer;
  11640. null != b && (b.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.addEventListener(d.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  11641. };
  11642. a.prototype.dataGroup_rendererRemoveHandler = function (b) {
  11643. c.prototype.dataGroup_rendererRemoveHandler.call(this,
  11644. b);
  11645. b = b.renderer;
  11646. null != b && (b.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.removeEventListener(d.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  11647. };
  11648. a.prototype.item_mouseDownHandler = function (b) {
  11649. if (!b.isDefaultPrevented()) {
  11650. var a = b.currentTarget,
  11651. c;
  11652. c = a ? a.itemIndex : this.dataGroup.getElementIndex(b.currentTarget);
  11653. this._allowMultipleSelection ? this._setSelectedIndices(this.calculateSelectedIndices(c, b.shiftKey, b.ctrlKey), !0) : this._setSelectedIndex(c, !0);
  11654. this._captureItemRenderer &&
  11655. (this.mouseDownItemRenderer = a, e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this))
  11656. }
  11657. };
  11658. a.prototype.calculateSelectedIndices = function (b, a, c) {
  11659. var d = [];
  11660. if (a)
  11661. if (a = 0 < this._selectedIndices.length ? this._selectedIndices[this._selectedIndices.length - 1] : 0, a < b)
  11662. for (; a <= b; a++)
  11663. d.splice(0, 0, a);
  11664. else
  11665. for (; a >= b; a--)
  11666. d.splice(0, 0, a);
  11667. else if (c)
  11668. if (0 < this._selectedIndices.length)
  11669. if (1 == this._selectedIndices.length &&
  11670. this._selectedIndices[0] == b) {
  11671. if (!this.requireSelection)
  11672. return d;
  11673. d.splice(0, 0, this._selectedIndices[0])
  11674. } else {
  11675. c = !1;
  11676. for (a = 0; a < this._selectedIndices.length; a++)
  11677. this._selectedIndices[a] == b ? c = !0 : this._selectedIndices[a] != b && d.splice(0, 0, this._selectedIndices[a]);
  11678. c || d.splice(0, 0, b)
  11679. }
  11680. else
  11681. d.splice(0, 0, b);
  11682. else
  11683. d.splice(0, 0, b);
  11684. return d
  11685. };
  11686. a.prototype.item_mouseUpHandler = function (b) {
  11687. var a = b.currentTarget;
  11688. a == this.mouseDownItemRenderer && this._dispatchListEvent(b, e.ListEvent.ITEM_CLICK, a)
  11689. };
  11690. a.prototype.stage_mouseUpHandler =
  11691. function (b) {
  11692. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  11693. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  11694. this.mouseDownItemRenderer = null
  11695. };
  11696. return a
  11697. }
  11698. (e.ListBase);
  11699. e.List = f;
  11700. f.prototype.__class__ = "egret.gui.List"
  11701. })(d.gui || (d.gui = {}))
  11702. })(egret || (egret = {}));
  11703. __extends = this.__extends || function (d, e) {
  11704. function f() {
  11705. this.constructor = d
  11706. }
  11707. for (var c in e)
  11708. e.hasOwnProperty(c) && (d[c] = e[c]);
  11709. f.prototype = e.prototype;
  11710. d.prototype = new f
  11711. };
  11712. (function (d) {
  11713. (function (e) {
  11714. var f = function (c) {
  11715. function a() {
  11716. c.call(this);
  11717. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  11718. this._popUpPosition = e.PopUpPosition.TOP_LEFT;
  11719. this.inAnimation = !1;
  11720. this.animator = null;
  11721. this._openDuration = 250;
  11722. this._closeDuration = 150;
  11723. this.valueRange = 1;
  11724. this.addEventListener(d.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  11725. this.addEventListener(d.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler,
  11726. this)
  11727. }
  11728. __extends(a, c);
  11729. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  11730. get : function () {
  11731. return this._popUpHeightMatchesAnchorHeight
  11732. },
  11733. set : function (b) {
  11734. this._popUpHeightMatchesAnchorHeight != b && (this._popUpHeightMatchesAnchorHeight = b, this.invalidateDisplayList())
  11735. },
  11736. enumerable : !0,
  11737. configurable : !0
  11738. });
  11739. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  11740. get : function () {
  11741. return this._popUpWidthMatchesAnchorWidth
  11742. },
  11743. set : function (b) {
  11744. this._popUpWidthMatchesAnchorWidth != b && (this._popUpWidthMatchesAnchorWidth =
  11745. b, this.invalidateDisplayList())
  11746. },
  11747. enumerable : !0,
  11748. configurable : !0
  11749. });
  11750. Object.defineProperty(a.prototype, "displayPopUp", {
  11751. get : function () {
  11752. return this._displayPopUp
  11753. },
  11754. set : function (b) {
  11755. this._displayPopUp != b && (this._displayPopUp = b, this.addOrRemovePopUp())
  11756. },
  11757. enumerable : !0,
  11758. configurable : !0
  11759. });
  11760. Object.defineProperty(a.prototype, "popUp", {
  11761. get : function () {
  11762. return this._popUp
  11763. },
  11764. set : function (b) {
  11765. this._popUp != b && (this._popUp = b, this.dispatchEventWith("popUpChanged"))
  11766. },
  11767. enumerable : !0,
  11768. configurable : !0
  11769. });
  11770. Object.defineProperty(a.prototype,
  11771. "popUpPosition", {
  11772. get : function () {
  11773. return this._popUpPosition
  11774. },
  11775. set : function (b) {
  11776. this._popUpPosition != b && (this._popUpPosition = b, this.invalidateDisplayList())
  11777. },
  11778. enumerable : !0,
  11779. configurable : !0
  11780. });
  11781. a.prototype.updateDisplayList = function (b, a) {
  11782. c.prototype.updateDisplayList.call(this, b, a);
  11783. this.applyPopUpTransform(b, a)
  11784. };
  11785. a.prototype.updatePopUpTransform = function () {
  11786. this.applyPopUpTransform(this.width, this.height)
  11787. };
  11788. a.prototype.calculatePopUpPosition = function () {
  11789. var b = d.Point.identity;
  11790. switch (this._popUpPosition) {
  11791. case e.PopUpPosition.BELOW:
  11792. b.x =
  11793. 0;
  11794. b.y = this.height;
  11795. break;
  11796. case e.PopUpPosition.ABOVE:
  11797. b.x = 0;
  11798. b.y = -this.popUp.layoutBoundsHeight;
  11799. break;
  11800. case e.PopUpPosition.LEFT:
  11801. b.x = -this.popUp.layoutBoundsWidth;
  11802. b.y = 0;
  11803. break;
  11804. case e.PopUpPosition.RIGHT:
  11805. b.x = this.width;
  11806. b.y = 0;
  11807. break;
  11808. case e.PopUpPosition.CENTER:
  11809. b.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth),
  11810. b.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  11811. }
  11812. b = this.localToGlobal(b.x, b.y, b);
  11813. return b = this.popUp.parent.globalToLocal(b.x, b.y, b)
  11814. };
  11815. Object.defineProperty(a.prototype, "openDuration", {
  11816. get : function () {
  11817. return this._openDuration
  11818. },
  11819. set : function (b) {
  11820. this._openDuration = b
  11821. },
  11822. enumerable : !0,
  11823. configurable : !0
  11824. });
  11825. Object.defineProperty(a.prototype, "closeDuration", {
  11826. get : function () {
  11827. return this._closeDuration
  11828. },
  11829. set : function (b) {
  11830. this._closeDuration = b
  11831. },
  11832. enumerable : !0,
  11833. configurable : !0
  11834. });
  11835. a.prototype.animationStartHandler = function (b) {
  11836. this.inAnimation = !0;
  11837. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  11838. };
  11839. a.prototype.animationUpdateHandler = function (b) {
  11840. var a = this.popUp._scrollRect,
  11841. c = Math.round(b.currentValue.x);
  11842. b = Math.round(b.currentValue.y);
  11843. a ?
  11844. (a.x = c, a.y = b, a.width = this.popUp.width, a.height = this.popUp.height) : this.popUp._scrollRect = new d.Rectangle(c, b, this.popUp.width, this.popUp.height)
  11845. };
  11846. a.prototype.animationEndHandler = function (b) {
  11847. this.inAnimation = !1;
  11848. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  11849. this.popUp.scrollRect = null;
  11850. this.popUpIsDisplayed || (e.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11851. };
  11852. a.prototype.addOrRemovePopUp = function () {
  11853. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ?
  11854. (e.PopUpManager.addPopUp(this.popUp, !1, !1), this.popUp.ownerChanged(this), this.popUpIsDisplayed = !0, this.inAnimation && this.animator.end(), this.initialized ? (this.applyPopUpTransform(this.width, this.height), 0 < this._openDuration && this.startAnimation()) : d.callLater(function () {
  11855. 0 < this.openDuration && this.startAnimation()
  11856. }, this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  11857. };
  11858. a.prototype.removeAndResetPopUp = function () {
  11859. this.inAnimation && this.animator.end();
  11860. this.popUpIsDisplayed = !1;
  11861. 0 < this._closeDuration ? this.startAnimation() : (e.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11862. };
  11863. a.prototype.applyPopUpTransform = function (b, a) {
  11864. if (this.popUpIsDisplayed) {
  11865. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = b);
  11866. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = a);
  11867. "validateNow" in this.popUp && this.popUp.validateNow();
  11868. var c = this.calculatePopUpPosition();
  11869. this.popUp.x = c.x;
  11870. this.popUp.y = c.y
  11871. }
  11872. };
  11873. a.prototype.startAnimation = function () {
  11874. this.animator || (this.animator = new e.Animation(this.animationUpdateHandler,
  11875. this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  11876. this.animator.motionPaths = this.createMotionPath();
  11877. this.animator.duration = this.popUpIsDisplayed ? this._openDuration : this._closeDuration;
  11878. this.animator.play()
  11879. };
  11880. a.prototype.createMotionPath = function () {
  11881. var b = {
  11882. prop : "x"
  11883. },
  11884. a = {
  11885. prop : "y"
  11886. },
  11887. c = [b, a];
  11888. switch (this._popUpPosition) {
  11889. case e.PopUpPosition.TOP_LEFT:
  11890. case e.PopUpPosition.CENTER:
  11891. case e.PopUpPosition.BELOW:
  11892. b.from = b.to = 0;
  11893. a.from = this.popUp.height;
  11894. a.to =
  11895. 0;
  11896. this.valueRange = this.popUp.height;
  11897. break;
  11898. case e.PopUpPosition.ABOVE:
  11899. b.from = b.to = 0;
  11900. a.from = -this.popUp.height;
  11901. a.to = 0;
  11902. this.valueRange = this.popUp.height;
  11903. break;
  11904. case e.PopUpPosition.LEFT:
  11905. a.from = a.to = 0;
  11906. b.from = -this.popUp.width;
  11907. b.to = 0;
  11908. this.valueRange = this.popUp.width;
  11909. break;
  11910. case e.PopUpPosition.RIGHT:
  11911. a.from = a.to = 0;
  11912. b.from = this.popUp.width;
  11913. b.to = 0;
  11914. this.valueRange = this.popUp.width;
  11915. break;
  11916. default:
  11917. this.valueRange = 1
  11918. }
  11919. this.valueRange = Math.abs(this.valueRange);
  11920. if (!this.popUpIsDisplayed) {
  11921. var d = b.from;
  11922. b.from = b.to;
  11923. b.to =
  11924. d;
  11925. d = a.from;
  11926. a.from = a.to;
  11927. a.to = d
  11928. }
  11929. return c
  11930. };
  11931. a.prototype.addedToStageHandler = function (b) {
  11932. this.addedToStage = !0;
  11933. d.callLater(this.checkPopUpState, this)
  11934. };
  11935. a.prototype.checkPopUpState = function () {
  11936. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  11937. };
  11938. a.prototype.removedFromStageHandler = function (b) {
  11939. this.addedToStage = !1;
  11940. d.callLater(this.checkPopUpState, this)
  11941. };
  11942. return a
  11943. }
  11944. (e.UIComponent);
  11945. e.PopUpAnchor = f;
  11946. f.prototype.__class__ = "egret.gui.PopUpAnchor"
  11947. })(d.gui ||
  11948. (d.gui = {}))
  11949. })(egret || (egret = {}));
  11950. __extends = this.__extends || function (d, e) {
  11951. function f() {
  11952. this.constructor = d
  11953. }
  11954. for (var c in e)
  11955. e.hasOwnProperty(c) && (d[c] = e[c]);
  11956. f.prototype = e.prototype;
  11957. d.prototype = new f
  11958. };
  11959. (function (d) {
  11960. (function (e) {
  11961. var f = function (c) {
  11962. function a() {
  11963. c.call(this);
  11964. this._isOpen = !1;
  11965. this._closeOnResize = !0;
  11966. this._rollOverOpenDelay = NaN
  11967. }
  11968. __extends(a, c);
  11969. Object.defineProperty(a.prototype, "openButton", {
  11970. get : function () {
  11971. return this._openButton
  11972. },
  11973. set : function (b) {
  11974. this._openButton !== b && (this.removeOpenTriggers(), this._openButton = b, this.addOpenTriggers())
  11975. },
  11976. enumerable : !0,
  11977. configurable : !0
  11978. });
  11979. Object.defineProperty(a.prototype, "dropDown", {
  11980. get : function () {
  11981. return this._dropDown
  11982. },
  11983. set : function (b) {
  11984. this._dropDown !== b &&
  11985. (this._dropDown = b)
  11986. },
  11987. enumerable : !0,
  11988. configurable : !0
  11989. });
  11990. Object.defineProperty(a.prototype, "isOpen", {
  11991. get : function () {
  11992. return this._isOpen
  11993. },
  11994. enumerable : !0,
  11995. configurable : !0
  11996. });
  11997. Object.defineProperty(a.prototype, "closeOnResize", {
  11998. get : function () {
  11999. return this._closeOnResize
  12000. },
  12001. set : function (b) {
  12002. this._closeOnResize != b && (this.isOpen && this.removeCloseOnResizeTrigger(), this._closeOnResize = b, this.addCloseOnResizeTrigger())
  12003. },
  12004. enumerable : !0,
  12005. configurable : !0
  12006. });
  12007. Object.defineProperty(a.prototype, "rollOverOpenDelay", {
  12008. get : function () {
  12009. return this._rollOverOpenDelay
  12010. },
  12011. set : function (b) {
  12012. this._rollOverOpenDelay != b && (this.removeOpenTriggers(), this._rollOverOpenDelay = b, this.addOpenTriggers())
  12013. },
  12014. enumerable : !0,
  12015. configurable : !0
  12016. });
  12017. a.prototype.addOpenTriggers = function () {
  12018. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.addEventListener(e.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.addEventListener(d.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  12019. };
  12020. a.prototype.removeOpenTriggers = function () {
  12021. this.openButton && (isNaN(this.rollOverOpenDelay) ?
  12022. this.openButton.removeEventListener(e.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.removeEventListener(d.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  12023. };
  12024. a.prototype.addCloseTriggers = function () {
  12025. e.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) :
  12026. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), this.addCloseOnResizeTrigger())
  12027. };
  12028. a.prototype.removeCloseTriggers = function () {
  12029. e.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : (e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler,
  12030. this), e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)), this.removeCloseOnResizeTrigger())
  12031. };
  12032. a.prototype.addCloseOnResizeTrigger = function () {
  12033. this.closeOnResize && e.UIGlobals.stage.addEventListener(d.Event.RESIZE, this.stage_resizeHandler, this)
  12034. };
  12035. a.prototype.removeCloseOnResizeTrigger = function () {
  12036. this.closeOnResize && e.UIGlobals.stage.removeEventListener(d.Event.RESIZE, this.stage_resizeHandler,
  12037. this)
  12038. };
  12039. a.prototype.isTargetOverDropDownOrOpenButton = function (b) {
  12040. if (b) {
  12041. if (this.openButton && this.openButton.contains(b))
  12042. return !0;
  12043. if (null != this.hitAreaAdditions)
  12044. for (var a = 0; a < this.hitAreaAdditions.length; a++)
  12045. if (this.hitAreaAdditions[a] == b || this.hitAreaAdditions[a]instanceof d.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b))
  12046. return !0;
  12047. if (this.dropDown instanceof d.DisplayObjectContainer) {
  12048. if (this.dropDown.contains(b))
  12049. return !0
  12050. } else if (b == this.dropDown)
  12051. return !0
  12052. }
  12053. return !1
  12054. };
  12055. a.prototype.openDropDown =
  12056. function () {
  12057. this.openDropDownHelper()
  12058. };
  12059. a.prototype.openDropDownHelper = function () {
  12060. this.isOpen || (this.addCloseTriggers(), this._isOpen = !0, this.openButton && this.openButton._setKeepDown(!0), e.UIEvent.dispatchUIEvent(this, e.UIEvent.OPEN))
  12061. };
  12062. a.prototype.closeDropDown = function (b) {
  12063. if (this.isOpen) {
  12064. this._isOpen = !1;
  12065. this.openButton && this.openButton._setKeepDown(!1);
  12066. var a = new e.UIEvent(e.UIEvent.CLOSE, !1, !0);
  12067. b || a.preventDefault();
  12068. this.dispatchEvent(a);
  12069. this.removeCloseTriggers()
  12070. }
  12071. };
  12072. a.prototype._openButton_buttonDownHandler =
  12073. function (b) {
  12074. this.isOpen ? this.closeDropDown(!0) : (this.mouseIsDown = !0, this.openDropDownHelper())
  12075. };
  12076. a.prototype._openButton_rollOverHandler = function (b) {
  12077. 0 == this.rollOverOpenDelay ? this.openDropDownHelper() : (this.openButton.addEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this), this.rollOverOpenDelayTimer = new d.Timer(this.rollOverOpenDelay, 1), this.rollOverOpenDelayTimer.addEventListener(d.TimerEvent.TIMER_COMPLETE, this.rollOverDelay_timerCompleteHandler, this), this.rollOverOpenDelayTimer.start())
  12078. };
  12079. a.prototype.openButton_rollOutHandler = function (b) {
  12080. this.rollOverOpenDelayTimer && this.rollOverOpenDelayTimer.running && (this.rollOverOpenDelayTimer.stop(), this.rollOverOpenDelayTimer = null);
  12081. this.openButton.removeEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this)
  12082. };
  12083. a.prototype.rollOverDelay_timerCompleteHandler = function (b) {
  12084. this.openButton.removeEventListener(d.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this);
  12085. this.rollOverOpenDelayTimer = null;
  12086. this.openDropDownHelper()
  12087. };
  12088. a.prototype.stage_mouseDownHandler = function (b) {
  12089. if (this.mouseIsDown)
  12090. this.mouseIsDown = !1;
  12091. else if (!this.dropDown || this.dropDown && (b.target == this.dropDown || this.dropDown instanceof d.DisplayObjectContainer && !this.dropDown.contains(b.target))) {
  12092. var a = b.target;
  12093. if (!(this.openButton && a && this.openButton.contains(a))) {
  12094. if (null != this.hitAreaAdditions)
  12095. for (a = 0; a < this.hitAreaAdditions.length; a++)
  12096. if (this.hitAreaAdditions[a] == b.target || this.hitAreaAdditions[a]instanceof d.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b.target))
  12097. return;
  12098. this.closeDropDown(!0)
  12099. }
  12100. }
  12101. };
  12102. a.prototype.stage_mouseMoveHandler = function (b) {
  12103. this.isTargetOverDropDownOrOpenButton(b.target) || (b instanceof d.TouchEvent && b.touchDown ? (e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0))
  12104. };
  12105. a.prototype.stage_mouseUpHandler_noRollOverOpenDelay = function (b) {
  12106. this.mouseIsDown && (this.mouseIsDown = !1)
  12107. };
  12108. a.prototype.stage_mouseUpHandler =
  12109. function (b) {
  12110. this.isTargetOverDropDownOrOpenButton(b.target) ? (e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0)
  12111. };
  12112. a.prototype.stage_resizeHandler = function (b) {
  12113. this.closeDropDown(!0)
  12114. };
  12115. a.prototype.stage_mouseWheelHandler = function (b) {
  12116. !this.dropDown || this.dropDown.contains(b.target) && b.isDefaultPrevented() || this.closeDropDown(!1)
  12117. };
  12118. return a
  12119. }
  12120. (d.EventDispatcher);
  12121. e.DropDownController = f;
  12122. f.prototype.__class__ = "egret.gui.DropDownController"
  12123. })(d.gui || (d.gui = {}))
  12124. })(egret || (egret = {}));
  12125. __extends = this.__extends || function (d, e) {
  12126. function f() {
  12127. this.constructor = d
  12128. }
  12129. for (var c in e)
  12130. e.hasOwnProperty(c) && (d[c] = e[c]);
  12131. f.prototype = e.prototype;
  12132. d.prototype = new f
  12133. };
  12134. (function (d) {
  12135. (function (d) {
  12136. var f = function (c) {
  12137. function a() {
  12138. c.call(this);
  12139. this._labelChanged = !1;
  12140. this._userProposedSelectedIndex = d.ListBase.NO_SELECTION;
  12141. this._captureItemRenderer = !1;
  12142. this.dropDownController = new d.DropDownController
  12143. }
  12144. __extends(a, c);
  12145. a.prototype._setDataProvider = function (b) {
  12146. this.dataProvider !== b && (c.prototype._setDataProvider.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  12147. };
  12148. a.prototype._setLabelField = function (b) {
  12149. this.labelField != b && (c.prototype._setLabelField.call(this, b), this._labelChanged =
  12150. !0, this.invalidateProperties())
  12151. };
  12152. a.prototype._setLabelFunction = function (b) {
  12153. this.labelFunction != b && (c.prototype._setLabelFunction.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  12154. };
  12155. Object.defineProperty(a.prototype, "dropDownController", {
  12156. get : function () {
  12157. return this._dropDownController
  12158. },
  12159. set : function (b) {
  12160. this._dropDownController != b && (this._dropDownController = b, this._dropDownController.addEventListener(d.UIEvent.OPEN, this._dropDownController_openHandler, this), this._dropDownController.addEventListener(d.UIEvent.CLOSE,
  12161. this.dropDownController_closeHandler, this), this.openButton && (this._dropDownController.openButton = this.openButton), this.dropDown && (this._dropDownController.dropDown = this.dropDown))
  12162. },
  12163. enumerable : !0,
  12164. configurable : !0
  12165. });
  12166. Object.defineProperty(a.prototype, "isDropDownOpen", {
  12167. get : function () {
  12168. return this.dropDownController ? this.dropDownController.isOpen : !1
  12169. },
  12170. enumerable : !0,
  12171. configurable : !0
  12172. });
  12173. a.prototype.commitProperties = function () {
  12174. c.prototype.commitProperties.call(this);
  12175. this._labelChanged && (this._labelChanged = !1,
  12176. this.updateLabelDisplay())
  12177. };
  12178. a.prototype.partAdded = function (b, a) {
  12179. c.prototype.partAdded.call(this, b, a);
  12180. a == this.openButton ? this.dropDownController && (this.dropDownController.openButton = this.openButton) : a == this.dropDown && this.dropDownController && (this.dropDownController.dropDown = this.dropDown)
  12181. };
  12182. a.prototype.partRemoved = function (b, a) {
  12183. this.dropDownController && (a == this.openButton && (this.dropDownController.openButton = null), a == this.dropDown && (this.dropDownController.dropDown = null));
  12184. c.prototype.partRemoved.call(this,
  12185. b, a)
  12186. };
  12187. a.prototype.getCurrentSkinState = function () {
  12188. return this.enabled ? this.isDropDownOpen ? "open" : "normal" : "disabled"
  12189. };
  12190. a.prototype.commitSelection = function (b) {
  12191. "undefined" === typeof b && (b = !0);
  12192. b = c.prototype.commitSelection.call(this, b);
  12193. this.updateLabelDisplay();
  12194. return b
  12195. };
  12196. a.prototype._isItemIndexSelected = function (b) {
  12197. return this._userProposedSelectedIndex == b
  12198. };
  12199. a.prototype.openDropDown = function () {
  12200. this.dropDownController.openDropDown()
  12201. };
  12202. a.prototype.closeDropDown = function (b) {
  12203. this.dropDownController.closeDropDown(b)
  12204. };
  12205. a.prototype.updateLabelDisplay = function (b) {};
  12206. a.prototype._changeHighlightedSelection = function (b, a) {
  12207. this.itemSelected(this._userProposedSelectedIndex, !1);
  12208. this._userProposedSelectedIndex = b;
  12209. this.itemSelected(this._userProposedSelectedIndex, !0)
  12210. };
  12211. a.prototype.dataProvider_collectionChangeHandler = function (b) {
  12212. c.prototype.dataProvider_collectionChangeHandler.call(this, b);
  12213. this._labelChanged = !0;
  12214. this.invalidateProperties()
  12215. };
  12216. a.prototype.item_mouseDownHandler = function (b) {
  12217. c.prototype.item_mouseDownHandler.call(this,
  12218. b);
  12219. this._dispatchListEvent(b, d.ListEvent.ITEM_CLICK, b.currentTarget);
  12220. this._userProposedSelectedIndex = this.selectedIndex;
  12221. this.closeDropDown(!0)
  12222. };
  12223. a.prototype._dropDownController_openHandler = function (b) {
  12224. this.addEventListener(d.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  12225. this._userProposedSelectedIndex = this.selectedIndex;
  12226. this.invalidateSkinState()
  12227. };
  12228. a.prototype._open_updateCompleteHandler = function (b) {
  12229. this.removeEventListener(d.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler,
  12230. this);
  12231. d.UIEvent.dispatchUIEvent(this, d.UIEvent.OPEN)
  12232. };
  12233. a.prototype.dropDownController_closeHandler = function (b) {
  12234. this.addEventListener(d.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  12235. this.invalidateSkinState();
  12236. b.isDefaultPrevented() ? this._changeHighlightedSelection(this.selectedIndex) : this._setSelectedIndex(this._userProposedSelectedIndex, !0)
  12237. };
  12238. a.prototype.close_updateCompleteHandler = function (b) {
  12239. this.removeEventListener(d.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  12240. d.UIEvent.dispatchUIEvent(this, d.UIEvent.CLOSE)
  12241. };
  12242. a.PAGE_SIZE = 5;
  12243. return a
  12244. }
  12245. (d.List);
  12246. d.DropDownListBase = f;
  12247. f.prototype.__class__ = "egret.gui.DropDownListBase"
  12248. })(d.gui || (d.gui = {}))
  12249. })(egret || (egret = {}));
  12250. __extends = this.__extends || function (d, e) {
  12251. function f() {
  12252. this.constructor = d
  12253. }
  12254. for (var c in e)
  12255. e.hasOwnProperty(c) && (d[c] = e[c]);
  12256. f.prototype = e.prototype;
  12257. d.prototype = new f
  12258. };
  12259. (function (d) {
  12260. (function (d) {
  12261. var f = function (c) {
  12262. function a() {
  12263. c.call(this);
  12264. this.iconFieldOrFunctionChanged = !1;
  12265. this.hostComponentKey = "egret.gui.Tree"
  12266. }
  12267. __extends(a, c);
  12268. a.prototype.createChildren = function () {
  12269. this.itemRenderer || (this.itemRenderer = a.defaultTreeRendererFactory);
  12270. c.prototype.createChildren.call(this)
  12271. };
  12272. a.prototype.updateRenderer = function (b, a, d) {
  12273. if ("hasChildren" in b && "hasChildren" in this.dataProvider) {
  12274. var e = this.dataProvider;
  12275. b.hasChildren = e.hasChildren(d);
  12276. b.opened = e.isItemOpen(d);
  12277. b.depth = e.getDepth(d);
  12278. b.iconSkinName = this.itemToIcon(d)
  12279. }
  12280. return c.prototype.updateRenderer.call(this, b, a, d)
  12281. };
  12282. a.prototype.itemToIcon = function (b) {
  12283. if (!b)
  12284. return null;
  12285. if (null != this._iconFunction)
  12286. return this._iconFunction(b);
  12287. var a;
  12288. if (b instanceof Object)
  12289. try {
  12290. b[this.iconField] && (a = b[this.iconField])
  12291. } catch (c) {}
  12292. return a
  12293. };
  12294. a.prototype.dataGroup_rendererAddHandler = function (b) {
  12295. c.prototype.dataGroup_rendererAddHandler.call(this, b);
  12296. b.renderer && "hasChildren" in b.renderer && b.renderer.addEventListener(d.TreeEvent.ITEM_OPENING, this.onItemOpening,
  12297. this)
  12298. };
  12299. a.prototype.onItemOpening = function (b) {
  12300. var a = b.itemRenderer,
  12301. c = b.item,
  12302. f = this._getDataProvider();
  12303. a && f && "hasChildren" in f && this.dispatchEvent(b) && (b = !a.opened, f.expandItem(c, b), d.TreeEvent.dispatchTreeEvent(this, b ? d.TreeEvent.ITEM_OPEN : d.TreeEvent.ITEM_CLOSE, a.itemIndex, c, a))
  12304. };
  12305. a.prototype.dataGroup_rendererRemoveHandler = function (b) {
  12306. c.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  12307. b.renderer && "hasChildren" in b.renderer && b.renderer.removeEventListener(d.TreeEvent.ITEM_OPENING, this.onItemOpening,
  12308. this)
  12309. };
  12310. Object.defineProperty(a.prototype, "iconField", {
  12311. get : function () {
  12312. return this._iconField
  12313. },
  12314. set : function (b) {
  12315. this._iconField != b && (this._iconField = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  12316. },
  12317. enumerable : !0,
  12318. configurable : !0
  12319. });
  12320. Object.defineProperty(a.prototype, "iconFunction", {
  12321. get : function () {
  12322. return this._iconFunction
  12323. },
  12324. set : function (b) {
  12325. this._iconFunction != b && (this._iconFunction = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  12326. },
  12327. enumerable : !0,
  12328. configurable : !0
  12329. });
  12330. a.prototype.expandItem =
  12331. function (b, a) {
  12332. "undefined" === typeof a && (a = !0);
  12333. var c = this._getDataProvider();
  12334. c && "hasChildren" in c && c.expandItem(b, a)
  12335. };
  12336. a.prototype.isItemOpen = function (b) {
  12337. var a = this._getDataProvider();
  12338. return a && "hasChildren" in a ? a.isItemOpen(b) : !1
  12339. };
  12340. a.prototype.dataProvider_collectionChangeHandler = function (a) {
  12341. c.prototype.dataProvider_collectionChangeHandler.call(this, a);
  12342. if (a.kind == d.CollectionEventKind.OPEN || a.kind == d.CollectionEventKind.CLOSE) {
  12343. var f = this.dataGroup ? this.dataGroup.getElementAt(a.location) : null;
  12344. f && (this.updateRenderer(f,
  12345. a.location, a.items[0]), a.kind == d.CollectionEventKind.CLOSE && this.layout && this.layout.useVirtualLayout && (this.layout.clearVirtualLayoutCache(), this.invalidateSize()))
  12346. }
  12347. };
  12348. a.prototype.commitProperties = function () {
  12349. c.prototype.commitProperties.call(this);
  12350. if (this.iconFieldOrFunctionChanged) {
  12351. if (null != this.dataGroup) {
  12352. var a;
  12353. if (this.layout && this.layout.useVirtualLayout)
  12354. for (var d = this.dataGroup.getElementIndicesInView(), e = d.length, f = 0; f < e; f++)
  12355. a = d[f], this.updateRendererIconProperty(a);
  12356. else
  12357. for (d = this.dataGroup.numElements,
  12358. a = 0; a < d; a++)
  12359. this.updateRendererIconProperty(a)
  12360. }
  12361. this.iconFieldOrFunctionChanged = !1
  12362. }
  12363. };
  12364. a.prototype.updateRendererIconProperty = function (a) {
  12365. if (a = this.dataGroup.getElementAt(a))
  12366. a.iconSkinName = this.itemToIcon(a.data)
  12367. };
  12368. a.defaultTreeRendererFactory = new d.ClassFactory(d.TreeItemRenderer);
  12369. return a
  12370. }
  12371. (d.List);
  12372. d.Tree = f;
  12373. f.prototype.__class__ = "egret.gui.Tree"
  12374. })(d.gui || (d.gui = {}))
  12375. })(egret || (egret = {}));
  12376. __extends = this.__extends || function (d, e) {
  12377. function f() {
  12378. this.constructor = d
  12379. }
  12380. for (var c in e)
  12381. e.hasOwnProperty(c) && (d[c] = e[c]);
  12382. f.prototype = e.prototype;
  12383. d.prototype = new f
  12384. };
  12385. (function (d) {
  12386. (function (d) {
  12387. var f = function (c) {
  12388. function a() {
  12389. c.call(this);
  12390. this._prompt = "";
  12391. this.hostComponentKey = "egret.gui.DropDownList"
  12392. }
  12393. __extends(a, c);
  12394. Object.defineProperty(a.prototype, "prompt", {
  12395. get : function () {
  12396. return this._prompt
  12397. },
  12398. set : function (a) {
  12399. this._prompt != a && (this._prompt = a, this._labelChanged = !0, this.invalidateProperties())
  12400. },
  12401. enumerable : !0,
  12402. configurable : !0
  12403. });
  12404. a.prototype.partAdded = function (a, d) {
  12405. c.prototype.partAdded.call(this, a, d);
  12406. d == this.labelDisplay && (this._labelChanged = !0, this.invalidateProperties())
  12407. };
  12408. a.prototype.updateLabelDisplay = function (a) {
  12409. "undefined" === typeof a && (a = void 0);
  12410. this.labelDisplay && (void 0 == a && (a = this.selectedItem), this.labelDisplay.text = null != a && void 0 != a ? this.itemToLabel(a) : this._prompt)
  12411. };
  12412. return a
  12413. }
  12414. (d.DropDownListBase);
  12415. d.DropDownList = f;
  12416. f.prototype.__class__ = "egret.gui.DropDownList"
  12417. })(d.gui || (d.gui = {}))
  12418. })(egret || (egret = {}));
  12419. __extends = this.__extends || function (d, e) {
  12420. function f() {
  12421. this.constructor = d
  12422. }
  12423. for (var c in e)
  12424. e.hasOwnProperty(c) && (d[c] = e[c]);
  12425. f.prototype = e.prototype;
  12426. d.prototype = new f
  12427. };
  12428. (function (d) {
  12429. (function (d) {
  12430. var f = function (c) {
  12431. function a() {
  12432. c.call(this);
  12433. this._allowDeselection = !0;
  12434. this.hostComponentKey = "egret.gui.TabBarButton"
  12435. }
  12436. __extends(a, c);
  12437. Object.defineProperty(a.prototype, "allowDeselection", {
  12438. get : function () {
  12439. return this._allowDeselection
  12440. },
  12441. set : function (a) {
  12442. this._allowDeselection = a
  12443. },
  12444. enumerable : !0,
  12445. configurable : !0
  12446. });
  12447. Object.defineProperty(a.prototype, "data", {
  12448. get : function () {
  12449. return this._data
  12450. },
  12451. set : function (a) {
  12452. this._data = a;
  12453. this.dispatchEventWith("dataChange")
  12454. },
  12455. enumerable : !0,
  12456. configurable : !0
  12457. });
  12458. Object.defineProperty(a.prototype, "itemIndex", {
  12459. get : function () {
  12460. return this._itemIndex
  12461. },
  12462. set : function (a) {
  12463. this._itemIndex = a
  12464. },
  12465. enumerable : !0,
  12466. configurable : !0
  12467. });
  12468. a.prototype._setLabel = function (a) {
  12469. a != this._getLabel() && (c.prototype._setLabel.call(this, a), this.labelDisplay && (this.labelDisplay.text = this._getLabel()))
  12470. };
  12471. a.prototype.buttonReleased = function () {
  12472. this.selected && !this.allowDeselection || c.prototype.buttonReleased.call(this)
  12473. };
  12474. return a
  12475. }
  12476. (d.ToggleButtonBase);
  12477. d.TabBarButton = f;
  12478. f.prototype.__class__ = "egret.gui.TabBarButton"
  12479. })(d.gui ||
  12480. (d.gui = {}))
  12481. })(egret || (egret = {}));
  12482. __extends = this.__extends || function (d, e) {
  12483. function f() {
  12484. this.constructor = d
  12485. }
  12486. for (var c in e)
  12487. e.hasOwnProperty(c) && (d[c] = e[c]);
  12488. f.prototype = e.prototype;
  12489. d.prototype = new f
  12490. };
  12491. (function (d) {
  12492. (function (e) {
  12493. var f = function (c) {
  12494. function a() {
  12495. c.call(this);
  12496. this.hostComponentKey = "egret.gui.TabBar";
  12497. this.requireSelection = !0
  12498. }
  12499. __extends(a, c);
  12500. a.prototype.c = function (a) {
  12501. a != this._requireSelection && (c.prototype._setRequireSelection.call(this, a), this.requireSelectionChanged_tabBar = !0, this.invalidateProperties())
  12502. };
  12503. a.prototype._setDataProvider = function (a) {
  12504. this.dataProvider instanceof e.ViewStack && (this.dataProvider.removeEventListener("IndexChanged", this.onViewStackIndexChange, this), this.removeEventListener(e.IndexChangeEvent.CHANGE,
  12505. this.onIndexChanged, this));
  12506. a instanceof e.ViewStack && (a.addEventListener("IndexChanged", this.onViewStackIndexChange, this), this.addEventListener(e.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  12507. c.prototype._setDataProvider.call(this, a)
  12508. };
  12509. a.prototype.onIndexChanged = function (a) {
  12510. this.dataProvider._setSelectedIndex(a.newIndex, !1)
  12511. };
  12512. a.prototype.onViewStackIndexChange = function (a) {
  12513. this._setSelectedIndex(this.dataProvider.selectedIndex, !1)
  12514. };
  12515. a.prototype.commitProperties = function () {
  12516. c.prototype.commitProperties.call(this);
  12517. if (this.requireSelectionChanged_tabBar && this.dataGroup) {
  12518. this.requireSelectionChanged_tabBar = !1;
  12519. for (var a = this.dataGroup.numElements, d = 0; d < a; d++) {
  12520. var e = this.dataGroup.getElementAt(d);
  12521. e && (e.allowDeselection = !this.requireSelection)
  12522. }
  12523. }
  12524. };
  12525. a.prototype.dataGroup_rendererAddHandler = function (a) {
  12526. c.prototype.dataGroup_rendererAddHandler.call(this, a);
  12527. if (a = a.renderer)
  12528. a.addEventListener(d.TouchEvent.TOUCH_TAP, this.item_clickHandler, this), a instanceof e.TabBarButton && (a.allowDeselection = !this.requireSelection)
  12529. };
  12530. a.prototype.dataGroup_rendererRemoveHandler =
  12531. function (a) {
  12532. c.prototype.dataGroup_rendererRemoveHandler.call(this, a);
  12533. (a = a.renderer) && a.removeEventListener(d.TouchEvent.TOUCH_TAP, this.item_clickHandler, this)
  12534. };
  12535. a.prototype.item_clickHandler = function (a) {
  12536. var c = a.currentTarget,
  12537. d;
  12538. d = c ? c.itemIndex : this.dataGroup.getElementIndex(a.currentTarget);
  12539. d == this.selectedIndex ? this.requireSelection || this._setSelectedIndex(e.ListBase.NO_SELECTION, !0) : this._setSelectedIndex(d, !0);
  12540. this._dispatchListEvent(a, e.ListEvent.ITEM_CLICK, c)
  12541. };
  12542. return a
  12543. }
  12544. (e.ListBase);
  12545. e.TabBar = f;
  12546. f.prototype.__class__ = "egret.gui.TabBar"
  12547. })(d.gui || (d.gui = {}))
  12548. })(egret || (egret = {}));
  12549. __extends = this.__extends || function (d, e) {
  12550. function f() {
  12551. this.constructor = d
  12552. }
  12553. for (var c in e)
  12554. e.hasOwnProperty(c) && (d[c] = e[c]);
  12555. f.prototype = e.prototype;
  12556. d.prototype = new f
  12557. };
  12558. (function (d) {
  12559. (function (e) {
  12560. var f = function (c) {
  12561. function a() {
  12562. c.call(this);
  12563. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  12564. this.ignoreTouchBegin = !1;
  12565. this._velocityY = this._velocityX = 0;
  12566. this._previousVelocityX = [];
  12567. this._previousVelocityY = []
  12568. }
  12569. __extends(a, c);
  12570. a.prototype.measure = function () {
  12571. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  12572. };
  12573. a.prototype.updateDisplayList = function (a, c) {
  12574. this._viewport.setLayoutBoundsSize(a, c)
  12575. };
  12576. Object.defineProperty(a.prototype,
  12577. "verticalScrollPolicy", {
  12578. get : function () {
  12579. return this._verticalScrollPolicy
  12580. },
  12581. set : function (a) {
  12582. this._verticalScrollPolicy = a
  12583. },
  12584. enumerable : !0,
  12585. configurable : !0
  12586. });
  12587. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  12588. get : function () {
  12589. return this._horizontalScrollPolicy
  12590. },
  12591. set : function (a) {
  12592. this._horizontalScrollPolicy = a
  12593. },
  12594. enumerable : !0,
  12595. configurable : !0
  12596. });
  12597. Object.defineProperty(a.prototype, "viewport", {
  12598. get : function () {
  12599. return this._viewport
  12600. },
  12601. set : function (a) {
  12602. a != this._viewport && (this.uninstallViewport(), this._viewport =
  12603. a, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  12604. },
  12605. enumerable : !0,
  12606. configurable : !0
  12607. });
  12608. a.prototype.installViewport = function () {
  12609. this.viewport && (this.viewport.clipAndEnableScrolling = !0, this.viewport.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.addEventListener(d.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.addEventListener(d.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._addToDisplayListAt(this.viewport, 0))
  12610. };
  12611. a.prototype.uninstallViewport =
  12612. function () {
  12613. this.viewport && (this.viewport.clipAndEnableScrolling = !1, this.viewport.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.removeEventListener(d.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.removeEventListener(d.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._removeFromDisplayList(this.viewport))
  12614. };
  12615. a.prototype.onTouchEndCapture = function (a) {
  12616. this.delayTouchBeginEvent && (a.stopPropagation(), this.delayTouchEndEvent = this.cloneTouchEvent(a),
  12617. this.onTouchBeginTimer(), this.touchEndTimer || (this.touchEndTimer = new d.Timer(100, 1), this.touchEndTimer.addEventListener(d.TimerEvent.TIMER_COMPLETE, this.onTouchEndTimer, this)), this.touchEndTimer.start())
  12618. };
  12619. a.prototype.onTouchEndTimer = function (a) {
  12620. this.touchEndTimer.stop();
  12621. a = this.delayTouchEndEvent;
  12622. this.delayTouchEndEvent = null;
  12623. this.dispatchPropagationEvent(a)
  12624. };
  12625. a.prototype.dispatchPropagationEvent = function (a) {
  12626. for (var c = [], d = a._target; d; )
  12627. c.push(d), d = d.parent;
  12628. for (var e = this._viewport, f = 1; ; f += 2) {
  12629. d = c[f];
  12630. if (!d || d === e)
  12631. break;
  12632. c.unshift(d)
  12633. }
  12634. d = c.indexOf(a._target);
  12635. this._dispatchPropagationEvent(a, c, d)
  12636. };
  12637. a.prototype.onTouchBeginCapture = function (b) {
  12638. var c = this.checkScrollPolicy();
  12639. if (c) {
  12640. for (var e = b.target; e != this; ) {
  12641. if (e instanceof a && (c = e.checkScrollPolicy()))
  12642. return;
  12643. e = e.parent
  12644. }
  12645. this.delayTouchEndEvent && (this.delayTouchEndEvent = null, this.touchEndTimer.stop());
  12646. b.stopPropagation();
  12647. this.delayTouchBeginEvent = this.cloneTouchEvent(b);
  12648. this.touchBeginTimer || (this.touchBeginTimer = new d.Timer(100, 1), this.touchBeginTimer.addEventListener(d.TimerEvent.TIMER_COMPLETE,
  12649. this.onTouchBeginTimer, this));
  12650. this.touchBeginTimer.start();
  12651. this.onTouchBegin(b)
  12652. }
  12653. };
  12654. a.prototype.cloneTouchEvent = function (a) {
  12655. var c = new d.TouchEvent(a._type, a._bubbles, a.cancelable);
  12656. c.touchPointID = a.touchPointID;
  12657. c._stageX = a._stageX;
  12658. c._stageY = a._stageY;
  12659. c.ctrlKey = a.ctrlKey;
  12660. c.altKey = a.altKey;
  12661. c.shiftKey = a.shiftKey;
  12662. c.touchDown = a.touchDown;
  12663. c._isDefaultPrevented = !1;
  12664. c._target = a._target;
  12665. return c
  12666. };
  12667. a.prototype.onTouchBeginTimer = function (a) {
  12668. this.touchBeginTimer.stop();
  12669. a = this.delayTouchBeginEvent;
  12670. this.delayTouchBeginEvent =
  12671. null;
  12672. this.dispatchPropagationEvent(a)
  12673. };
  12674. a.prototype.checkScrollPolicy = function () {
  12675. var a = this._viewport,
  12676. c;
  12677. switch (this._horizontalScrollPolicy) {
  12678. case "auto":
  12679. c = a.contentWidth > a.width ? !0 : !1;
  12680. break;
  12681. case "on":
  12682. c = !0;
  12683. break;
  12684. case "off":
  12685. c = !1
  12686. }
  12687. this._horizontalCanScroll = c;
  12688. var d;
  12689. switch (this._verticalScrollPolicy) {
  12690. case "auto":
  12691. d = a.contentHeight > a.height ? !0 : !1;
  12692. break;
  12693. case "on":
  12694. d = !0;
  12695. break;
  12696. case "off":
  12697. d = !1
  12698. }
  12699. this._verticalCanScroll = d;
  12700. return c || d
  12701. };
  12702. a.prototype.onTouchBegin = function (a) {
  12703. if (!a.isDefaultPrevented() && this.checkScrollPolicy()) {
  12704. this.verticalAnimator &&
  12705. this.verticalAnimator.isPlaying && this.verticalAnimator.stop();
  12706. this.horizontalAnimator && this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop();
  12707. var c = this._viewport,
  12708. f = c.horizontalScrollPosition,
  12709. c = c.verticalScrollPosition;
  12710. this._offsetPointX = f + a.stageX;
  12711. this._offsetPointY = c + a.stageY;
  12712. this._velocityY = this._velocityX = 0;
  12713. this._previousVelocityX.length = 0;
  12714. this._previousVelocityY.length = 0;
  12715. this._previousTouchTime = d.getTimer();
  12716. this._previousTouchX = this._startTouchX = this._currentTouchX = a.stageX;
  12717. this._previousTouchY =
  12718. this._startTouchY = this._currentTouchY = a.stageY;
  12719. this._startHorizontalScrollPosition = f;
  12720. this._startVerticalScrollPosition = c;
  12721. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  12722. e.UIGlobals.stage.addEventListener(d.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  12723. e.UIGlobals.stage.addEventListener(d.Event.LEAVE_STAGE, this.onTouchEnd, this);
  12724. this.addEventListener(d.Event.ENTER_FRAME, this.enterFrameHandler, this);
  12725. a.preventDefault()
  12726. }
  12727. };
  12728. a.prototype.onTouchMove = function (a) {
  12729. this._currentTouchX =
  12730. a.stageX;
  12731. this._currentTouchY = a.stageY;
  12732. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  12733. var c = this._viewport;
  12734. if (this._horizontalCanScroll) {
  12735. var d = this._offsetPointX - a.stageX;
  12736. 0 > d && (d *= 0.5);
  12737. d > c.contentWidth - c.width && (d = 0.5 * (d + c.contentWidth - c.width));
  12738. c.horizontalScrollPosition = d
  12739. }
  12740. this._verticalCanScroll && (a = this._offsetPointY - a.stageY, 0 > a && (a *= 0.5), a > c.contentHeight - c.height && (a = 0.5 * (a + c.contentHeight - c.height)), c.verticalScrollPosition = a)
  12741. };
  12742. a.prototype.onTouchEnd =
  12743. function (a) {
  12744. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  12745. e.UIGlobals.stage.removeEventListener(d.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  12746. e.UIGlobals.stage.removeEventListener(d.Event.LEAVE_STAGE, this.onTouchEnd, this);
  12747. this.removeEventListener(d.Event.ENTER_FRAME, this.enterFrameHandler, this);
  12748. this._horizontalCanScroll && this.checkHorizontalScrollPosition();
  12749. this._verticalCanScroll && this.checkVerticalScrollPosition()
  12750. };
  12751. a.easeOut = function (a) {
  12752. a -= 1;
  12753. return a * a * a + 1
  12754. };
  12755. a.prototype.enterFrameHandler = function (a) {
  12756. a = d.getTimer();
  12757. var c = a - this._previousTouchTime;
  12758. 0 < c && (this._previousVelocityX[this._previousVelocityX.length] = this._velocityX, 4 < this._previousVelocityX.length && this._previousVelocityX.shift(), this._previousVelocityY[this._previousVelocityY.length] = this._velocityY, 4 < this._previousVelocityY.length && this._previousVelocityY.shift(), this._velocityX = (this._currentTouchX - this._previousTouchX) / c, this._velocityY = (this._currentTouchY - this._previousTouchY) / c, this._previousTouchTime =
  12759. a, this._previousTouchX = this._currentTouchX, this._previousTouchY = this._currentTouchY);
  12760. a = Math.abs(this._currentTouchX - this._startTouchX);
  12761. c = Math.abs(this._currentTouchY - this._startTouchY);
  12762. this._horizontalCanScroll && 0.04 <= a && (this._startTouchX = this._currentTouchX, this._startHorizontalScrollPosition = this._viewport.horizontalScrollPosition);
  12763. this._verticalCanScroll && 0.04 <= c && (this._startTouchY = this._currentTouchY, this._startVerticalScrollPosition = this._viewport.verticalScrollPosition)
  12764. };
  12765. a.prototype.checkHorizontalScrollPosition =
  12766. function () {
  12767. for (var b = this._viewport, c = b.horizontalScrollPosition, b = b.contentWidth - b.width, b = Math.max(0, b), d = 2.33 * this._velocityX, e = this._previousVelocityX.length, f = 2.33, g = 0; g < e; g++)
  12768. var l = a.VELOCITY_WEIGHTS[g], d = d + this._previousVelocityX.shift() * l, f = f + l;
  12769. d /= f;
  12770. 0.02 >= Math.abs(d) ? this.finishScrollingHorizontally() : (c = this.getAnimationDatas(d, c, b), this.throwHorizontally(c[0], c[1]))
  12771. };
  12772. a.prototype.checkVerticalScrollPosition = function () {
  12773. for (var b = this._viewport, c = b.verticalScrollPosition, b = b.contentHeight -
  12774. b.height, d = 2.33 * this._velocityY, e = this._previousVelocityY.length, f = 2.33, g = 0; g < e; g++)
  12775. var l = a.VELOCITY_WEIGHTS[g], d = d + this._previousVelocityY.shift() * l, f = f + l;
  12776. d /= f;
  12777. 0.02 >= Math.abs(d) ? this.finishScrollingVertically() : (c = this.getAnimationDatas(d, c, b), this.throwVertically(c[0], c[1]))
  12778. };
  12779. a.prototype.getAnimationDatas = function (b, c, d) {
  12780. var e = Math.abs(b),
  12781. f = 0,
  12782. g = c + (b - 0.02) / Math.log(0.998);
  12783. if (0 > g || g > d)
  12784. for (g = c; 0.02 < Math.abs(b); )
  12785. g -= b, b = 0 > g || g > d ? 0.998 * b * 0.95 : 0.998 * b, f++;
  12786. else
  12787. f = Math.log(0.02 / e) / Math.log(0.998);
  12788. a.animationData ||
  12789. (a.animationData = [0, 0]);
  12790. b = a.animationData;
  12791. b[0] = g;
  12792. b[1] = f;
  12793. return b
  12794. };
  12795. a.prototype.finishScrollingHorizontally = function (a) {
  12796. var c = this._viewport;
  12797. a = c.horizontalScrollPosition;
  12798. var c = c.contentWidth - c.width,
  12799. d = a;
  12800. 0 > a && (d = 0);
  12801. a > c && (d = c);
  12802. this.throwHorizontally(d, 300)
  12803. };
  12804. a.prototype.throwHorizontally = function (b, c) {
  12805. "undefined" === typeof c && (c = 500);
  12806. var d = this._viewport.horizontalScrollPosition;
  12807. d != b && (this.horizontalAnimator || (this.horizontalAnimator = new e.Animation(this.horizontalUpdateHandler, this), this.horizontalAnimator.endFunction =
  12808. this.finishScrollingHorizontally, this.horizontalAnimator.easerFunction = a.easeOut), this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop(), this.horizontalAnimator.duration = c, this.horizontalAnimator.motionPaths = [{
  12809. prop : "hsp",
  12810. from : d,
  12811. to : b
  12812. }
  12813. ], this.horizontalAnimator.play())
  12814. };
  12815. a.prototype.horizontalUpdateHandler = function (a) {
  12816. this._viewport.horizontalScrollPosition = a.currentValue.hsp
  12817. };
  12818. a.prototype.finishScrollingVertically = function (a) {
  12819. var c = this._viewport;
  12820. a = c.verticalScrollPosition;
  12821. var c = c.contentHeight -
  12822. c.height,
  12823. c = Math.max(0, c),
  12824. d = a;
  12825. 0 > a && (d = 0);
  12826. a > c && (d = c);
  12827. this.throwVertically(d, 300)
  12828. };
  12829. a.prototype.throwVertically = function (b, c) {
  12830. "undefined" === typeof c && (c = 500);
  12831. var d = this._viewport.verticalScrollPosition;
  12832. d != b && (this.verticalAnimator || (this.verticalAnimator = new e.Animation(this.verticalUpdateHandler, this), this.verticalAnimator.endFunction = this.finishScrollingVertically, this.verticalAnimator.easerFunction = a.easeOut), this.verticalAnimator.isPlaying && this.verticalAnimator.stop(), this.verticalAnimator.duration =
  12833. c, this.verticalAnimator.motionPaths = [{
  12834. prop : "vsp",
  12835. from : d,
  12836. to : b
  12837. }
  12838. ], this.verticalAnimator.play())
  12839. };
  12840. a.prototype.verticalUpdateHandler = function (a) {
  12841. this._viewport.verticalScrollPosition = a.currentValue.vsp
  12842. };
  12843. Object.defineProperty(a.prototype, "numElements", {
  12844. get : function () {
  12845. return this.viewport ? 1 : 0
  12846. },
  12847. enumerable : !0,
  12848. configurable : !0
  12849. });
  12850. a.prototype.throwRangeError = function (a) {
  12851. throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  12852. };
  12853. a.prototype.getElementAt = function (a) {
  12854. if (this.viewport &&
  12855. 0 == a)
  12856. return this.viewport;
  12857. this.throwRangeError(a);
  12858. return null
  12859. };
  12860. a.prototype.getElementIndex = function (a) {
  12861. return null != a && a == this.viewport ? 0 : -1
  12862. };
  12863. a.prototype.containsElement = function (a) {
  12864. return null != a && a == this.viewport ? !0 : !1
  12865. };
  12866. a.prototype.throwNotSupportedError = function () {
  12867. throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");
  12868. };
  12869. a.prototype.addElement = function (a) {
  12870. this.throwNotSupportedError();
  12871. return null
  12872. };
  12873. a.prototype.addElementAt = function (a, c) {
  12874. this.throwNotSupportedError();
  12875. return null
  12876. };
  12877. a.prototype.removeElement = function (a) {
  12878. this.throwNotSupportedError();
  12879. return null
  12880. };
  12881. a.prototype.removeElementAt = function (a) {
  12882. this.throwNotSupportedError();
  12883. return null
  12884. };
  12885. a.prototype.removeAllElements = function () {
  12886. this.throwNotSupportedError()
  12887. };
  12888. a.prototype.setElementIndex = function (a, c) {
  12889. this.throwNotSupportedError()
  12890. };
  12891. a.prototype.swapElements = function (a, c) {
  12892. this.throwNotSupportedError()
  12893. };
  12894. a.prototype.swapElementsAt = function (a, c) {
  12895. this.throwNotSupportedError()
  12896. };
  12897. a.prototype.addChild = function (a) {
  12898. this.throwNotSupportedError();
  12899. return null
  12900. };
  12901. a.prototype.addChildAt = function (a, c) {
  12902. this.throwNotSupportedError();
  12903. return null
  12904. };
  12905. a.prototype.removeChild = function (a) {
  12906. this.throwNotSupportedError();
  12907. return null
  12908. };
  12909. a.prototype.removeChildAt = function (a) {
  12910. this.throwNotSupportedError();
  12911. return null
  12912. };
  12913. a.prototype.setChildIndex = function (a, c) {
  12914. this.throwNotSupportedError()
  12915. };
  12916. a.prototype.swapChildren = function (a, c) {
  12917. this.throwNotSupportedError()
  12918. };
  12919. a.prototype.swapChildrenAt = function (a, c) {
  12920. this.throwNotSupportedError()
  12921. };
  12922. a.VELOCITY_WEIGHTS = [1, 1.33, 1.66, 2];
  12923. return a
  12924. }
  12925. (e.UIComponent);
  12926. e.Scroller = f;
  12927. f.prototype.__class__ = "egret.gui.Scroller"
  12928. })(d.gui || (d.gui = {}))
  12929. })(egret || (egret = {}));
  12930. __extends = this.__extends || function (d, e) {
  12931. function f() {
  12932. this.constructor = d
  12933. }
  12934. for (var c in e)
  12935. e.hasOwnProperty(c) && (d[c] = e[c]);
  12936. f.prototype = e.prototype;
  12937. d.prototype = new f
  12938. };
  12939. (function (d) {
  12940. (function (e) {
  12941. var f = function (c) {
  12942. function a(a, d, e) {
  12943. "undefined" === typeof d && (d = !1);
  12944. "undefined" === typeof e && (e = !1);
  12945. c.call(this, a, d, e)
  12946. }
  12947. __extends(a, c);
  12948. a.dispatchUIEvent = function (b, c) {
  12949. d.Event._dispatchByTarget(a, b, c)
  12950. };
  12951. a.INITIALIZE = "initialize";
  12952. a.CREATION_COMPLETE = "creationComplete";
  12953. a.UPDATE_COMPLETE = "updateComplete";
  12954. a.BUTTON_DOWN = "buttonDown";
  12955. a.CHANGE_END = "changeEnd";
  12956. a.CHANGE_START = "changeStart";
  12957. a.CHANGING = "changing";
  12958. a.VALUE_COMMIT = "valueCommit";
  12959. a.SKIN_CHANGED = "skinChanged";
  12960. a.CONTENT_CHANGED =
  12961. "contentChanged";
  12962. a.OPEN = "open";
  12963. a.CLOSE = "close";
  12964. a.PLAY_COMPLETE = "playComplete";
  12965. return a
  12966. }
  12967. (d.Event);
  12968. e.UIEvent = f;
  12969. f.prototype.__class__ = "egret.gui.UIEvent"
  12970. })(d.gui || (d.gui = {}))
  12971. })(egret || (egret = {}));
  12972. __extends = this.__extends || function (d, e) {
  12973. function f() {
  12974. this.constructor = d
  12975. }
  12976. for (var c in e)
  12977. e.hasOwnProperty(c) && (d[c] = e[c]);
  12978. f.prototype = e.prototype;
  12979. d.prototype = new f
  12980. };
  12981. (function (d) {
  12982. (function (e) {
  12983. var f = function (c) {
  12984. function a(a, d, e, f, h, g, l, k) {
  12985. "undefined" === typeof d && (d = !1);
  12986. "undefined" === typeof e && (e = !1);
  12987. "undefined" === typeof f && (f = null);
  12988. "undefined" === typeof h && (h = null);
  12989. "undefined" === typeof g && (g = null);
  12990. "undefined" === typeof l && (l = null);
  12991. "undefined" === typeof k && (k = null);
  12992. c.call(this, a, d, e);
  12993. this.kind = f;
  12994. this.property = h;
  12995. this.oldValue = g;
  12996. this.newValue = l;
  12997. this.source = k
  12998. }
  12999. __extends(a, c);
  13000. a.dispatchPropertyChangeEvent = function (b, c, e, f, h, g) {
  13001. "undefined" === typeof c && (c = null);
  13002. "undefined" ===
  13003. typeof e && (e = null);
  13004. "undefined" === typeof f && (f = null);
  13005. "undefined" === typeof h && (h = null);
  13006. "undefined" === typeof g && (g = null);
  13007. var l = d.Event._getPropertyData(a);
  13008. l.kind = c;
  13009. l.property = e;
  13010. l.oldValue = f;
  13011. l.newValue = h;
  13012. l.source = g;
  13013. d.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, l)
  13014. };
  13015. a.PROPERTY_CHANGE = "propertyChange";
  13016. return a
  13017. }
  13018. (d.Event);
  13019. e.PropertyChangeEvent = f;
  13020. f.prototype.__class__ = "egret.gui.PropertyChangeEvent"
  13021. })(d.gui || (d.gui = {}))
  13022. })(egret || (egret = {}));
  13023. (function (d) {
  13024. (function (d) {
  13025. var f = function () {
  13026. function c() {}
  13027. c.UPDATE = "update";
  13028. c.DELETE = "delete";
  13029. return c
  13030. }
  13031. ();
  13032. d.PropertyChangeEventKind = f;
  13033. f.prototype.__class__ = "egret.gui.PropertyChangeEventKind"
  13034. })(d.gui || (d.gui = {}))
  13035. })(egret || (egret = {}));
  13036. __extends = this.__extends || function (d, e) {
  13037. function f() {
  13038. this.constructor = d
  13039. }
  13040. for (var c in e)
  13041. e.hasOwnProperty(c) && (d[c] = e[c]);
  13042. f.prototype = e.prototype;
  13043. d.prototype = new f
  13044. };
  13045. (function (d) {
  13046. (function (e) {
  13047. var f = function (c) {
  13048. function a(a, d, e, f, h) {
  13049. "undefined" === typeof d && (d = NaN);
  13050. "undefined" === typeof e && (e = NaN);
  13051. "undefined" === typeof f && (f = !1);
  13052. "undefined" === typeof h && (h = !1);
  13053. c.call(this, a, f, h);
  13054. this.oldX = d;
  13055. this.oldY = e
  13056. }
  13057. __extends(a, c);
  13058. a.dispatchMoveEvent = function (b, c, e) {
  13059. "undefined" === typeof c && (c = NaN);
  13060. "undefined" === typeof e && (e = NaN);
  13061. var f = d.Event._getPropertyData(a);
  13062. f.oldX = c;
  13063. f.oldY = e;
  13064. d.Event._dispatchByTarget(a, b, a.MOVE, f)
  13065. };
  13066. a.MOVE = "move";
  13067. return a
  13068. }
  13069. (d.Event);
  13070. e.MoveEvent = f;
  13071. f.prototype.__class__ =
  13072. "egret.gui.MoveEvent"
  13073. })(d.gui || (d.gui = {}))
  13074. })(egret || (egret = {}));
  13075. __extends = this.__extends || function (d, e) {
  13076. function f() {
  13077. this.constructor = d
  13078. }
  13079. for (var c in e)
  13080. e.hasOwnProperty(c) && (d[c] = e[c]);
  13081. f.prototype = e.prototype;
  13082. d.prototype = new f
  13083. };
  13084. (function (d) {
  13085. (function (e) {
  13086. var f = function (c) {
  13087. function a(a, d, e, f, h) {
  13088. "undefined" === typeof d && (d = NaN);
  13089. "undefined" === typeof e && (e = NaN);
  13090. "undefined" === typeof f && (f = !1);
  13091. "undefined" === typeof h && (h = !1);
  13092. c.call(this, a, f, h);
  13093. this.oldWidth = d;
  13094. this.oldHeight = e
  13095. }
  13096. __extends(a, c);
  13097. a.dispatchResizeEvent = function (b, c, e) {
  13098. "undefined" === typeof c && (c = NaN);
  13099. "undefined" === typeof e && (e = NaN);
  13100. var f = d.Event._getPropertyData(a);
  13101. f.oldWidth = c;
  13102. f.oldHeight = e;
  13103. d.Event._dispatchByTarget(a, b, a.RESIZE, f)
  13104. };
  13105. a.RESIZE = "resize";
  13106. return a
  13107. }
  13108. (d.Event);
  13109. e.ResizeEvent = f;
  13110. f.prototype.__class__ = "egret.gui.ResizeEvent"
  13111. })(d.gui || (d.gui = {}))
  13112. })(egret || (egret = {}));
  13113. __extends = this.__extends || function (d, e) {
  13114. function f() {
  13115. this.constructor = d
  13116. }
  13117. for (var c in e)
  13118. e.hasOwnProperty(c) && (d[c] = e[c]);
  13119. f.prototype = e.prototype;
  13120. d.prototype = new f
  13121. };
  13122. (function (d) {
  13123. (function (e) {
  13124. var f = function (c) {
  13125. function a(a, d, e, f, h) {
  13126. "undefined" === typeof d && (d = !1);
  13127. "undefined" === typeof e && (e = !1);
  13128. "undefined" === typeof f && (f = null);
  13129. "undefined" === typeof h && (h = null);
  13130. c.call(this, a, d, e);
  13131. this.partName = f;
  13132. this.instance = h
  13133. }
  13134. __extends(a, c);
  13135. a.dispatchSkinPartEvent = function (b, c, e, f) {
  13136. "undefined" === typeof e && (e = null);
  13137. "undefined" === typeof f && (f = null);
  13138. var h = d.Event._getPropertyData(a);
  13139. h.partName = e;
  13140. h.instance = f;
  13141. d.Event._dispatchByTarget(a, b, c, h)
  13142. };
  13143. a.PART_ADDED = "partAdded";
  13144. a.PART_REMOVED =
  13145. "partRemoved";
  13146. return a
  13147. }
  13148. (d.Event);
  13149. e.SkinPartEvent = f;
  13150. f.prototype.__class__ = "egret.gui.SkinPartEvent"
  13151. })(d.gui || (d.gui = {}))
  13152. })(egret || (egret = {}));
  13153. __extends = this.__extends || function (d, e) {
  13154. function f() {
  13155. this.constructor = d
  13156. }
  13157. for (var c in e)
  13158. e.hasOwnProperty(c) && (d[c] = e[c]);
  13159. f.prototype = e.prototype;
  13160. d.prototype = new f
  13161. };
  13162. (function (d) {
  13163. (function (e) {
  13164. var f = function (c) {
  13165. function a(a, d, e, f) {
  13166. "undefined" === typeof d && (d = !1);
  13167. "undefined" === typeof e && (e = !1);
  13168. "undefined" === typeof f && (f = -1);
  13169. c.call(this, a, d, e);
  13170. this.detail = f
  13171. }
  13172. __extends(a, c);
  13173. a.dispatchCloseEvent = function (b, c, e) {
  13174. "undefined" === typeof e && (e = -1);
  13175. var f = d.Event._getPropertyData(a);
  13176. f.detail = e;
  13177. d.Event._dispatchByTarget(a, b, c, f)
  13178. };
  13179. a.CLOSE = "close";
  13180. return a
  13181. }
  13182. (d.Event);
  13183. e.CloseEvent = f;
  13184. f.prototype.__class__ = "egret.gui.CloseEvent"
  13185. })(d.gui || (d.gui = {}))
  13186. })(egret || (egret = {}));
  13187. __extends = this.__extends || function (d, e) {
  13188. function f() {
  13189. this.constructor = d
  13190. }
  13191. for (var c in e)
  13192. e.hasOwnProperty(c) && (d[c] = e[c]);
  13193. f.prototype = e.prototype;
  13194. d.prototype = new f
  13195. };
  13196. (function (d) {
  13197. (function (e) {
  13198. var f = function (c) {
  13199. function a(a, d, e, f, h, g, l, k) {
  13200. "undefined" === typeof d && (d = !1);
  13201. "undefined" === typeof e && (e = !1);
  13202. "undefined" === typeof f && (f = null);
  13203. "undefined" === typeof h && (h = -1);
  13204. "undefined" === typeof g && (g = -1);
  13205. "undefined" === typeof l && (l = null);
  13206. "undefined" === typeof k && (k = null);
  13207. c.call(this, a, d, e);
  13208. this.kind = f;
  13209. this.location = h;
  13210. this.oldLocation = g;
  13211. this.items = l ? l : [];
  13212. this.oldItems = k ? k : []
  13213. }
  13214. __extends(a, c);
  13215. a.dispatchCollectionEvent = function (b, c, e, f, h, g, l) {
  13216. "undefined" === typeof e && (e = null);
  13217. "undefined" ===
  13218. typeof f && (f = -1);
  13219. "undefined" === typeof h && (h = -1);
  13220. "undefined" === typeof g && (g = null);
  13221. "undefined" === typeof l && (l = null);
  13222. var k = d.Event._getPropertyData(a);
  13223. k.kind = e;
  13224. k.location = f;
  13225. k.oldLocation = h;
  13226. k.items = g;
  13227. k.oldItems = l;
  13228. d.Event._dispatchByTarget(a, b, c, k)
  13229. };
  13230. a.COLLECTION_CHANGE = "collectionChange";
  13231. return a
  13232. }
  13233. (d.Event);
  13234. e.CollectionEvent = f;
  13235. f.prototype.__class__ = "egret.gui.CollectionEvent"
  13236. })(d.gui || (d.gui = {}))
  13237. })(egret || (egret = {}));
  13238. (function (d) {
  13239. (function (d) {
  13240. var f = function () {
  13241. function c() {}
  13242. c.ADD = "add";
  13243. c.MOVE = "move";
  13244. c.REFRESH = "refresh";
  13245. c.REMOVE = "remove";
  13246. c.REPLACE = "replace";
  13247. c.RESET = "reset";
  13248. c.UPDATE = "update";
  13249. c.OPEN = "open";
  13250. c.CLOSE = "close";
  13251. return c
  13252. }
  13253. ();
  13254. d.CollectionEventKind = f;
  13255. f.prototype.__class__ = "egret.gui.CollectionEventKind"
  13256. })(d.gui || (d.gui = {}))
  13257. })(egret || (egret = {}));
  13258. __extends = this.__extends || function (d, e) {
  13259. function f() {
  13260. this.constructor = d
  13261. }
  13262. for (var c in e)
  13263. e.hasOwnProperty(c) && (d[c] = e[c]);
  13264. f.prototype = e.prototype;
  13265. d.prototype = new f
  13266. };
  13267. (function (d) {
  13268. (function (e) {
  13269. var f = function (c) {
  13270. function a(a, d, e, f, h) {
  13271. "undefined" === typeof d && (d = !1);
  13272. "undefined" === typeof e && (e = !1);
  13273. "undefined" === typeof f && (f = null);
  13274. "undefined" === typeof h && (h = -1);
  13275. c.call(this, a, d, e);
  13276. this.element = f;
  13277. this.index = h
  13278. }
  13279. __extends(a, c);
  13280. a.dispatchElementExistenceEvent = function (b, c, e, f) {
  13281. "undefined" === typeof e && (e = null);
  13282. "undefined" === typeof f && (f = -1);
  13283. var h = d.Event._getPropertyData(a);
  13284. h.element = e;
  13285. h.index = f;
  13286. d.Event._dispatchByTarget(a, b, c, h)
  13287. };
  13288. a.ELEMENT_ADD = "elementAdd";
  13289. a.ELEMENT_REMOVE =
  13290. "elementRemove";
  13291. return a
  13292. }
  13293. (d.Event);
  13294. e.ElementExistenceEvent = f;
  13295. f.prototype.__class__ = "egret.gui.ElementExistenceEvent"
  13296. })(d.gui || (d.gui = {}))
  13297. })(egret || (egret = {}));
  13298. __extends = this.__extends || function (d, e) {
  13299. function f() {
  13300. this.constructor = d
  13301. }
  13302. for (var c in e)
  13303. e.hasOwnProperty(c) && (d[c] = e[c]);
  13304. f.prototype = e.prototype;
  13305. d.prototype = new f
  13306. };
  13307. (function (d) {
  13308. (function (e) {
  13309. var f = function (c) {
  13310. function a(a, d, e, f, h) {
  13311. "undefined" === typeof d && (d = !1);
  13312. "undefined" === typeof e && (e = !1);
  13313. "undefined" === typeof f && (f = -1);
  13314. "undefined" === typeof h && (h = -1);
  13315. c.call(this, a, d, e);
  13316. this.oldIndex = f;
  13317. this.newIndex = h
  13318. }
  13319. __extends(a, c);
  13320. a.dispatchIndexChangeEvent = function (b, c, e, f, h) {
  13321. "undefined" === typeof e && (e = -1);
  13322. "undefined" === typeof f && (f = -1);
  13323. "undefined" === typeof h && (h = !1);
  13324. var g = d.Event._getPropertyData(a);
  13325. g.oldIndex = e;
  13326. g.newIndex = f;
  13327. return d.Event._dispatchByTarget(a, b, c, g, !1, h)
  13328. };
  13329. a.CHANGE = "change";
  13330. a.CHANGING = "changing";
  13331. return a
  13332. }
  13333. (d.Event);
  13334. e.IndexChangeEvent = f;
  13335. f.prototype.__class__ = "egret.gui.IndexChangeEvent"
  13336. })(d.gui || (d.gui = {}))
  13337. })(egret || (egret = {}));
  13338. __extends = this.__extends || function (d, e) {
  13339. function f() {
  13340. this.constructor = d
  13341. }
  13342. for (var c in e)
  13343. e.hasOwnProperty(c) && (d[c] = e[c]);
  13344. f.prototype = e.prototype;
  13345. d.prototype = new f
  13346. };
  13347. (function (d) {
  13348. (function (e) {
  13349. var f = function (c) {
  13350. function a(a, d, e, f, h, g, l, k, n, q, p, r, x) {
  13351. "undefined" === typeof d && (d = !0);
  13352. "undefined" === typeof e && (e = !0);
  13353. "undefined" === typeof f && (f = 0);
  13354. "undefined" === typeof h && (h = 0);
  13355. "undefined" === typeof g && (g = 0);
  13356. "undefined" === typeof l && (l = !1);
  13357. "undefined" === typeof k && (k = !1);
  13358. "undefined" === typeof n && (n = !1);
  13359. "undefined" === typeof q && (q = !1);
  13360. "undefined" === typeof p && (p = -1);
  13361. "undefined" === typeof r && (r = null);
  13362. "undefined" === typeof x && (x = null);
  13363. c.call(this, a, d, e, f, h, g, l, k, n, q);
  13364. this.itemIndex =
  13365. p;
  13366. this.item = r;
  13367. this.itemRenderer = x
  13368. }
  13369. __extends(a, c);
  13370. a.dispatchListEvent = function (b, c, e, f, h, g) {
  13371. "undefined" === typeof e && (e = null);
  13372. "undefined" === typeof f && (f = -1);
  13373. "undefined" === typeof h && (h = null);
  13374. "undefined" === typeof g && (g = null);
  13375. var l = d.Event._getPropertyData(a);
  13376. l.touchPointID = e.touchPointID;
  13377. l._stageX = e.stageX;
  13378. l._stageY = e.stageY;
  13379. l.ctrlKey = e.ctrlKey;
  13380. l.altKey = e.altKey;
  13381. l.shiftKey = e.shiftKey;
  13382. l.touchDown = e.touchDown;
  13383. l.itemIndex = f;
  13384. l.item = h;
  13385. l.itemRenderer = g;
  13386. d.Event._dispatchByTarget(a, b, c, l)
  13387. };
  13388. a.ITEM_ROLL_OUT = "itemRollOut";
  13389. a.ITEM_ROLL_OVER = "itemRollOver";
  13390. a.ITEM_CLICK = "itemClick";
  13391. return a
  13392. }
  13393. (d.TouchEvent);
  13394. e.ListEvent = f;
  13395. f.prototype.__class__ = "egret.gui.ListEvent"
  13396. })(d.gui || (d.gui = {}))
  13397. })(egret || (egret = {}));
  13398. __extends = this.__extends || function (d, e) {
  13399. function f() {
  13400. this.constructor = d
  13401. }
  13402. for (var c in e)
  13403. e.hasOwnProperty(c) && (d[c] = e[c]);
  13404. f.prototype = e.prototype;
  13405. d.prototype = new f
  13406. };
  13407. (function (d) {
  13408. (function (e) {
  13409. var f = function (c) {
  13410. function a(a, d, e, f, h) {
  13411. "undefined" === typeof d && (d = !1);
  13412. "undefined" === typeof e && (e = !1);
  13413. "undefined" === typeof f && (f = null);
  13414. "undefined" === typeof h && (h = !1);
  13415. c.call(this, a, d, e);
  13416. this.popUp = f;
  13417. this.modal = h
  13418. }
  13419. __extends(a, c);
  13420. a.dispatchPopUpEvent = function (b, c, e, f) {
  13421. "undefined" === typeof e && (e = null);
  13422. "undefined" === typeof f && (f = !1);
  13423. var h = d.Event._getPropertyData(a);
  13424. h.popUp = e;
  13425. h.modal = f;
  13426. d.Event._dispatchByTarget(a, b, c, h)
  13427. };
  13428. a.ADD_POPUP = "addPopUp";
  13429. a.REMOVE_POPUP = "removePopUp";
  13430. a.BRING_TO_FRONT =
  13431. "bringToFront";
  13432. return a
  13433. }
  13434. (d.Event);
  13435. e.PopUpEvent = f;
  13436. f.prototype.__class__ = "egret.gui.PopUpEvent"
  13437. })(d.gui || (d.gui = {}))
  13438. })(egret || (egret = {}));
  13439. __extends = this.__extends || function (d, e) {
  13440. function f() {
  13441. this.constructor = d
  13442. }
  13443. for (var c in e)
  13444. e.hasOwnProperty(c) && (d[c] = e[c]);
  13445. f.prototype = e.prototype;
  13446. d.prototype = new f
  13447. };
  13448. (function (d) {
  13449. (function (e) {
  13450. var f = function (c) {
  13451. function a(a, d, e, f, h, g) {
  13452. "undefined" === typeof d && (d = !1);
  13453. "undefined" === typeof e && (e = !1);
  13454. "undefined" === typeof f && (f = null);
  13455. "undefined" === typeof h && (h = -1);
  13456. "undefined" === typeof g && (g = null);
  13457. c.call(this, a, d, e);
  13458. this.renderer = f;
  13459. this.index = h;
  13460. this.data = g
  13461. }
  13462. __extends(a, c);
  13463. a.dispatchRendererExistenceEvent = function (b, c, e, f, h) {
  13464. "undefined" === typeof e && (e = null);
  13465. "undefined" === typeof f && (f = -1);
  13466. "undefined" === typeof h && (h = null);
  13467. var g = d.Event._getPropertyData(a);
  13468. g.renderer = e;
  13469. g.index =
  13470. f;
  13471. g.data = h;
  13472. d.Event._dispatchByTarget(a, b, c, g)
  13473. };
  13474. a.RENDERER_ADD = "rendererAdd";
  13475. a.RENDERER_REMOVE = "rendererRemove";
  13476. return a
  13477. }
  13478. (d.Event);
  13479. e.RendererExistenceEvent = f;
  13480. f.prototype.__class__ = "egret.gui.RendererExistenceEvent"
  13481. })(d.gui || (d.gui = {}))
  13482. })(egret || (egret = {}));
  13483. __extends = this.__extends || function (d, e) {
  13484. function f() {
  13485. this.constructor = d
  13486. }
  13487. for (var c in e)
  13488. e.hasOwnProperty(c) && (d[c] = e[c]);
  13489. f.prototype = e.prototype;
  13490. d.prototype = new f
  13491. };
  13492. (function (d) {
  13493. (function (e) {
  13494. var f = function (c) {
  13495. function a(a, d, e, f, h) {
  13496. "undefined" === typeof d && (d = !1);
  13497. "undefined" === typeof e && (e = !1);
  13498. "undefined" === typeof f && (f = null);
  13499. "undefined" === typeof h && (h = null);
  13500. c.call(this, a, d, e);
  13501. this.oldState = f;
  13502. this.newState = h
  13503. }
  13504. __extends(a, c);
  13505. a.dispatchStateChangeEvent = function (b, c, e, f) {
  13506. "undefined" === typeof e && (e = null);
  13507. "undefined" === typeof f && (f = null);
  13508. var h = d.Event._getPropertyData(a);
  13509. h.oldState = e;
  13510. h.newState = f;
  13511. d.Event._dispatchByTarget(a, b, c, h)
  13512. };
  13513. a.CURRENT_STATE_CHANGE = "currentStateChange";
  13514. a.CURRENT_STATE_CHANGING = "currentStateChanging";
  13515. return a
  13516. }
  13517. (d.Event);
  13518. e.StateChangeEvent = f;
  13519. f.prototype.__class__ = "egret.gui.StateChangeEvent"
  13520. })(d.gui || (d.gui = {}))
  13521. })(egret || (egret = {}));
  13522. __extends = this.__extends || function (d, e) {
  13523. function f() {
  13524. this.constructor = d
  13525. }
  13526. for (var c in e)
  13527. e.hasOwnProperty(c) && (d[c] = e[c]);
  13528. f.prototype = e.prototype;
  13529. d.prototype = new f
  13530. };
  13531. (function (d) {
  13532. (function (e) {
  13533. var f = function (c) {
  13534. function a(a, d, e) {
  13535. "undefined" === typeof d && (d = !1);
  13536. "undefined" === typeof e && (e = !1);
  13537. c.call(this, a, d, e)
  13538. }
  13539. __extends(a, c);
  13540. a.dispatchTrackBaseEvent = function (b, c) {
  13541. d.Event._dispatchByTarget(a, b, c)
  13542. };
  13543. a.THUMB_DRAG = "thumbDrag";
  13544. a.THUMB_PRESS = "thumbPress";
  13545. a.THUMB_RELEASE = "thumbRelease";
  13546. return a
  13547. }
  13548. (d.Event);
  13549. e.TrackBaseEvent = f;
  13550. f.prototype.__class__ = "egret.gui.TrackBaseEvent"
  13551. })(d.gui || (d.gui = {}))
  13552. })(egret || (egret = {}));
  13553. __extends = this.__extends || function (d, e) {
  13554. function f() {
  13555. this.constructor = d
  13556. }
  13557. for (var c in e)
  13558. e.hasOwnProperty(c) && (d[c] = e[c]);
  13559. f.prototype = e.prototype;
  13560. d.prototype = new f
  13561. };
  13562. (function (d) {
  13563. (function (e) {
  13564. var f = function (c) {
  13565. function a(a, d, e, f, h, g) {
  13566. "undefined" === typeof d && (d = !1);
  13567. "undefined" === typeof e && (e = !0);
  13568. "undefined" === typeof f && (f = -1);
  13569. "undefined" === typeof h && (h = null);
  13570. "undefined" === typeof g && (g = null);
  13571. c.call(this, a, d, e);
  13572. this.item = h;
  13573. this.itemRenderer = g;
  13574. this.itemIndex = f
  13575. }
  13576. __extends(a, c);
  13577. a.dispatchTreeEvent = function (b, c, e, f, h, g) {
  13578. "undefined" === typeof e && (e = -1);
  13579. "undefined" === typeof f && (f = null);
  13580. "undefined" === typeof h && (h = null);
  13581. "undefined" === typeof g && (g = !1);
  13582. var l = d.Event._getPropertyData(a);
  13583. l.itemIndex = e;
  13584. l.item = f;
  13585. l.itemRenderer = h;
  13586. l.opening = g;
  13587. d.Event._dispatchByTarget(a, b, c, l)
  13588. };
  13589. a.ITEM_CLOSE = "itemClose";
  13590. a.ITEM_OPEN = "itemOpen";
  13591. a.ITEM_OPENING = "itemOpening";
  13592. return a
  13593. }
  13594. (d.Event);
  13595. e.TreeEvent = f;
  13596. f.prototype.__class__ = "egret.gui.TreeEvent"
  13597. })(d.gui || (d.gui = {}))
  13598. })(egret || (egret = {}));
  13599. __extends = this.__extends || function (d, e) {
  13600. function f() {
  13601. this.constructor = d
  13602. }
  13603. for (var c in e)
  13604. e.hasOwnProperty(c) && (d[c] = e[c]);
  13605. f.prototype = e.prototype;
  13606. d.prototype = new f
  13607. };
  13608. (function (d) {
  13609. (function (e) {
  13610. var f = function (c) {
  13611. function a() {
  13612. c.call(this);
  13613. this._useVirtualLayout = !1
  13614. }
  13615. __extends(a, c);
  13616. Object.defineProperty(a.prototype, "target", {
  13617. get : function () {
  13618. return this._target
  13619. },
  13620. set : function (a) {
  13621. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  13622. },
  13623. enumerable : !0,
  13624. configurable : !0
  13625. });
  13626. Object.defineProperty(a.prototype, "useVirtualLayout", {
  13627. get : function () {
  13628. return this._useVirtualLayout
  13629. },
  13630. set : function (a) {
  13631. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"),
  13632. this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  13633. },
  13634. enumerable : !0,
  13635. configurable : !0
  13636. });
  13637. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  13638. get : function () {
  13639. return this._typicalLayoutRect
  13640. },
  13641. set : function (a) {
  13642. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  13643. },
  13644. enumerable : !0,
  13645. configurable : !0
  13646. });
  13647. a.prototype.scrollPositionChanged = function () {};
  13648. a.prototype.clearVirtualLayoutCache = function () {};
  13649. a.prototype.elementAdded =
  13650. function (a) {};
  13651. a.prototype.elementRemoved = function (a) {};
  13652. a.prototype.measure = function () {};
  13653. a.prototype.updateDisplayList = function (a, c) {};
  13654. return a
  13655. }
  13656. (d.EventDispatcher);
  13657. e.LayoutBase = f;
  13658. f.prototype.__class__ = "egret.gui.LayoutBase"
  13659. })(d.gui || (d.gui = {}))
  13660. })(egret || (egret = {}));
  13661. __extends = this.__extends || function (d, e) {
  13662. function f() {
  13663. this.constructor = d
  13664. }
  13665. for (var c in e)
  13666. e.hasOwnProperty(c) && (d[c] = e[c]);
  13667. f.prototype = e.prototype;
  13668. d.prototype = new f
  13669. };
  13670. (function (d) {
  13671. (function (e) {
  13672. var f = function (c) {
  13673. function a() {
  13674. c.call(this);
  13675. this._mouseWheelSpeed = 20
  13676. }
  13677. __extends(a, c);
  13678. Object.defineProperty(a.prototype, "useVirtualLayout", {
  13679. set : function (a) {},
  13680. enumerable : !0,
  13681. configurable : !0
  13682. });
  13683. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  13684. get : function () {
  13685. return this._mouseWheelSpeed
  13686. },
  13687. set : function (a) {
  13688. 0 == a && (a = 1);
  13689. this._mouseWheelSpeed = a
  13690. },
  13691. enumerable : !0,
  13692. configurable : !0
  13693. });
  13694. a.prototype.getElementBoundsLeftOfScrollRect = function (a) {
  13695. var c = new d.Rectangle;
  13696. c.x = a.x - this._mouseWheelSpeed;
  13697. c.right = a.x;
  13698. return c
  13699. };
  13700. a.prototype.getElementBoundsRightOfScrollRect = function (a) {
  13701. var c = new d.Rectangle;
  13702. c.x = a.right;
  13703. c.right = a.right + this._mouseWheelSpeed;
  13704. return c
  13705. };
  13706. a.prototype.getElementBoundsAboveScrollRect = function (a) {
  13707. var c = new d.Rectangle;
  13708. c.y = a.y - this._mouseWheelSpeed;
  13709. c.bottom = a.y;
  13710. return c
  13711. };
  13712. a.prototype.getElementBoundsBelowScrollRect = function (a) {
  13713. var c = new d.Rectangle;
  13714. c.y = a.bottom;
  13715. c.bottom = a.bottom + this._mouseWheelSpeed;
  13716. return c
  13717. };
  13718. a.prototype.measure = function () {
  13719. c.prototype.measure.call(this);
  13720. if (null !=
  13721. this.target) {
  13722. for (var a = 0, d = 0, e = this.target.numElements, f = 0; f < e; f++) {
  13723. var h = this.target.getElementAt(f);
  13724. if (h && h.includeInLayout) {
  13725. var g = h.horizontalCenter,
  13726. l = h.verticalCenter,
  13727. k = h.left,
  13728. n = h.right,
  13729. q = h.top,
  13730. p = h.bottom;
  13731. isNaN(k) || isNaN(n) ? isNaN(g) ? isNaN(k) && isNaN(n) ? g = h.preferredX : (g = isNaN(k) ? 0 : k, g += isNaN(n) ? 0 : n) : g = 2 * Math.abs(g) : g = k + n;
  13732. isNaN(q) || isNaN(p) ? isNaN(l) ? isNaN(q) && isNaN(p) ? l = h.preferredY : (l = isNaN(q) ? 0 : q, l += isNaN(p) ? 0 : p) : l = 2 * Math.abs(l) : l = q + p;
  13733. p = h.preferredHeight;
  13734. a = Math.ceil(Math.max(a, g + h.preferredWidth));
  13735. d = Math.ceil(Math.max(d, l + p))
  13736. }
  13737. }
  13738. this.target.measuredWidth = a;
  13739. this.target.measuredHeight = d
  13740. }
  13741. };
  13742. a.prototype.updateDisplayList = function (a, d) {
  13743. c.prototype.updateDisplayList.call(this, a, d);
  13744. if (null != this.target) {
  13745. for (var e = this.target.numElements, f = 0, h = 0, g = 0; g < e; g++) {
  13746. var l = this.target.getElementAt(g);
  13747. if (null != l && l.includeInLayout) {
  13748. var k = l.horizontalCenter,
  13749. n = l.verticalCenter,
  13750. q = l.left,
  13751. p = l.right,
  13752. r = l.top,
  13753. x = l.bottom,
  13754. z = l.percentWidth,
  13755. v = l.percentHeight,
  13756. A = NaN,
  13757. t = NaN;
  13758. isNaN(q) || isNaN(p) ? isNaN(z) || (A = Math.round(a * Math.min(0.01 *
  13759. z, 1))) : A = a - p - q;
  13760. isNaN(r) || isNaN(x) ? isNaN(v) || (t = Math.round(d * Math.min(0.01 * v, 1))) : t = d - x - r;
  13761. l.setLayoutBoundsSize(A, t);
  13762. z = l.layoutBoundsWidth;
  13763. v = l.layoutBoundsHeight;
  13764. t = A = NaN;
  13765. A = isNaN(k) ? isNaN(q) ? isNaN(p) ? l.layoutBoundsX : a - z - p : q : Math.round((a - z) / 2 + k);
  13766. t = isNaN(n) ? isNaN(r) ? isNaN(x) ? l.layoutBoundsY : d - v - x : r : Math.round((d - v) / 2 + n);
  13767. l.setLayoutBoundsPosition(A, t);
  13768. f = Math.max(f, A + z);
  13769. h = Math.max(h, t + v)
  13770. }
  13771. }
  13772. this.target.setContentSize(f, h)
  13773. }
  13774. };
  13775. return a
  13776. }
  13777. (e.LayoutBase);
  13778. e.BasicLayout = f;
  13779. f.prototype.__class__ = "egret.gui.BasicLayout"
  13780. })(d.gui ||
  13781. (d.gui = {}))
  13782. })(egret || (egret = {}));
  13783. (function (d) {
  13784. (function (d) {
  13785. var f = function () {
  13786. function c() {}
  13787. c.LEFT = "left";
  13788. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  13789. c.JUSTIFY_USING_WIDTH = "justifyUsingWidth";
  13790. return c
  13791. }
  13792. ();
  13793. d.ColumnAlign = f;
  13794. f.prototype.__class__ = "egret.gui.ColumnAlign"
  13795. })(d.gui || (d.gui = {}))
  13796. })(egret || (egret = {}));
  13797. (function (d) {
  13798. (function (d) {
  13799. var f = function () {
  13800. function c() {}
  13801. c.TOP = "top";
  13802. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  13803. c.JUSTIFY_USING_HEIGHT = "justifyUsingHeight";
  13804. return c
  13805. }
  13806. ();
  13807. d.RowAlign = f;
  13808. f.prototype.__class__ = "egret.gui.RowAlign"
  13809. })(d.gui || (d.gui = {}))
  13810. })(egret || (egret = {}));
  13811. (function (d) {
  13812. (function (d) {
  13813. var f = function () {
  13814. function c() {}
  13815. c.ROWS = "rows";
  13816. c.COLUMNS = "columns";
  13817. return c
  13818. }
  13819. ();
  13820. d.TileOrientation = f;
  13821. f.prototype.__class__ = "egret.gui.TileOrientation"
  13822. })(d.gui || (d.gui = {}))
  13823. })(egret || (egret = {}));
  13824. __extends = this.__extends || function (d, e) {
  13825. function f() {
  13826. this.constructor = d
  13827. }
  13828. for (var c in e)
  13829. e.hasOwnProperty(c) && (d[c] = e[c]);
  13830. f.prototype = e.prototype;
  13831. d.prototype = new f
  13832. };
  13833. (function (d) {
  13834. (function (e) {
  13835. var f = function (a) {
  13836. function b() {
  13837. a.call(this);
  13838. this._horizontalAlign = d.HorizontalAlign.LEFT;
  13839. this._verticalAlign = d.VerticalAlign.TOP;
  13840. this._gap = 6;
  13841. this._padding = 0;
  13842. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13843. this.elementSizeTable = [];
  13844. this.endIndex = this.startIndex = -1;
  13845. this.indexInViewCalculated = !1;
  13846. this.maxElementWidth = 0
  13847. }
  13848. __extends(b, a);
  13849. Object.defineProperty(b.prototype, "horizontalAlign", {
  13850. get : function () {
  13851. return this._horizontalAlign
  13852. },
  13853. set : function (a) {
  13854. this._horizontalAlign !=
  13855. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13856. },
  13857. enumerable : !0,
  13858. configurable : !0
  13859. });
  13860. Object.defineProperty(b.prototype, "verticalAlign", {
  13861. get : function () {
  13862. return this._verticalAlign
  13863. },
  13864. set : function (a) {
  13865. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13866. },
  13867. enumerable : !0,
  13868. configurable : !0
  13869. });
  13870. Object.defineProperty(b.prototype, "gap", {
  13871. get : function () {
  13872. return this._gap
  13873. },
  13874. set : function (a) {
  13875. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  13876. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13877. },
  13878. enumerable : !0,
  13879. configurable : !0
  13880. });
  13881. Object.defineProperty(b.prototype, "padding", {
  13882. get : function () {
  13883. return this._padding
  13884. },
  13885. set : function (a) {
  13886. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13887. },
  13888. enumerable : !0,
  13889. configurable : !0
  13890. });
  13891. Object.defineProperty(b.prototype, "paddingLeft", {
  13892. get : function () {
  13893. return this._paddingLeft
  13894. },
  13895. set : function (a) {
  13896. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13897. },
  13898. enumerable : !0,
  13899. configurable : !0
  13900. });
  13901. Object.defineProperty(b.prototype, "paddingRight", {
  13902. get : function () {
  13903. return this._paddingRight
  13904. },
  13905. set : function (a) {
  13906. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13907. },
  13908. enumerable : !0,
  13909. configurable : !0
  13910. });
  13911. Object.defineProperty(b.prototype, "paddingTop", {
  13912. get : function () {
  13913. return this._paddingTop
  13914. },
  13915. set : function (a) {
  13916. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13917. },
  13918. enumerable : !0,
  13919. configurable : !0
  13920. });
  13921. Object.defineProperty(b.prototype,
  13922. "paddingBottom", {
  13923. get : function () {
  13924. return this._paddingBottom
  13925. },
  13926. set : function (a) {
  13927. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13928. },
  13929. enumerable : !0,
  13930. configurable : !0
  13931. });
  13932. b.prototype.invalidateTargetSizeAndDisplayList = function () {
  13933. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13934. };
  13935. b.prototype.measure = function () {
  13936. a.prototype.measure.call(this);
  13937. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13938. };
  13939. b.prototype.measureVirtual =
  13940. function () {
  13941. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), c = this.getElementTotalSize(), d = this.target.getElementIndicesInView(), e = d.length, f = 0; f < e; f++) {
  13942. var k = d[f],
  13943. n = this.target.getElementAt(k);
  13944. if (null != n && n.includeInLayout)
  13945. var q = n.preferredWidth, c = c + n.preferredHeight, c = c - (isNaN(this.elementSizeTable[k]) ? a : this.elementSizeTable[k]), b = Math.max(b, q)
  13946. }
  13947. f = isNaN(this._padding) ? 0 : this._padding;
  13948. a = isNaN(this._paddingLeft) ?
  13949. f : this._paddingLeft;
  13950. d = isNaN(this._paddingRight) ? f : this._paddingRight;
  13951. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  13952. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  13953. e += f;
  13954. this.target.measuredWidth = Math.ceil(b + (a + d));
  13955. this.target.measuredHeight = Math.ceil(c + e)
  13956. };
  13957. b.prototype.measureReal = function () {
  13958. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  13959. var f = this.target.getElementAt(e);
  13960. if (f && f.includeInLayout)
  13961. var k = f.preferredWidth, d = d + f.preferredHeight, c = Math.max(c, k);
  13962. else
  13963. b--
  13964. }
  13965. a = isNaN(this._gap) ? 0 :
  13966. this._gap;
  13967. d += (b - 1) * a;
  13968. f = isNaN(this._padding) ? 0 : this._padding;
  13969. b = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  13970. a = isNaN(this._paddingRight) ? f : this._paddingRight;
  13971. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  13972. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  13973. e += f;
  13974. this.target.measuredWidth = Math.ceil(c + (b + a));
  13975. this.target.measuredHeight = Math.ceil(d + e)
  13976. };
  13977. b.prototype.updateDisplayList = function (b, c) {
  13978. a.prototype.updateDisplayList.call(this, b, c);
  13979. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  13980. c) : this.updateDisplayListReal(b, c))
  13981. };
  13982. b.prototype.getStartPosition = function (a) {
  13983. var b = isNaN(this._padding) ? 0 : this._padding,
  13984. c = isNaN(this._paddingTop) ? b : this._paddingTop,
  13985. b = isNaN(this._gap) ? 0 : this._gap;
  13986. if (!this.useVirtualLayout) {
  13987. var d;
  13988. this.target && (d = this.target.getElementAt(a));
  13989. return d ? d.y : c
  13990. }
  13991. d = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  13992. for (var e = 0; e < a; e++) {
  13993. var f = this.elementSizeTable[e];
  13994. isNaN(f) && (f = d);
  13995. c += f + b
  13996. }
  13997. return c
  13998. };
  13999. b.prototype.getElementSize = function (a) {
  14000. return this.useVirtualLayout ?
  14001. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22), a) : this.target ? this.target.getElementAt(a).height : 0
  14002. };
  14003. b.prototype.getElementTotalSize = function () {
  14004. for (var a = isNaN(this._gap) ? 0 : this._gap, b = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  14005. var f = this.elementSizeTable[e];
  14006. isNaN(f) && (f = b);
  14007. c += f + a
  14008. }
  14009. return c - a
  14010. };
  14011. b.prototype.elementAdded = function (b) {
  14012. a.prototype.elementAdded.call(this, b);
  14013. this.elementSizeTable.splice(b,
  14014. 0, this.typicalLayoutRect ? this.typicalLayoutRect.height : 22)
  14015. };
  14016. b.prototype.elementRemoved = function (b) {
  14017. a.prototype.elementRemoved.call(this, b);
  14018. this.elementSizeTable.splice(b, 1)
  14019. };
  14020. b.prototype.clearVirtualLayoutCache = function () {
  14021. a.prototype.clearVirtualLayoutCache.call(this);
  14022. this.elementSizeTable = [];
  14023. this.maxElementWidth = 0
  14024. };
  14025. b.prototype.findIndexAt = function (a, b, c) {
  14026. var d = Math.floor(0.5 * (b + c)),
  14027. e = this.getStartPosition(d),
  14028. f = this.getElementSize(d),
  14029. k = isNaN(this._gap) ? 0 : this._gap;
  14030. return a >= e && a < e + f + k ? d : b == c ? -1 : a <
  14031. e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  14032. };
  14033. b.prototype.scrollPositionChanged = function () {
  14034. a.prototype.scrollPositionChanged.call(this);
  14035. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  14036. };
  14037. b.prototype.getIndexInView = function () {
  14038. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height)
  14039. return this.startIndex = this.endIndex =
  14040. -1, !1;
  14041. var a = isNaN(this._padding) ? 0 : this._padding,
  14042. b = isNaN(this._paddingTop) ? a : this._paddingTop,
  14043. c = isNaN(this._paddingBottom) ? a : this._paddingBottom,
  14044. a = this.target.numElements,
  14045. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  14046. e = this.target.verticalScrollPosition;
  14047. if (e > d - c)
  14048. return this.endIndex = this.startIndex = -1, !1;
  14049. c = this.target.verticalScrollPosition + this.target.height;
  14050. if (c < b)
  14051. return this.endIndex = this.startIndex = -1, !1;
  14052. b = this.startIndex;
  14053. d = this.endIndex;
  14054. this.startIndex = this.findIndexAt(e, 0, a - 1);
  14055. -1 ==
  14056. this.startIndex && (this.startIndex = 0);
  14057. this.endIndex = this.findIndexAt(c, 0, a - 1);
  14058. -1 == this.endIndex && (this.endIndex = a - 1);
  14059. return b != this.startIndex || d != this.endIndex
  14060. };
  14061. b.prototype.updateDisplayListVirtual = function (a, b) {
  14062. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  14063. var c = isNaN(this._padding) ? 0 : this._padding,
  14064. e = isNaN(this._paddingLeft) ? c : this._paddingLeft,
  14065. f = isNaN(this._paddingRight) ? c : this._paddingRight,
  14066. l = isNaN(this._paddingBottom) ? c : this._paddingBottom,
  14067. k = isNaN(this._gap) ? 0 :
  14068. this._gap,
  14069. n = this.target.numElements;
  14070. if (-1 == this.startIndex || -1 == this.endIndex)
  14071. e = this.getStartPosition(n) - k + l, this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  14072. else {
  14073. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  14074. var q = this._horizontalAlign == d.HorizontalAlign.JUSTIFY || this._horizontalAlign == d.HorizontalAlign.CONTENT_JUSTIFY,
  14075. p = this._horizontalAlign == d.HorizontalAlign.CONTENT_JUSTIFY,
  14076. r = 0;
  14077. q || (this._horizontalAlign == d.HorizontalAlign.CENTER ? r = 0.5 : this._horizontalAlign ==
  14078. d.HorizontalAlign.RIGHT && (r = 1));
  14079. var x = Math.max(0, a - e - f),
  14080. z = Math.ceil(x),
  14081. v,
  14082. A = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22,
  14083. c = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, this.maxElementWidth);
  14084. if (p) {
  14085. for (var t = this.startIndex; t <= this.endIndex; t++)
  14086. (v = this.target.getVirtualElementAt(t)) && v.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth));
  14087. z = Math.ceil(Math.max(x, this.maxElementWidth))
  14088. }
  14089. for (var B = 0, w = 0, t = 0, E = !1, D = this.startIndex; D <= this.endIndex; D++)
  14090. if (B =
  14091. 0, v = this.target.getVirtualElementAt(D))
  14092. v.includeInLayout ? (q ? (B = e, v.setLayoutBoundsSize(z, NaN)) : (B = (x - v.layoutBoundsWidth) * r, B = 0 < B ? B : 0, B = e + B), p || (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth)), t = Math.max(t, v.layoutBoundsWidth), E || (w = isNaN(this.elementSizeTable[D]) ? A : this.elementSizeTable[D], w != v.layoutBoundsHeight && (E = !0)), 0 == D && 0 < this.elementSizeTable.length && this.elementSizeTable[D] != v.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[D] = v.layoutBoundsHeight,
  14093. w = this.getStartPosition(D), v.setLayoutBoundsPosition(Math.round(B), Math.round(w))) : this.elementSizeTable[D] = 0;
  14094. t += e + f;
  14095. e = this.getStartPosition(n) - k + l;
  14096. this.target.setContentSize(Math.ceil(t), Math.ceil(e));
  14097. (E || c < this.maxElementWidth) && this.target.invalidateSize()
  14098. }
  14099. };
  14100. b.prototype.updateDisplayListReal = function (a, e) {
  14101. var f = isNaN(this._padding) ? 0 : this._padding,
  14102. h = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  14103. g = isNaN(this._paddingRight) ? f : this._paddingRight,
  14104. l = isNaN(this._paddingTop) ? f : this._paddingTop,
  14105. f = isNaN(this._paddingBottom) ?
  14106. f : this._paddingBottom,
  14107. k = isNaN(this._gap) ? 0 : this._gap,
  14108. n = Math.max(0, a - h - g),
  14109. q = Math.max(0, e - l - f),
  14110. p = this._verticalAlign == d.VerticalAlign.JUSTIFY,
  14111. r = this._horizontalAlign == d.HorizontalAlign.JUSTIFY || this._horizontalAlign == d.HorizontalAlign.CONTENT_JUSTIFY,
  14112. x = 0;
  14113. r || (this._horizontalAlign == d.HorizontalAlign.CENTER ? x = 0.5 : this._horizontalAlign == d.HorizontalAlign.RIGHT && (x = 1));
  14114. var z = this.target.numElements,
  14115. v = z,
  14116. A = h,
  14117. t = l,
  14118. B,
  14119. w,
  14120. E = 0,
  14121. A = 0,
  14122. D = [],
  14123. C,
  14124. s = q;
  14125. for (B = 0; B < z; B++)
  14126. (w = this.target.getElementAt(B)) && w.includeInLayout ? (this.maxElementWidth =
  14127. Math.max(this.maxElementWidth, w.preferredWidth), p ? E += w.preferredHeight : isNaN(w.percentHeight) ? s -= w.preferredHeight : (A += w.percentHeight, C = new c, C.layoutElement = w, C.percent = w.percentHeight, C.min = w.minHeight, C.max = w.maxHeight, D.push(C))) : v--;
  14128. var s = s - (v - 1) * k,
  14129. s = 0 < s ? s : 0,
  14130. J = q - E - k * (v - 1),
  14131. L,
  14132. G = v,
  14133. I = [];
  14134. if (p) {
  14135. if (0 > J) {
  14136. L = s / v;
  14137. for (B = 0; B < z; B++)
  14138. (w = this.target.getElementAt(B)) && w.includeInLayout && (w = w.preferredHeight, w <= L && (s -= w, G--));
  14139. s = 0 < s ? s : 0
  14140. }
  14141. } else if (0 < A) {
  14142. b.flexChildrenProportionally(q, s, A, D);
  14143. q = 0;
  14144. w = D.length;
  14145. for (B = 0; B <
  14146. w; B++)
  14147. C = D[B], A = Math.round(C.size + q), q += C.size - A, I[C.layoutElement.hashCode] = A, s -= A;
  14148. s = 0 < s ? s : 0
  14149. }
  14150. this._verticalAlign == d.VerticalAlign.MIDDLE ? t = l + 0.5 * s : this._verticalAlign == d.VerticalAlign.BOTTOM && (t = l + s);
  14151. D = h;
  14152. w = v = 0;
  14153. C = Math.ceil(n);
  14154. this._horizontalAlign == d.HorizontalAlign.CONTENT_JUSTIFY && (C = Math.ceil(Math.max(n, this.maxElementWidth)));
  14155. q = 0;
  14156. v = NaN;
  14157. for (B = 0; B < z; B++)
  14158. A = 0, (w = this.target.getElementAt(B)) && w.includeInLayout && (v = NaN, p ? (A = NaN, 0 < J ? A = s * w.preferredHeight / E : 0 > J && w.preferredHeight > L && (A = s / G), isNaN(A) ||
  14159. (v = Math.round(A + q), q += A - v)) : v = I[w.hashCode], r ? (A = h, w.setLayoutBoundsSize(C, v)) : (A = NaN, isNaN(w.percentWidth) || (A = Math.min(100, w.percentWidth), A = Math.round(n * A * 0.01)), w.setLayoutBoundsSize(A, v), A = (n - w.layoutBoundsWidth) * x, A = 0 < A ? A : 0, A = h + A), w.setLayoutBoundsPosition(Math.round(A), Math.round(t)), v = Math.ceil(w.layoutBoundsWidth), w = Math.ceil(w.layoutBoundsHeight), D = Math.max(D, A + v), l = Math.max(l, t + w), t += w + k);
  14160. this.target.setContentSize(Math.ceil(D + g), Math.ceil(l + f))
  14161. };
  14162. b.flexChildrenProportionally = function (a,
  14163. b, c, d) {
  14164. var e = d.length,
  14165. f;
  14166. do {
  14167. f = !0;
  14168. var k = b - a * c / 100;
  14169. 0 < k ? b -= k : k = 0;
  14170. for (var n = b / c, q = 0; q < e; q++) {
  14171. var p = d[q],
  14172. r = p.percent * n;
  14173. if (r < p.min) {
  14174. f = p.min;
  14175. p.size = f;
  14176. d[q] = d[--e];
  14177. d[e] = p;
  14178. c -= p.percent;
  14179. k >= f || (b -= f - k);
  14180. f = !1;
  14181. break
  14182. } else if (r > p.max) {
  14183. f = p.max;
  14184. p.size = f;
  14185. d[q] = d[--e];
  14186. d[e] = p;
  14187. c -= p.percent;
  14188. k >= f || (b -= f - k);
  14189. f = !1;
  14190. break
  14191. } else
  14192. p.size = r
  14193. }
  14194. } while (!f)
  14195. };
  14196. return b
  14197. }
  14198. (e.LayoutBase);
  14199. e.VerticalLayout = f;
  14200. f.prototype.__class__ = "egret.gui.VerticalLayout";
  14201. var c = function () {
  14202. return function () {
  14203. this.size = 0
  14204. }
  14205. }
  14206. ();
  14207. c.prototype.__class__ = "ChildInfo"
  14208. })(d.gui ||
  14209. (d.gui = {}))
  14210. })(egret || (egret = {}));
  14211. __extends = this.__extends || function (d, e) {
  14212. function f() {
  14213. this.constructor = d
  14214. }
  14215. for (var c in e)
  14216. e.hasOwnProperty(c) && (d[c] = e[c]);
  14217. f.prototype = e.prototype;
  14218. d.prototype = new f
  14219. };
  14220. (function (d) {
  14221. (function (e) {
  14222. var f = function (a) {
  14223. function b() {
  14224. a.call(this);
  14225. this._horizontalAlign = d.HorizontalAlign.LEFT;
  14226. this._verticalAlign = d.VerticalAlign.TOP;
  14227. this._gap = 6;
  14228. this._padding = 0;
  14229. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  14230. this.elementSizeTable = [];
  14231. this.endIndex = this.startIndex = -1;
  14232. this.indexInViewCalculated = !1;
  14233. this.maxElementHeight = 0
  14234. }
  14235. __extends(b, a);
  14236. Object.defineProperty(b.prototype, "horizontalAlign", {
  14237. get : function () {
  14238. return this._horizontalAlign
  14239. },
  14240. set : function (a) {
  14241. this._horizontalAlign !=
  14242. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  14243. },
  14244. enumerable : !0,
  14245. configurable : !0
  14246. });
  14247. Object.defineProperty(b.prototype, "verticalAlign", {
  14248. get : function () {
  14249. return this._verticalAlign
  14250. },
  14251. set : function (a) {
  14252. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  14253. },
  14254. enumerable : !0,
  14255. configurable : !0
  14256. });
  14257. Object.defineProperty(b.prototype, "gap", {
  14258. get : function () {
  14259. return this._gap
  14260. },
  14261. set : function (a) {
  14262. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  14263. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  14264. },
  14265. enumerable : !0,
  14266. configurable : !0
  14267. });
  14268. Object.defineProperty(b.prototype, "padding", {
  14269. get : function () {
  14270. return this._padding
  14271. },
  14272. set : function (a) {
  14273. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  14274. },
  14275. enumerable : !0,
  14276. configurable : !0
  14277. });
  14278. Object.defineProperty(b.prototype, "paddingLeft", {
  14279. get : function () {
  14280. return this._paddingLeft
  14281. },
  14282. set : function (a) {
  14283. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  14284. },
  14285. enumerable : !0,
  14286. configurable : !0
  14287. });
  14288. Object.defineProperty(b.prototype, "paddingRight", {
  14289. get : function () {
  14290. return this._paddingRight
  14291. },
  14292. set : function (a) {
  14293. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  14294. },
  14295. enumerable : !0,
  14296. configurable : !0
  14297. });
  14298. Object.defineProperty(b.prototype, "paddingTop", {
  14299. get : function () {
  14300. return this._paddingTop
  14301. },
  14302. set : function (a) {
  14303. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  14304. },
  14305. enumerable : !0,
  14306. configurable : !0
  14307. });
  14308. Object.defineProperty(b.prototype,
  14309. "paddingBottom", {
  14310. get : function () {
  14311. return this._paddingBottom
  14312. },
  14313. set : function (a) {
  14314. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  14315. },
  14316. enumerable : !0,
  14317. configurable : !0
  14318. });
  14319. b.prototype.invalidateTargetSizeAndDisplayList = function () {
  14320. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  14321. };
  14322. b.prototype.measure = function () {
  14323. a.prototype.measure.call(this);
  14324. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  14325. };
  14326. b.prototype.measureVirtual =
  14327. function () {
  14328. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, c = this.getElementTotalSize(), a = Math.max(this.maxElementHeight, a), d = this.target.getElementIndicesInView(), e = d.length, f = 0; f < e; f++) {
  14329. var k = d[f],
  14330. n = this.target.getElementAt(k);
  14331. if (null != n && n.includeInLayout)
  14332. var q = n.preferredHeight, c = c + n.preferredWidth, c = c - (isNaN(this.elementSizeTable[k]) ? b : this.elementSizeTable[k]), a = Math.max(a, q)
  14333. }
  14334. f = isNaN(this._padding) ? 0 : this._padding;
  14335. b =
  14336. isNaN(this._paddingLeft) ? f : this._paddingLeft;
  14337. d = isNaN(this._paddingRight) ? f : this._paddingRight;
  14338. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  14339. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  14340. e += f;
  14341. this.target.measuredWidth = Math.ceil(c + (b + d));
  14342. this.target.measuredHeight = Math.ceil(a + e)
  14343. };
  14344. b.prototype.measureReal = function () {
  14345. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  14346. var f = this.target.getElementAt(e);
  14347. if (f && f.includeInLayout)
  14348. var k = f.preferredHeight, c = c + f.preferredWidth, d = Math.max(d, k);
  14349. else
  14350. b--
  14351. }
  14352. a =
  14353. isNaN(this._gap) ? 0 : this._gap;
  14354. c += (b - 1) * a;
  14355. f = isNaN(this._padding) ? 0 : this._padding;
  14356. b = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  14357. a = isNaN(this._paddingRight) ? f : this._paddingRight;
  14358. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  14359. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  14360. e += f;
  14361. this.target.measuredWidth = Math.ceil(c + (b + a));
  14362. this.target.measuredHeight = Math.ceil(d + e)
  14363. };
  14364. b.prototype.updateDisplayList = function (b, c) {
  14365. a.prototype.updateDisplayList.call(this, b, c);
  14366. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  14367. c) : this.updateDisplayListReal(b, c))
  14368. };
  14369. b.prototype.getStartPosition = function (a) {
  14370. var b = isNaN(this._padding) ? 0 : this._padding,
  14371. c = isNaN(this._paddingLeft) ? b : this._paddingLeft,
  14372. b = isNaN(this._gap) ? 0 : this._gap;
  14373. if (!this.useVirtualLayout) {
  14374. var d;
  14375. this.target && (d = this.target.getElementAt(a));
  14376. return d ? d.x : c
  14377. }
  14378. d = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71;
  14379. for (var e = 0; e < a; e++) {
  14380. var f = this.elementSizeTable[e];
  14381. isNaN(f) && (f = d);
  14382. c += f + b
  14383. }
  14384. return c
  14385. };
  14386. b.prototype.getElementSize = function (a) {
  14387. return this.useVirtualLayout ?
  14388. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), a) : this.target ? this.target.getElementAt(a).width : 0
  14389. };
  14390. b.prototype.getElementTotalSize = function () {
  14391. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, b = isNaN(this._gap) ? 0 : this._gap, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  14392. var f = this.elementSizeTable[e];
  14393. isNaN(f) && (f = a);
  14394. c += f + b
  14395. }
  14396. return c - b
  14397. };
  14398. b.prototype.elementAdded = function (b) {
  14399. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b,
  14400. 0, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71))
  14401. };
  14402. b.prototype.elementRemoved = function (b) {
  14403. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  14404. };
  14405. b.prototype.clearVirtualLayoutCache = function () {
  14406. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  14407. };
  14408. b.prototype.findIndexAt = function (a, b, c) {
  14409. var d = Math.floor(0.5 * (b + c)),
  14410. e = this.getStartPosition(d),
  14411. f = this.getElementSize(d),
  14412. k = isNaN(this._gap) ?
  14413. 0 : this._gap;
  14414. return a >= e && a < e + f + k ? d : b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  14415. };
  14416. b.prototype.scrollPositionChanged = function () {
  14417. a.prototype.scrollPositionChanged.call(this);
  14418. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  14419. };
  14420. b.prototype.getIndexInView = function () {
  14421. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height)
  14422. return this.startIndex =
  14423. this.endIndex = -1, !1;
  14424. var a = isNaN(this._padding) ? 0 : this._padding,
  14425. b = isNaN(this._paddingLeft) ? a : this._paddingLeft,
  14426. c = isNaN(this._paddingRight) ? a : this._paddingRight;
  14427. isNaN(this._paddingTop);
  14428. isNaN(this._paddingBottom);
  14429. var a = this.target.numElements,
  14430. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  14431. e = this.target.horizontalScrollPosition;
  14432. if (e > d - c)
  14433. return this.endIndex = this.startIndex = -1, !1;
  14434. c = this.target.horizontalScrollPosition + this.target.width;
  14435. if (c < b)
  14436. return this.endIndex = this.startIndex = -1, !1;
  14437. b = this.startIndex;
  14438. d = this.endIndex;
  14439. this.startIndex = this.findIndexAt(e, 0, a - 1);
  14440. -1 == this.startIndex && (this.startIndex = 0);
  14441. this.endIndex = this.findIndexAt(c, 0, a - 1);
  14442. -1 == this.endIndex && (this.endIndex = a - 1);
  14443. return b != this.startIndex || d != this.endIndex
  14444. };
  14445. b.prototype.updateDisplayListVirtual = function (a, b) {
  14446. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  14447. var c = isNaN(this._padding) ? 0 : this._padding,
  14448. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  14449. f = isNaN(this._paddingTop) ? c : this._paddingTop,
  14450. l = isNaN(this._paddingBottom) ?
  14451. c : this._paddingBottom,
  14452. k = isNaN(this._gap) ? 0 : this._gap,
  14453. n = this.target.numElements;
  14454. if (-1 == this.startIndex || -1 == this.endIndex)
  14455. e = this.getStartPosition(n) - k + e, this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  14456. else {
  14457. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  14458. var q = this._verticalAlign == d.VerticalAlign.JUSTIFY || this._verticalAlign == d.VerticalAlign.CONTENT_JUSTIFY,
  14459. p = this._verticalAlign == d.VerticalAlign.CONTENT_JUSTIFY,
  14460. r = 0;
  14461. q || (this._verticalAlign == d.VerticalAlign.MIDDLE ?
  14462. r = 0.5 : this._verticalAlign == d.VerticalAlign.BOTTOM && (r = 1));
  14463. var x = Math.max(0, b - f - l),
  14464. z = Math.ceil(x),
  14465. v,
  14466. A = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71,
  14467. c = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, this.maxElementHeight);
  14468. if (p) {
  14469. for (var t = this.startIndex; t <= this.endIndex; t++)
  14470. (v = this.target.getVirtualElementAt(t)) && v.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight));
  14471. z = Math.ceil(Math.max(x, this.maxElementHeight))
  14472. }
  14473. for (var B = 0, w = 0, t = 0, E =
  14474. !1, D = this.startIndex; D <= this.endIndex; D++)
  14475. if (w = 0, v = this.target.getVirtualElementAt(D))
  14476. v.includeInLayout ? (q ? (w = f, v.setLayoutBoundsSize(NaN, z)) : (w = (x - v.layoutBoundsHeight) * r, w = 0 < w ? w : 0, w = f + w), p || (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight)), t = Math.max(t, v.layoutBoundsHeight), E || (B = isNaN(this.elementSizeTable[D]) ? A : this.elementSizeTable[D], B != v.layoutBoundsWidth && (E = !0)), 0 == D && 0 < this.elementSizeTable.length && this.elementSizeTable[D] != v.layoutBoundsWidth && (this.typicalLayoutRect =
  14477. null), this.elementSizeTable[D] = v.layoutBoundsWidth, B = this.getStartPosition(D), v.setLayoutBoundsPosition(Math.round(B), Math.round(w))) : this.elementSizeTable[D] = 0;
  14478. t += f + l;
  14479. e = this.getStartPosition(n) - k + e;
  14480. this.target.setContentSize(Math.ceil(e), Math.ceil(t));
  14481. (E || c < this.maxElementHeight) && this.target.invalidateSize()
  14482. }
  14483. };
  14484. b.prototype.updateDisplayListReal = function (a, e) {
  14485. var f = isNaN(this._padding) ? 0 : this._padding,
  14486. h = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  14487. g = isNaN(this._paddingRight) ? f : this._paddingRight,
  14488. l = isNaN(this._paddingTop) ? f : this._paddingTop,
  14489. f = isNaN(this._paddingBottom) ? f : this._paddingBottom,
  14490. k = isNaN(this._gap) ? 0 : this._gap,
  14491. n = Math.max(0, a - h - g),
  14492. q = Math.max(0, e - l - f),
  14493. p = this._horizontalAlign == d.HorizontalAlign.JUSTIFY,
  14494. r = this._verticalAlign == d.VerticalAlign.JUSTIFY || this._verticalAlign == d.VerticalAlign.CONTENT_JUSTIFY,
  14495. x = 0;
  14496. r || (this._verticalAlign == d.VerticalAlign.MIDDLE ? x = 0.5 : this._verticalAlign == d.VerticalAlign.BOTTOM && (x = 1));
  14497. var z = this.target.numElements,
  14498. v = z,
  14499. A = h,
  14500. t = l,
  14501. B,
  14502. w,
  14503. E = 0,
  14504. t = 0,
  14505. D = [],
  14506. C,
  14507. s = n;
  14508. for (B = 0; B <
  14509. z; B++)
  14510. (w = this.target.getElementAt(B)) && w.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, w.preferredHeight), p ? E += w.preferredWidth : isNaN(w.percentWidth) ? s -= w.preferredWidth : (t += w.percentWidth, C = new c, C.layoutElement = w, C.percent = w.percentWidth, C.min = w.minWidth, C.max = w.maxWidth, D.push(C))) : v--;
  14511. var s = s - k * (v - 1),
  14512. s = 0 < s ? s : 0,
  14513. J = n - E - k * (v - 1),
  14514. L,
  14515. G = v,
  14516. I = [];
  14517. if (p) {
  14518. if (0 > J) {
  14519. L = s / v;
  14520. for (B = 0; B < z; B++)
  14521. (w = this.target.getElementAt(B)) && w.includeInLayout && (w = w.preferredWidth, w <= L && (s -= w, G--));
  14522. s = 0 < s ? s : 0
  14523. }
  14524. } else if (0 <
  14525. t) {
  14526. b.flexChildrenProportionally(n, s, t, D);
  14527. n = 0;
  14528. w = D.length;
  14529. for (B = 0; B < w; B++)
  14530. C = D[B], t = Math.round(C.size + n), n += C.size - t, I[C.layoutElement.hashCode] = t, s -= t;
  14531. s = 0 < s ? s : 0
  14532. }
  14533. this._horizontalAlign == d.HorizontalAlign.CENTER ? A = h + 0.5 * s : this._horizontalAlign == d.HorizontalAlign.RIGHT && (A = h + s);
  14534. D = l;
  14535. w = v = 0;
  14536. C = Math.ceil(q);
  14537. this._verticalAlign == d.VerticalAlign.CONTENT_JUSTIFY && (C = Math.ceil(Math.max(q, this.maxElementHeight)));
  14538. for (B = n = 0; B < z; B++)
  14539. t = 0, (w = this.target.getElementAt(B)) && w.includeInLayout && (v = NaN, p ? (t = NaN, 0 < J ? t = s * w.preferredWidth /
  14540. E : 0 > J && w.preferredWidth > L && (t = s / G), isNaN(t) || (v = Math.round(t + n), n += t - v)) : v = I[w.hashCode], r ? (t = l, w.setLayoutBoundsSize(v, C)) : (t = NaN, isNaN(w.percentHeight) || (t = Math.min(100, w.percentHeight), t = Math.round(q * t * 0.01)), w.setLayoutBoundsSize(v, t), t = (q - w.layoutBoundsHeight) * x, t = 0 < t ? t : 0, t = l + t), w.setLayoutBoundsPosition(Math.round(A), Math.round(t)), v = Math.ceil(w.layoutBoundsWidth), w = Math.ceil(w.layoutBoundsHeight), h = Math.max(h, A + v), D = Math.max(D, t + w), A += v + k);
  14541. this.target.setContentSize(Math.ceil(h + g), Math.ceil(D +
  14542. f))
  14543. };
  14544. b.flexChildrenProportionally = function (a, b, c, d) {
  14545. var e = d.length,
  14546. f;
  14547. do {
  14548. f = !0;
  14549. var k = b - a * c / 100;
  14550. 0 < k ? b -= k : k = 0;
  14551. for (var n = b / c, q = 0; q < e; q++) {
  14552. var p = d[q],
  14553. r = p.percent * n;
  14554. if (r < p.min) {
  14555. f = p.min;
  14556. p.size = f;
  14557. d[q] = d[--e];
  14558. d[e] = p;
  14559. c -= p.percent;
  14560. k >= f || (b -= f - k);
  14561. f = !1;
  14562. break
  14563. } else if (r > p.max) {
  14564. f = p.max;
  14565. p.size = f;
  14566. d[q] = d[--e];
  14567. d[e] = p;
  14568. c -= p.percent;
  14569. k >= f || (b -= f - k);
  14570. f = !1;
  14571. break
  14572. } else
  14573. p.size = r
  14574. }
  14575. } while (!f)
  14576. };
  14577. return b
  14578. }
  14579. (e.LayoutBase);
  14580. e.HorizontalLayout = f;
  14581. f.prototype.__class__ = "egret.gui.HorizontalLayout";
  14582. var c = function () {
  14583. return function () {
  14584. this.size =
  14585. 0
  14586. }
  14587. }
  14588. ();
  14589. c.prototype.__class__ = "ChildInfo"
  14590. })(d.gui || (d.gui = {}))
  14591. })(egret || (egret = {}));
  14592. __extends = this.__extends || function (d, e) {
  14593. function f() {
  14594. this.constructor = d
  14595. }
  14596. for (var c in e)
  14597. e.hasOwnProperty(c) && (d[c] = e[c]);
  14598. f.prototype = e.prototype;
  14599. d.prototype = new f
  14600. };
  14601. (function (d) {
  14602. (function (e) {
  14603. var f = function (c) {
  14604. function a() {
  14605. c.call(this);
  14606. this.explicitHorizontalGap = NaN;
  14607. this._horizontalGap = 6;
  14608. this.explicitVerticalGap = NaN;
  14609. this._verticalGap = 6;
  14610. this._columnCount = -1;
  14611. this._requestedColumnCount = 0;
  14612. this._rowCount = -1;
  14613. this._requestedRowCount = 0;
  14614. this._rowHeight = this.explicitRowHeight = this._columnWidth = this.explicitColumnWidth = NaN;
  14615. this._padding = 0;
  14616. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  14617. this._horizontalAlign = d.HorizontalAlign.JUSTIFY;
  14618. this._verticalAlign =
  14619. d.VerticalAlign.JUSTIFY;
  14620. this._columnAlign = e.ColumnAlign.LEFT;
  14621. this._rowAlign = e.RowAlign.TOP;
  14622. this._orientation = e.TileOrientation.ROWS;
  14623. this.maxElementHeight = this.maxElementWidth = 0;
  14624. this.endIndex = this.startIndex = -1;
  14625. this.indexInViewCalculated = !1
  14626. }
  14627. __extends(a, c);
  14628. Object.defineProperty(a.prototype, "horizontalGap", {
  14629. get : function () {
  14630. return this._horizontalGap
  14631. },
  14632. set : function (a) {
  14633. a != this._horizontalGap && (this._horizontalGap = this.explicitHorizontalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") &&
  14634. this.dispatchEventWith("gapChanged"))
  14635. },
  14636. enumerable : !0,
  14637. configurable : !0
  14638. });
  14639. Object.defineProperty(a.prototype, "verticalGap", {
  14640. get : function () {
  14641. return this._verticalGap
  14642. },
  14643. set : function (a) {
  14644. a != this._verticalGap && (this._verticalGap = this.explicitVerticalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  14645. },
  14646. enumerable : !0,
  14647. configurable : !0
  14648. });
  14649. Object.defineProperty(a.prototype, "columnCount", {
  14650. get : function () {
  14651. return this._columnCount
  14652. },
  14653. enumerable : !0,
  14654. configurable : !0
  14655. });
  14656. Object.defineProperty(a.prototype, "requestedColumnCount", {
  14657. get : function () {
  14658. return this._requestedColumnCount
  14659. },
  14660. set : function (a) {
  14661. this._requestedColumnCount != a && (this._columnCount = this._requestedColumnCount = a, this.invalidateTargetSizeAndDisplayList())
  14662. },
  14663. enumerable : !0,
  14664. configurable : !0
  14665. });
  14666. Object.defineProperty(a.prototype, "rowCount", {
  14667. get : function () {
  14668. return this._rowCount
  14669. },
  14670. enumerable : !0,
  14671. configurable : !0
  14672. });
  14673. Object.defineProperty(a.prototype, "requestedRowCount", {
  14674. get : function () {
  14675. return this._requestedRowCount
  14676. },
  14677. set : function (a) {
  14678. this._requestedRowCount !=
  14679. a && (this._rowCount = this._requestedRowCount = a, this.invalidateTargetSizeAndDisplayList())
  14680. },
  14681. enumerable : !0,
  14682. configurable : !0
  14683. });
  14684. Object.defineProperty(a.prototype, "columnWidth", {
  14685. get : function () {
  14686. return this._columnWidth
  14687. },
  14688. set : function (a) {
  14689. a != this._columnWidth && (this._columnWidth = this.explicitColumnWidth = a, this.invalidateTargetSizeAndDisplayList())
  14690. },
  14691. enumerable : !0,
  14692. configurable : !0
  14693. });
  14694. Object.defineProperty(a.prototype, "rowHeight", {
  14695. get : function () {
  14696. return this._rowHeight
  14697. },
  14698. set : function (a) {
  14699. a != this._rowHeight && (this._rowHeight =
  14700. this.explicitRowHeight = a, this.invalidateTargetSizeAndDisplayList())
  14701. },
  14702. enumerable : !0,
  14703. configurable : !0
  14704. });
  14705. Object.defineProperty(a.prototype, "padding", {
  14706. get : function () {
  14707. return this._padding
  14708. },
  14709. set : function (a) {
  14710. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  14711. },
  14712. enumerable : !0,
  14713. configurable : !0
  14714. });
  14715. Object.defineProperty(a.prototype, "paddingLeft", {
  14716. get : function () {
  14717. return this._paddingLeft
  14718. },
  14719. set : function (a) {
  14720. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  14721. },
  14722. enumerable : !0,
  14723. configurable : !0
  14724. });
  14725. Object.defineProperty(a.prototype, "paddingRight", {
  14726. get : function () {
  14727. return this._paddingRight
  14728. },
  14729. set : function (a) {
  14730. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  14731. },
  14732. enumerable : !0,
  14733. configurable : !0
  14734. });
  14735. Object.defineProperty(a.prototype, "paddingTop", {
  14736. get : function () {
  14737. return this._paddingTop
  14738. },
  14739. set : function (a) {
  14740. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  14741. },
  14742. enumerable : !0,
  14743. configurable : !0
  14744. });
  14745. Object.defineProperty(a.prototype,
  14746. "paddingBottom", {
  14747. get : function () {
  14748. return this._paddingBottom
  14749. },
  14750. set : function (a) {
  14751. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  14752. },
  14753. enumerable : !0,
  14754. configurable : !0
  14755. });
  14756. Object.defineProperty(a.prototype, "horizontalAlign", {
  14757. get : function () {
  14758. return this._horizontalAlign
  14759. },
  14760. set : function (a) {
  14761. this._horizontalAlign != a && (this._horizontalAlign = a, this.invalidateTargetSizeAndDisplayList())
  14762. },
  14763. enumerable : !0,
  14764. configurable : !0
  14765. });
  14766. Object.defineProperty(a.prototype, "verticalAlign", {
  14767. get : function () {
  14768. return this._verticalAlign
  14769. },
  14770. set : function (a) {
  14771. this._verticalAlign != a && (this._verticalAlign = a, this.invalidateTargetSizeAndDisplayList())
  14772. },
  14773. enumerable : !0,
  14774. configurable : !0
  14775. });
  14776. Object.defineProperty(a.prototype, "columnAlign", {
  14777. get : function () {
  14778. return this._columnAlign
  14779. },
  14780. set : function (a) {
  14781. this._columnAlign != a && (this._columnAlign = a, this.invalidateTargetSizeAndDisplayList())
  14782. },
  14783. enumerable : !0,
  14784. configurable : !0
  14785. });
  14786. Object.defineProperty(a.prototype, "rowAlign", {
  14787. get : function () {
  14788. return this._rowAlign
  14789. },
  14790. set : function (a) {
  14791. this._rowAlign != a && (this._rowAlign = a,
  14792. this.invalidateTargetSizeAndDisplayList())
  14793. },
  14794. enumerable : !0,
  14795. configurable : !0
  14796. });
  14797. Object.defineProperty(a.prototype, "orientation", {
  14798. get : function () {
  14799. return this._orientation
  14800. },
  14801. set : function (a) {
  14802. this._orientation != a && (this._orientation = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("orientationChanged") && this.dispatchEventWith("orientationChanged"))
  14803. },
  14804. enumerable : !0,
  14805. configurable : !0
  14806. });
  14807. a.prototype.invalidateTargetSizeAndDisplayList = function () {
  14808. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  14809. };
  14810. a.prototype.measure = function () {
  14811. if (this.target) {
  14812. var a = this._columnCount,
  14813. c = this._rowCount,
  14814. d = this._columnWidth,
  14815. e = this._rowHeight,
  14816. f = 0,
  14817. g = 0;
  14818. this.calculateRowAndColumn(this.target.explicitWidth, this.target.explicitHeight);
  14819. var l = 0 < this._requestedColumnCount ? this._requestedColumnCount : this._columnCount,
  14820. k = 0 < this._requestedRowCount ? this._requestedRowCount : this._rowCount,
  14821. n = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14822. q = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14823. 0 < l && (f = l * (this._columnWidth + n) - n);
  14824. 0 < k && (g =
  14825. k * (this._rowHeight + q) - q);
  14826. q = isNaN(this._padding) ? 0 : this._padding;
  14827. l = isNaN(this._paddingLeft) ? q : this._paddingLeft;
  14828. k = isNaN(this._paddingRight) ? q : this._paddingRight;
  14829. n = isNaN(this._paddingTop) ? q : this._paddingTop;
  14830. q = isNaN(this._paddingBottom) ? q : this._paddingBottom;
  14831. n += q;
  14832. this.target.measuredWidth = Math.ceil(f + (l + k));
  14833. this.target.measuredHeight = Math.ceil(g + n);
  14834. this._columnCount = a;
  14835. this._rowCount = c;
  14836. this._columnWidth = d;
  14837. this._rowHeight = e
  14838. }
  14839. };
  14840. a.prototype.calculateRowAndColumn = function (a, c) {
  14841. var d = isNaN(this._horizontalGap) ?
  14842. 0 : this._horizontalGap,
  14843. f = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14844. this._rowCount = this._columnCount = -1;
  14845. for (var h = this.target.numElements, g = h, l = 0; l < g; l++) {
  14846. var k = this.target.getElementAt(l);
  14847. k && !k.includeInLayout && h--
  14848. }
  14849. if (0 == h)
  14850. this._rowCount = this._columnCount = 0;
  14851. else {
  14852. (isNaN(this.explicitColumnWidth) || isNaN(this.explicitRowHeight)) && this.updateMaxElementSize();
  14853. isNaN(this.explicitColumnWidth) ? this._columnWidth = this.maxElementWidth : this._columnWidth = this.explicitColumnWidth;
  14854. isNaN(this.explicitRowHeight) ?
  14855. this._rowHeight = this.maxElementHeight : this._rowHeight = this.explicitRowHeight;
  14856. g = this._columnWidth + d;
  14857. 0 >= g && (g = 1);
  14858. l = this._rowHeight + f;
  14859. 0 >= l && (l = 1);
  14860. var k = this.orientation == e.TileOrientation.COLUMNS,
  14861. n = !isNaN(a),
  14862. q = !isNaN(c),
  14863. p = isNaN(this._padding) ? 0 : this._padding,
  14864. r = isNaN(this._paddingLeft) ? p : this._paddingLeft,
  14865. x = isNaN(this._paddingRight) ? p : this._paddingRight,
  14866. z = isNaN(this._paddingTop) ? p : this._paddingTop,
  14867. p = isNaN(this._paddingBottom) ? p : this._paddingBottom;
  14868. 0 < this._requestedColumnCount || 0 < this._requestedRowCount ?
  14869. (0 < this._requestedRowCount && (this._rowCount = Math.min(this._requestedRowCount, h)), 0 < this._requestedColumnCount && (this._columnCount = Math.min(this._requestedColumnCount, h))) : n || q ? !n || q && k ? (d = Math.max(0, c - z - p), this._rowCount = Math.floor((d + f) / l), this._rowCount = Math.max(1, Math.min(this._rowCount, h))) : (f = Math.max(0, a - r - x), this._columnCount = Math.floor((f + d) / g), this._columnCount = Math.max(1, Math.min(this._columnCount, h))) : (d = Math.sqrt(h * g * l), k ? this._rowCount = Math.max(1, Math.round(d / l)) : this._columnCount = Math.max(1,
  14870. Math.round(d / g)));
  14871. -1 == this._rowCount && (this._rowCount = Math.max(1, Math.ceil(h / this._columnCount)));
  14872. -1 == this._columnCount && (this._columnCount = Math.max(1, Math.ceil(h / this._rowCount)));
  14873. 0 < this._requestedColumnCount && 0 < this._requestedRowCount && (this.orientation == e.TileOrientation.ROWS ? this._rowCount = Math.max(1, Math.ceil(h / this._requestedColumnCount)) : this._columnCount = Math.max(1, Math.ceil(h / this._requestedRowCount)))
  14874. }
  14875. };
  14876. a.prototype.updateMaxElementSize = function () {
  14877. this.target && (this.useVirtualLayout ? this.updateMaxElementSizeVirtual() :
  14878. this.updateMaxElementSizeReal())
  14879. };
  14880. a.prototype.updateMaxElementSizeVirtual = function () {
  14881. var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  14882. this.maxElementWidth = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 22);
  14883. this.maxElementHeight = Math.max(this.maxElementHeight, a);
  14884. if (-1 != this.startIndex && -1 != this.endIndex)
  14885. for (a = this.startIndex; a <= this.endIndex; a++) {
  14886. var c = this.target.getVirtualElementAt(a);
  14887. c && c.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth,
  14888. c.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, c.preferredHeight))
  14889. }
  14890. };
  14891. a.prototype.updateMaxElementSizeReal = function () {
  14892. for (var a = this.target.numElements, c = 0; c < a; c++) {
  14893. var d = this.target.getElementAt(c);
  14894. d && d.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, d.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, d.preferredHeight))
  14895. }
  14896. };
  14897. a.prototype.clearVirtualLayoutCache = function () {
  14898. c.prototype.clearVirtualLayoutCache.call(this);
  14899. this.maxElementHeight =
  14900. this.maxElementWidth = 0
  14901. };
  14902. a.prototype.scrollPositionChanged = function () {
  14903. c.prototype.scrollPositionChanged.call(this);
  14904. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  14905. };
  14906. a.prototype.getIndexInView = function () {
  14907. if (!this.target || 0 == this.target.numElements)
  14908. return this.startIndex = this.endIndex = -1, !1;
  14909. var a = this.target.numElements;
  14910. if (!this.useVirtualLayout)
  14911. return this.startIndex = 0, this.endIndex = a - 1, !1;
  14912. if (isNaN(this.target.width) || 0 == this.target.width ||
  14913. isNaN(this.target.height) || 0 == this.target.height)
  14914. return this.startIndex = this.endIndex = -1, !1;
  14915. var c = this.startIndex,
  14916. d = this.endIndex,
  14917. f = isNaN(this._padding) ? 0 : this._padding,
  14918. h = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  14919. f = isNaN(this._paddingTop) ? f : this._paddingTop,
  14920. g = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14921. l = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14922. if (this.orientation == e.TileOrientation.COLUMNS) {
  14923. g = this._columnWidth + g;
  14924. if (0 >= g)
  14925. return this.startIndex = 0, this.endIndex = a - 1, !1;
  14926. l = this.target.horizontalScrollPosition +
  14927. this.target.width;
  14928. f = Math.floor((this.target.horizontalScrollPosition - h) / g);
  14929. 0 > f && (f = 0);
  14930. h = Math.ceil((l - h) / g);
  14931. 0 > h && (h = 0);
  14932. this.startIndex = Math.min(a - 1, Math.max(0, f * this._rowCount));
  14933. this.endIndex = Math.min(a - 1, Math.max(0, h * this._rowCount - 1))
  14934. } else {
  14935. g = this._rowHeight + l;
  14936. if (0 >= g)
  14937. return this.startIndex = 0, this.endIndex = a - 1, !1;
  14938. l = this.target.verticalScrollPosition + this.target.height;
  14939. h = Math.floor((this.target.verticalScrollPosition - f) / g);
  14940. 0 > h && (h = 0);
  14941. f = Math.ceil((l - f) / g);
  14942. 0 > f && (f = 0);
  14943. this.startIndex = Math.min(a - 1, Math.max(0,
  14944. h * this._columnCount));
  14945. this.endIndex = Math.min(a - 1, Math.max(0, f * this._columnCount - 1))
  14946. }
  14947. return this.startIndex != c || this.endIndex != d
  14948. };
  14949. a.prototype.updateDisplayList = function (a, d) {
  14950. c.prototype.updateDisplayList.call(this, a, d);
  14951. if (this.target) {
  14952. var f = isNaN(this._padding) ? 0 : this._padding,
  14953. y = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  14954. h = isNaN(this._paddingRight) ? f : this._paddingRight,
  14955. g = isNaN(this._paddingTop) ? f : this._paddingTop,
  14956. l = isNaN(this._paddingBottom) ? f : this._paddingBottom,
  14957. f = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14958. k = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14959. if (this.indexInViewCalculated)
  14960. this.indexInViewCalculated = !1;
  14961. else {
  14962. this.calculateRowAndColumn(a, d);
  14963. if (0 == this._rowCount || 0 == this._columnCount) {
  14964. this.target.setContentSize(y + h, g + l);
  14965. return
  14966. }
  14967. this.adjustForJustify(a, d);
  14968. this.getIndexInView()
  14969. }
  14970. this.useVirtualLayout && (this.calculateRowAndColumn(a, d), this.adjustForJustify(a, d));
  14971. if (-1 == this.startIndex || -1 == this.endIndex)
  14972. this.target.setContentSize(0, 0);
  14973. else {
  14974. this.target.setVirtualElementIndicesInView(this.startIndex,
  14975. this.endIndex);
  14976. for (var n, q, p, r = this.orientation == e.TileOrientation.COLUMNS, x = this.startIndex, z = this.startIndex; z <= this.endIndex; z++)
  14977. n = this.useVirtualLayout ? this.target.getVirtualElementAt(z) : this.target.getElementAt(z), null != n && n.includeInLayout && (r ? (q = Math.ceil((x + 1) / this._rowCount) - 1, p = Math.ceil((x + 1) % this._rowCount) - 1, -1 == p && (p = this._rowCount - 1)) : (q = Math.ceil((x + 1) % this._columnCount) - 1, -1 == q && (q = this._columnCount - 1), p = Math.ceil((x + 1) / this._columnCount) - 1), q = q * (this._columnWidth + f) + y, p = p * (this._rowHeight +
  14978. k) + g, this.sizeAndPositionElement(n, q, p, this._columnWidth, this.rowHeight), x++);
  14979. g += l;
  14980. k = (this._rowHeight + k) * this._rowCount - k;
  14981. this.target.setContentSize(Math.ceil((this._columnWidth + f) * this._columnCount - f + (y + h)), Math.ceil(k + g))
  14982. }
  14983. }
  14984. };
  14985. a.prototype.sizeAndPositionElement = function (a, c, e, f, h) {
  14986. var g = NaN,
  14987. l = NaN;
  14988. this.horizontalAlign == d.HorizontalAlign.JUSTIFY ? g = f : isNaN(a.percentWidth) || (g = f * a.percentWidth * 0.01);
  14989. this.verticalAlign == d.VerticalAlign.JUSTIFY ? l = h : isNaN(a.percentHeight) || (l = h * a.percentHeight * 0.01);
  14990. a.setLayoutBoundsSize(Math.round(g),
  14991. Math.round(l));
  14992. g = c;
  14993. switch (this.horizontalAlign) {
  14994. case d.HorizontalAlign.RIGHT:
  14995. g += f - a.layoutBoundsWidth;
  14996. break;
  14997. case d.HorizontalAlign.CENTER:
  14998. g = c + (f - a.layoutBoundsWidth) / 2
  14999. }
  15000. c = e;
  15001. switch (this.verticalAlign) {
  15002. case d.VerticalAlign.BOTTOM:
  15003. c += h - a.layoutBoundsHeight;
  15004. break;
  15005. case d.VerticalAlign.MIDDLE:
  15006. c += (h - a.layoutBoundsHeight) / 2
  15007. }
  15008. a.setLayoutBoundsPosition(Math.round(g), Math.round(c))
  15009. };
  15010. a.prototype.adjustForJustify = function (a, c) {
  15011. var d = isNaN(this._padding) ? 0 : this._padding,
  15012. f = isNaN(this._paddingLeft) ? d : this._paddingLeft,
  15013. h = isNaN(this._paddingRight) ? d : this._paddingRight,
  15014. g = isNaN(this._paddingTop) ? d : this._paddingTop,
  15015. d = isNaN(this._paddingBottom) ? d : this._paddingBottom,
  15016. f = Math.max(0, a - f - h),
  15017. g = Math.max(0, c - g - d);
  15018. isNaN(this.explicitVerticalGap) || (this._verticalGap = this.explicitVerticalGap);
  15019. isNaN(this.explicitHorizontalGap) || (this._horizontalGap = this.explicitHorizontalGap);
  15020. this._verticalGap = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  15021. this._horizontalGap = isNaN(this._horizontalGap) ? 0 : this._horizontalGap;
  15022. g -= this._rowHeight * this._rowCount;
  15023. f -= this._columnWidth * this._columnCount;
  15024. 0 < g && (this.rowAlign == e.RowAlign.JUSTIFY_USING_GAP ? (h = Math.max(1, this._rowCount - 1), this._verticalGap = g / h) : this.rowAlign == e.RowAlign.JUSTIFY_USING_HEIGHT && 0 < this._rowCount && (this._rowHeight += (g - (this._rowCount - 1) * this._verticalGap) / this._rowCount));
  15025. 0 < f && (this.columnAlign == e.ColumnAlign.JUSTIFY_USING_GAP ? (h = Math.max(1, this._columnCount - 1), this._horizontalGap = f / h) : this.columnAlign == e.ColumnAlign.JUSTIFY_USING_WIDTH && 0 < this._columnCount && (this._columnWidth += (f - (this._columnCount -
  15026. 1) * this._horizontalGap) / this._columnCount))
  15027. };
  15028. return a
  15029. }
  15030. (e.LayoutBase);
  15031. e.TileLayout = f;
  15032. f.prototype.__class__ = "egret.gui.TileLayout"
  15033. })(d.gui || (d.gui = {}))
  15034. })(egret || (egret = {}));
  15035. (function (d) {
  15036. (function (d) {
  15037. var f = function () {
  15038. function c(a, b, c) {
  15039. this.raw_getElementAt = "raw_getElementAt";
  15040. this.raw_addElementAt = "raw_addElementAt";
  15041. this.raw_getElementIndex = "raw_getElementIndex";
  15042. this.raw_removeElement = "raw_removeElement";
  15043. this.raw_removeElementAt = "raw_removeElementAt";
  15044. this.raw_setElementIndex = "raw_setElementIndex";
  15045. this.owner = a;
  15046. this.lowerBoundReference = b;
  15047. this.upperBoundReference = c
  15048. }
  15049. Object.defineProperty(c.prototype, "numElements", {
  15050. get : function () {
  15051. return this.owner[this.upperBoundReference] -
  15052. this.owner[this.lowerBoundReference]
  15053. },
  15054. enumerable : !0,
  15055. configurable : !0
  15056. });
  15057. c.prototype.getElementAt = function (a) {
  15058. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  15059. };
  15060. c.prototype.addElement = function (a) {
  15061. var b = this.owner[this.upperBoundReference];
  15062. a.parent === this.owner && b--;
  15063. this.owner[this.upperBoundReference]++;
  15064. this.owner[this.raw_addElementAt](a, b);
  15065. a.ownerChanged(this);
  15066. return a
  15067. };
  15068. c.prototype.addElementAt = function (a, b) {
  15069. this.owner[this.upperBoundReference]++;
  15070. this.owner[this.raw_addElementAt](a,
  15071. this.owner[this.lowerBoundReference] + b);
  15072. a.ownerChanged(this);
  15073. return a
  15074. };
  15075. c.prototype.removeElement = function (a) {
  15076. var b = this.owner[this.raw_getElementIndex](a);
  15077. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  15078. a.ownerChanged(null);
  15079. return a
  15080. };
  15081. c.prototype.removeElementAt = function (a) {
  15082. a += this.owner[this.lowerBoundReference];
  15083. var b;
  15084. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] &&
  15085. (b = this.owner[this.raw_removeElementAt](a), this.owner[this.upperBoundReference]--);
  15086. b.ownerChanged(null);
  15087. return b
  15088. };
  15089. c.prototype.getElementIndex = function (a) {
  15090. a = this.owner[this.raw_getElementIndex](a);
  15091. return a -= this.owner[this.lowerBoundReference]
  15092. };
  15093. c.prototype.setElementIndex = function (a, b) {
  15094. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  15095. };
  15096. return c
  15097. }
  15098. ();
  15099. d.UILayer = f;
  15100. f.prototype.__class__ = "egret.gui.UILayer"
  15101. })(d.gui || (d.gui = {}))
  15102. })(egret || (egret = {}));
  15103. __extends = this.__extends || function (d, e) {
  15104. function f() {
  15105. this.constructor = d
  15106. }
  15107. for (var c in e)
  15108. e.hasOwnProperty(c) && (d[c] = e[c]);
  15109. f.prototype = e.prototype;
  15110. d.prototype = new f
  15111. };
  15112. (function (d) {
  15113. (function (e) {
  15114. var f = function (c) {
  15115. function a() {
  15116. c.call(this);
  15117. this._autoResize = !0;
  15118. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  15119. this.addEventListener(d.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  15120. this.addEventListener(d.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  15121. }
  15122. __extends(a, c);
  15123. a.prototype.onAddToStage = function (a) {
  15124. if (e.UIGlobals._uiStage)
  15125. throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");
  15126. e.UIGlobals._uiStage = this;
  15127. this._autoResize && (this.stage.addEventListener(d.Event.RESIZE, this.onResize, this), this.onResize())
  15128. };
  15129. a.prototype.onRemoveFromStage = function (a) {
  15130. e.UIGlobals._uiStage = null;
  15131. this._autoResize && this.stage.removeEventListener(d.Event.RESIZE, this.onResize, this)
  15132. };
  15133. a.prototype.onResize = function (a) {
  15134. this._setWidth(this.stage.stageWidth);
  15135. this._setHeight(this.stage.stageHeight)
  15136. };
  15137. Object.defineProperty(a.prototype, "autoResize", {
  15138. get : function () {
  15139. return this._autoResize
  15140. },
  15141. set : function (a) {
  15142. this._autoResize !=
  15143. a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(d.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(d.Event.RESIZE, this.onResize, this)))
  15144. },
  15145. enumerable : !0,
  15146. configurable : !0
  15147. });
  15148. Object.defineProperty(a.prototype, "x", {
  15149. get : function () {
  15150. return this._x
  15151. },
  15152. set : function (a) {
  15153. this._autoResize || (this._x = a)
  15154. },
  15155. enumerable : !0,
  15156. configurable : !0
  15157. });
  15158. Object.defineProperty(a.prototype, "y", {
  15159. get : function () {
  15160. return this._y
  15161. },
  15162. set : function (a) {
  15163. this._autoResize || (this._y = a)
  15164. },
  15165. enumerable : !0,
  15166. configurable : !0
  15167. });
  15168. Object.defineProperty(a.prototype, "width", {
  15169. get : function () {
  15170. return this._width
  15171. },
  15172. set : function (a) {
  15173. this._autoResize || this._setWidth(a)
  15174. },
  15175. enumerable : !0,
  15176. configurable : !0
  15177. });
  15178. Object.defineProperty(a.prototype, "height", {
  15179. get : function () {
  15180. return this._height
  15181. },
  15182. set : function (a) {
  15183. this._autoResize || this._setHeight(a)
  15184. },
  15185. enumerable : !0,
  15186. configurable : !0
  15187. });
  15188. Object.defineProperty(a.prototype, "scaleX", {
  15189. get : function () {
  15190. return this._scaleX
  15191. },
  15192. set : function (a) {
  15193. this._autoResize || this._setScaleX(a)
  15194. },
  15195. enumerable : !0,
  15196. configurable : !0
  15197. });
  15198. Object.defineProperty(a.prototype, "scaleY", {
  15199. get : function () {
  15200. return this._scaleY
  15201. },
  15202. set : function (a) {
  15203. this._autoResize || this._setScaleY(a)
  15204. },
  15205. enumerable : !0,
  15206. configurable : !0
  15207. });
  15208. a.prototype.setActualSize = function (a, d) {
  15209. this._autoResize || c.prototype.setActualSize.call(this, a, d)
  15210. };
  15211. a.prototype.setLayoutBoundsPosition = function (a, d) {
  15212. this._autoResize || c.prototype.setLayoutBoundsPosition.call(this, a, d)
  15213. };
  15214. a.prototype.setLayoutBoundsSize = function (a, d) {
  15215. this._autoResize || c.prototype.setLayoutBoundsSize.call(this,
  15216. a, d)
  15217. };
  15218. Object.defineProperty(a.prototype, "layout", {
  15219. get : function () {
  15220. return this._layout
  15221. },
  15222. set : function (a) {
  15223. a instanceof e.BasicLayout && this._setLayout(a)
  15224. },
  15225. enumerable : !0,
  15226. configurable : !0
  15227. });
  15228. Object.defineProperty(a.prototype, "popUpContainer", {
  15229. get : function () {
  15230. this._popUpContainer || (this._popUpContainer = new e.UILayer(this, "noTopMostIndex", "topMostIndex"));
  15231. return this._popUpContainer
  15232. },
  15233. enumerable : !0,
  15234. configurable : !0
  15235. });
  15236. Object.defineProperty(a.prototype, "toolTipContainer", {
  15237. get : function () {
  15238. this._toolTipContainer || (this._toolTipContainer =
  15239. new e.UILayer(this, "topMostIndex", "toolTipIndex"));
  15240. return this._toolTipContainer
  15241. },
  15242. enumerable : !0,
  15243. configurable : !0
  15244. });
  15245. Object.defineProperty(a.prototype, "cursorContainer", {
  15246. get : function () {
  15247. this._cursorContainer || (this._cursorContainer = new e.UILayer(this, "toolTipIndex", "cursorIndex"));
  15248. return this._cursorContainer
  15249. },
  15250. enumerable : !0,
  15251. configurable : !0
  15252. });
  15253. Object.defineProperty(a.prototype, "noTopMostIndex", {
  15254. get : function () {
  15255. return this._noTopMostIndex
  15256. },
  15257. set : function (a) {
  15258. var c = a - this._noTopMostIndex;
  15259. this._noTopMostIndex =
  15260. a;
  15261. this.topMostIndex += c
  15262. },
  15263. enumerable : !0,
  15264. configurable : !0
  15265. });
  15266. Object.defineProperty(a.prototype, "topMostIndex", {
  15267. get : function () {
  15268. return this._topMostIndex
  15269. },
  15270. set : function (a) {
  15271. var c = a - this._topMostIndex;
  15272. this._topMostIndex = a;
  15273. this.toolTipIndex += c
  15274. },
  15275. enumerable : !0,
  15276. configurable : !0
  15277. });
  15278. Object.defineProperty(a.prototype, "toolTipIndex", {
  15279. get : function () {
  15280. return this._toolTipIndex
  15281. },
  15282. set : function (a) {
  15283. var c = a - this._toolTipIndex;
  15284. this._toolTipIndex = a;
  15285. this.cursorIndex += c
  15286. },
  15287. enumerable : !0,
  15288. configurable : !0
  15289. });
  15290. Object.defineProperty(a.prototype,
  15291. "cursorIndex", {
  15292. get : function () {
  15293. return this._cursorIndex
  15294. },
  15295. set : function (a) {
  15296. this._cursorIndex = a
  15297. },
  15298. enumerable : !0,
  15299. configurable : !0
  15300. });
  15301. a.prototype.addElement = function (a) {
  15302. var c = this._noTopMostIndex;
  15303. a.parent == this && c--;
  15304. return this.addElementAt(a, c)
  15305. };
  15306. a.prototype.addElementAt = function (a, d) {
  15307. if (a.parent == this) {
  15308. var e = this.getElementIndex(a);
  15309. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- :
  15310. this.cursorIndex--
  15311. }
  15312. d <= this._noTopMostIndex ? this.noTopMostIndex++ : d > this._noTopMostIndex && d <= this._topMostIndex ? this.topMostIndex++ : d > this._topMostIndex && d <= this._toolTipIndex ? this.toolTipIndex++ : this.cursorIndex++;
  15313. return c.prototype.addElementAt.call(this, a, d)
  15314. };
  15315. a.prototype.removeElement = function (a) {
  15316. return this.removeElementAt(c.prototype.getElementIndex.call(this, a))
  15317. };
  15318. a.prototype.removeElementAt = function (a) {
  15319. var d = c.prototype.removeElementAt.call(this, a);
  15320. a < this._noTopMostIndex ? this.noTopMostIndex-- :
  15321. a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex-- : a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--;
  15322. return d
  15323. };
  15324. a.prototype.removeAllElements = function () {
  15325. for (; 0 < this._noTopMostIndex; )
  15326. c.prototype.removeElementAt.call(this, 0), this.noTopMostIndex--
  15327. };
  15328. a.prototype._elementRemoved = function (a, e, f) {
  15329. "undefined" === typeof f && (f = !0);
  15330. f && d.Event.dispatchEvent(a, "removeFromUIStage");
  15331. c.prototype._elementRemoved.call(this, a, e, f)
  15332. };
  15333. a.prototype.raw_getElementAt = function (a) {
  15334. return c.prototype.getElementAt.call(this,
  15335. a)
  15336. };
  15337. a.prototype.raw_addElement = function (a) {
  15338. var c = this.numElements;
  15339. a.parent == this && c--;
  15340. return this.raw_addElementAt(a, c)
  15341. };
  15342. a.prototype.raw_addElementAt = function (a, d) {
  15343. if (a.parent == this) {
  15344. var e = this.getElementIndex(a);
  15345. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  15346. }
  15347. return c.prototype.addElementAt.call(this, a, d)
  15348. };
  15349. a.prototype.raw_removeElement = function (a) {
  15350. return c.prototype.removeElementAt.call(this,
  15351. c.prototype.getElementIndex.call(this, a))
  15352. };
  15353. a.prototype.raw_removeElementAt = function (a) {
  15354. return c.prototype.removeElementAt.call(this, a)
  15355. };
  15356. a.prototype.raw_removeAllElements = function () {
  15357. for (; 0 < this.numElements; )
  15358. c.prototype.removeElementAt.call(this, 0)
  15359. };
  15360. a.prototype.raw_getElementIndex = function (a) {
  15361. return c.prototype.getElementIndex.call(this, a)
  15362. };
  15363. a.prototype.raw_setElementIndex = function (a, d) {
  15364. c.prototype.setElementIndex.call(this, a, d)
  15365. };
  15366. a.prototype.raw_swapElements = function (a, d) {
  15367. c.prototype.swapElementsAt.call(this,
  15368. c.prototype.getElementIndex.call(this, a), c.prototype.getElementIndex.call(this, d))
  15369. };
  15370. a.prototype.raw_swapElementsAt = function (a, d) {
  15371. c.prototype.swapElementsAt.call(this, a, d)
  15372. };
  15373. return a
  15374. }
  15375. (e.Group);
  15376. e.UIStage = f;
  15377. f.prototype.__class__ = "egret.gui.UIStage"
  15378. })(d.gui || (d.gui = {}))
  15379. })(egret || (egret = {}));
  15380. __extends = this.__extends || function (d, e) {
  15381. function f() {
  15382. this.constructor = d
  15383. }
  15384. for (var c in e)
  15385. e.hasOwnProperty(c) && (d[c] = e[c]);
  15386. f.prototype = e.prototype;
  15387. d.prototype = new f
  15388. };
  15389. (function (d) {
  15390. (function (e) {
  15391. var f = function (a) {
  15392. function b() {
  15393. a.call(this);
  15394. this._popUpList = [];
  15395. this.popUpDataList = [];
  15396. this._modalColor = 0;
  15397. this._modalAlpha = 0.5;
  15398. this.invalidateModalFlag = !1
  15399. }
  15400. __extends(b, a);
  15401. Object.defineProperty(b.prototype, "popUpList", {
  15402. get : function () {
  15403. return this._popUpList.concat()
  15404. },
  15405. enumerable : !0,
  15406. configurable : !0
  15407. });
  15408. b.prototype.findPopUpData = function (a) {
  15409. for (var b = this.popUpDataList, c = b.length, d = 0; d < c; d++) {
  15410. var e = b[d];
  15411. if (e.popUp == a)
  15412. return e
  15413. }
  15414. return null
  15415. };
  15416. b.prototype.addPopUp = function (a, d, f) {
  15417. "undefined" ===
  15418. typeof d && (d = !1);
  15419. "undefined" === typeof f && (f = !0);
  15420. var h = e.UIGlobals.uiStage,
  15421. g = this.findPopUpData(a);
  15422. g ? (g.modal = d, a.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (g = new c(a, d), this.popUpDataList.push(g), this._popUpList.push(a));
  15423. h.popUpContainer.addElement(a);
  15424. f && this.centerPopUp(a);
  15425. "isPopUp" in a && (a.isPopUp = !0);
  15426. d && this.invalidateModal();
  15427. a.addEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  15428. };
  15429. b.prototype.onRemoved = function (a) {
  15430. for (var c = 0, d = this.popUpDataList, e = d.length, f = 0; f < e; f++) {
  15431. var l =
  15432. d[f];
  15433. if (l.popUp == a.target) {
  15434. "isPopUp" in l.popUp && (l.popUp.isPopUp = !1);
  15435. l.popUp.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  15436. this.popUpDataList.splice(c, 1);
  15437. this._popUpList.splice(c, 1);
  15438. this.invalidateModal();
  15439. break
  15440. }
  15441. c++
  15442. }
  15443. };
  15444. Object.defineProperty(b.prototype, "modalColor", {
  15445. get : function () {
  15446. return this._modalColor
  15447. },
  15448. set : function (a) {
  15449. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  15450. },
  15451. enumerable : !0,
  15452. configurable : !0
  15453. });
  15454. Object.defineProperty(b.prototype, "modalAlpha", {
  15455. get : function () {
  15456. return this._modalAlpha
  15457. },
  15458. set : function (a) {
  15459. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  15460. },
  15461. enumerable : !0,
  15462. configurable : !0
  15463. });
  15464. b.prototype.invalidateModal = function () {
  15465. this.invalidateModalFlag || (this.invalidateModalFlag = !0, e.UIGlobals.stage.addEventListener(d.Event.ENTER_FRAME, this.validateModal, this), e.UIGlobals.stage.addEventListener(d.Event.RENDER, this.validateModal, this), e.UIGlobals.stage.invalidate())
  15466. };
  15467. b.prototype.validateModal = function (a) {
  15468. this.invalidateModalFlag = !1;
  15469. e.UIGlobals.stage.removeEventListener(d.Event.ENTER_FRAME,
  15470. this.validateModal, this);
  15471. e.UIGlobals.stage.removeEventListener(d.Event.RENDER, this.validateModal, this);
  15472. this.updateModal(e.UIGlobals.uiStage)
  15473. };
  15474. b.prototype.updateModal = function (a) {
  15475. for (var b = a.popUpContainer, c = !1, d = b.numElements - 1; 0 <= d; d--) {
  15476. var f = b.getElementAt(d);
  15477. if ((f = this.findPopUpData(f)) && f.modal) {
  15478. c = !0;
  15479. break
  15480. }
  15481. }
  15482. c ? (this.modalMask || (this.modalMask = new e.Rect, this.modalMask.touchEnabled = !0, this.modalMask.top = this.modalMask.left = this.modalMask.right = this.modalMask.bottom = 0), this.modalMask.fillColor = this._modalColor,
  15483. this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < d && d--, b.setElementIndex(this.modalMask, d)) : b.addElementAt(this.modalMask, d)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  15484. };
  15485. b.prototype.removePopUp = function (a) {
  15486. a && a.parent && this.findPopUpData(a) && ("removeElement" in a.parent ? a.parent.removeElement(a) : a.parent instanceof e.UIComponent ? a.parent._removeFromDisplayList(a) : a instanceof d.DisplayObject && a.parent.removeChild(a))
  15487. };
  15488. b.prototype.centerPopUp = function (a) {
  15489. a.top = a.bottom = a.left = a.right = NaN;
  15490. a.verticalCenter = a.horizontalCenter = 0;
  15491. var b = a.parent;
  15492. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  15493. };
  15494. b.prototype.bringToFront = function (a) {
  15495. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  15496. var b = a.parent;
  15497. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  15498. this.invalidateModal()
  15499. }
  15500. };
  15501. b.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  15502. return b
  15503. }
  15504. (d.EventDispatcher);
  15505. e.PopUpManagerImpl = f;
  15506. f.prototype.__class__ = "egret.gui.PopUpManagerImpl";
  15507. var c = function () {
  15508. return function (a, b) {
  15509. this.popUp = a;
  15510. this.modal = b
  15511. }
  15512. }
  15513. ();
  15514. c.prototype.__class__ = "PopUpData"
  15515. })(d.gui || (d.gui = {}))
  15516. })(egret || (egret = {}));
  15517. (function (d) {
  15518. (function (e) {
  15519. var f = function () {
  15520. function c() {}
  15521. c.getImpl = function () {
  15522. if (!c._impl)
  15523. try {
  15524. c._impl = d.Injector.getInstance("egret.gui.IPopUpManager")
  15525. } catch (a) {
  15526. c._impl = new e.PopUpManagerImpl
  15527. }
  15528. return c._impl
  15529. };
  15530. Object.defineProperty(c.prototype, "modalColor", {
  15531. get : function () {
  15532. return c.getImpl().modalColor
  15533. },
  15534. set : function (a) {
  15535. c.getImpl().modalColor = a
  15536. },
  15537. enumerable : !0,
  15538. configurable : !0
  15539. });
  15540. Object.defineProperty(c.prototype, "modalAlpha", {
  15541. get : function () {
  15542. return c.getImpl().modalAlpha
  15543. },
  15544. set : function (a) {
  15545. c.getImpl().modalAlpha =
  15546. a
  15547. },
  15548. enumerable : !0,
  15549. configurable : !0
  15550. });
  15551. c.addPopUp = function (a, b, d) {
  15552. "undefined" === typeof b && (b = !1);
  15553. "undefined" === typeof d && (d = !0);
  15554. c.getImpl().addPopUp(a, b, d);
  15555. e.PopUpEvent.dispatchPopUpEvent(c.getImpl(), e.PopUpEvent.ADD_POPUP, a, b)
  15556. };
  15557. c.removePopUp = function (a) {
  15558. c.getImpl().removePopUp(a);
  15559. e.PopUpEvent.dispatchPopUpEvent(c.getImpl(), e.PopUpEvent.REMOVE_POPUP, a)
  15560. };
  15561. c.centerPopUp = function (a) {
  15562. c.getImpl().centerPopUp(a)
  15563. };
  15564. c.bringToFront = function (a) {
  15565. c.getImpl().bringToFront(a);
  15566. e.PopUpEvent.dispatchPopUpEvent(c.getImpl(),
  15567. e.PopUpEvent.BRING_TO_FRONT, a)
  15568. };
  15569. Object.defineProperty(c, "popUpList", {
  15570. get : function () {
  15571. return c.getImpl().popUpList
  15572. },
  15573. enumerable : !0,
  15574. configurable : !0
  15575. });
  15576. c.addEventListener = function (a, b, d, e, f) {
  15577. "undefined" === typeof e && (e = !1);
  15578. "undefined" === typeof f && (f = 0);
  15579. c.getImpl().addEventListener(a, b, this, e, f)
  15580. };
  15581. c.removeEventListener = function (a, b, d, e) {
  15582. "undefined" === typeof e && (e = !1);
  15583. c.getImpl().removeEventListener(a, b, d, e)
  15584. };
  15585. return c
  15586. }
  15587. ();
  15588. e.PopUpManager = f;
  15589. f.prototype.__class__ = "egret.gui.PopUpManager"
  15590. })(d.gui || (d.gui = {}))
  15591. })(egret ||
  15592. (egret = {}));
  15593. var __extends = this.__extends || function (d, e) {
  15594. function f() {
  15595. this.constructor = d
  15596. }
  15597. for (var c in e)
  15598. e.hasOwnProperty(c) && (d[c] = e[c]);
  15599. f.prototype = e.prototype;
  15600. d.prototype = new f
  15601. }, dragonBones;
  15602. (function (d) {
  15603. (function (a) {
  15604. var b = function () {
  15605. function a(b, c) {
  15606. "undefined" === typeof b && (b = 0);
  15607. "undefined" === typeof c && (c = 0);
  15608. this.x = b;
  15609. this.y = c
  15610. }
  15611. a.prototype.toString = function () {
  15612. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  15613. };
  15614. return a
  15615. }
  15616. ();
  15617. a.Point = b;
  15618. b.prototype.__class__ = "dragonBones.geom.Point";
  15619. b = function () {
  15620. return function (a, b, c, d) {
  15621. "undefined" === typeof a && (a = 0);
  15622. "undefined" === typeof b && (b = 0);
  15623. "undefined" === typeof c && (c = 0);
  15624. "undefined" === typeof d && (d = 0);
  15625. this.x = a;
  15626. this.y = b;
  15627. this.width = c;
  15628. this.height = d
  15629. }
  15630. }
  15631. ();
  15632. a.Rectangle =
  15633. b;
  15634. b.prototype.__class__ = "dragonBones.geom.Rectangle";
  15635. b = function () {
  15636. function a() {
  15637. this.a = 1;
  15638. this.c = this.b = 0;
  15639. this.d = 1;
  15640. this.ty = this.tx = 0
  15641. }
  15642. a.prototype.invert = function () {
  15643. var a = this.a,
  15644. b = this.b,
  15645. c = this.c,
  15646. d = this.d,
  15647. e = this.tx,
  15648. f = a * d - b * c;
  15649. this.a = d / f;
  15650. this.b = -b / f;
  15651. this.c = -c / f;
  15652. this.d = a / f;
  15653. this.tx = (c * this.ty - d * e) / f;
  15654. this.ty = - (a * this.ty - b * e) / f
  15655. };
  15656. return a
  15657. }
  15658. ();
  15659. a.Matrix = b;
  15660. b.prototype.__class__ = "dragonBones.geom.Matrix";
  15661. b = function () {
  15662. return function () {
  15663. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset =
  15664. this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  15665. }
  15666. }
  15667. ();
  15668. a.ColorTransform = b;
  15669. b.prototype.__class__ = "dragonBones.geom.ColorTransform"
  15670. })(d.geom || (d.geom = {}));
  15671. var e = d.geom;
  15672. (function (a) {
  15673. var b = function () {
  15674. return function (a) {
  15675. this.type = a
  15676. }
  15677. }
  15678. ();
  15679. a.Event = b;
  15680. b.prototype.__class__ = "dragonBones.events.Event";
  15681. var c = function (a) {
  15682. function b(c) {
  15683. a.call(this, c)
  15684. }
  15685. __extends(b, a);
  15686. b.FADE_IN = "fadeIn";
  15687. b.FADE_OUT = "fadeOut";
  15688. b.START = "start";
  15689. b.COMPLETE = "complete";
  15690. b.LOOP_COMPLETE = "loopComplete";
  15691. b.FADE_IN_COMPLETE = "fadeInComplete";
  15692. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  15693. return b
  15694. }
  15695. (b);
  15696. a.AnimationEvent = c;
  15697. c.prototype.__class__ = "dragonBones.events.AnimationEvent";
  15698. c = function (a) {
  15699. function b(c) {
  15700. a.call(this, c)
  15701. }
  15702. __extends(b, a);
  15703. b.Z_ORDER_UPDATED = "zOrderUpdated";
  15704. return b
  15705. }
  15706. (b);
  15707. a.ArmatureEvent = c;
  15708. c.prototype.__class__ = "dragonBones.events.ArmatureEvent";
  15709. c = function (a) {
  15710. function b(c) {
  15711. a.call(this, c)
  15712. }
  15713. __extends(b, a);
  15714. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  15715. b.BONE_FRAME_EVENT = "boneFrameEvent";
  15716. return b
  15717. }
  15718. (b);
  15719. a.FrameEvent = c;
  15720. c.prototype.__class__ = "dragonBones.events.FrameEvent";
  15721. b = function (a) {
  15722. function b(c) {
  15723. a.call(this, c)
  15724. }
  15725. __extends(b, a);
  15726. b.SOUND = "sound";
  15727. b.BONE_FRAME_EVENT = "boneFrameEvent";
  15728. return b
  15729. }
  15730. (b);
  15731. a.SoundEvent = b;
  15732. b.prototype.__class__ = "dragonBones.events.SoundEvent";
  15733. b = function () {
  15734. function a() {}
  15735. a.prototype.hasEventListener = function (a) {
  15736. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  15737. };
  15738. a.prototype.addEventListener = function (a, b) {
  15739. if (a && b) {
  15740. this._listenersMap || (this._listenersMap = {});
  15741. var c = this._listenersMap[a];
  15742. c && this.removeEventListener(a, b);
  15743. c ? c.push(b) : this._listenersMap[a] =
  15744. [b]
  15745. }
  15746. };
  15747. a.prototype.removeEventListener = function (a, b) {
  15748. if (this._listenersMap && a && b) {
  15749. var c = this._listenersMap[a];
  15750. if (c)
  15751. for (var d = c.length, e = 0; e < d; e++)
  15752. c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  15753. }
  15754. };
  15755. a.prototype.removeAllEventListeners = function (a) {
  15756. a ? delete this._listenersMap[a] : this._listenersMap = null
  15757. };
  15758. a.prototype.dispatchEvent = function (a) {
  15759. if (a) {
  15760. var b = this._listenersMap[a.type];
  15761. if (b) {
  15762. a.target = this;
  15763. for (var c = b.concat(), b = b.length, d = 0; d < b; d++)
  15764. c[d](a)
  15765. }
  15766. }
  15767. };
  15768. return a
  15769. }
  15770. ();
  15771. a.EventDispatcher =
  15772. b;
  15773. b.prototype.__class__ = "dragonBones.events.EventDispatcher";
  15774. b = function (a) {
  15775. function b() {
  15776. a.call(this);
  15777. if (b._instance)
  15778. throw Error("Singleton already constructed!");
  15779. }
  15780. __extends(b, a);
  15781. b.getInstance = function () {
  15782. b._instance || (b._instance = new b);
  15783. return b._instance
  15784. };
  15785. return b
  15786. }
  15787. (b);
  15788. a.SoundEventManager = b;
  15789. b.prototype.__class__ = "dragonBones.events.SoundEventManager"
  15790. })(d.events || (d.events = {}));
  15791. var f = d.events;
  15792. (function (c) {
  15793. var d = function () {
  15794. function a() {
  15795. this.timeScale = 1;
  15796. this.time = 0.001 * (new Date).getTime();
  15797. this._animatableList =
  15798. []
  15799. }
  15800. a.prototype.contains = function (a) {
  15801. return 0 <= this._animatableList.indexOf(a)
  15802. };
  15803. a.prototype.add = function (a) {
  15804. a && -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  15805. };
  15806. a.prototype.remove = function (a) {
  15807. a = this._animatableList.indexOf(a);
  15808. 0 <= a && (this._animatableList[a] = null)
  15809. };
  15810. a.prototype.clear = function () {
  15811. this._animatableList.length = 0
  15812. };
  15813. a.prototype.advanceTime = function (a) {
  15814. if (0 > a) {
  15815. var b = 0.001 * (new Date).getTime();
  15816. a = b - this.time;
  15817. this.time = b
  15818. }
  15819. a *= this.timeScale;
  15820. b = this._animatableList.length;
  15821. if (0 != b) {
  15822. for (var c =
  15823. 0, d = 0; d < b; d++) {
  15824. var e = this._animatableList[d];
  15825. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] = null), e.advanceTime(a), c++)
  15826. }
  15827. if (c != d) {
  15828. for (b = this._animatableList.length; d < b; )
  15829. this._animatableList[c++] = this._animatableList[d++];
  15830. this._animatableList.length = c
  15831. }
  15832. }
  15833. };
  15834. a.clock = new a;
  15835. return a
  15836. }
  15837. ();
  15838. c.WorldClock = d;
  15839. d.prototype.__class__ = "dragonBones.animation.WorldClock";
  15840. var k = function () {
  15841. function c() {
  15842. this.transform = new a.DBTransform;
  15843. this.pivot = new e.Point;
  15844. this._durationTransform = new a.DBTransform;
  15845. this._durationPivot =
  15846. new e.Point;
  15847. this._durationColor = new e.ColorTransform
  15848. }
  15849. c._borrowObject = function () {
  15850. return 0 == c._pool.length ? new c : c._pool.pop()
  15851. };
  15852. c._returnObject = function (a) {
  15853. 0 > c._pool.indexOf(a) && (c._pool[c._pool.length] = a);
  15854. a.clear()
  15855. };
  15856. c._clear = function () {
  15857. for (var a = c._pool.length; a--; )
  15858. c._pool[a].clear();
  15859. c._pool.length = 0
  15860. };
  15861. c.getEaseValue = function (a, b) {
  15862. if (1 < b) {
  15863. var d = 0.5 * (1 - Math.cos(a * Math.PI)) - a;
  15864. b -= 1
  15865. } else
  15866. 0 < b ? d = Math.sin(a * c.HALF_PI) - a : 0 > b && (d = 1 - Math.cos(a * c.HALF_PI) - a, b *= -1);
  15867. return d * b + a
  15868. };
  15869. c.prototype.fadeIn = function (a, b,
  15870. c) {
  15871. this._bone = a;
  15872. this._animationState = b;
  15873. this._timeline = c;
  15874. this._originTransform = this._timeline.originTransform;
  15875. this._originPivot = this._timeline.originPivot;
  15876. this._tweenColor = this._tweenTransform = !1;
  15877. this._totalTime = this._animationState.totalTime;
  15878. this.transform.x = 0;
  15879. this.transform.y = 0;
  15880. this.transform.scaleX = 0;
  15881. this.transform.scaleY = 0;
  15882. this.transform.skewX = 0;
  15883. this.transform.skewY = 0;
  15884. this.pivot.x = 0;
  15885. this.pivot.y = 0;
  15886. this._durationTransform.x = 0;
  15887. this._durationTransform.y = 0;
  15888. this._durationTransform.scaleX = 0;
  15889. this._durationTransform.scaleY =
  15890. 0;
  15891. this._durationTransform.skewX = 0;
  15892. this._durationTransform.skewY = 0;
  15893. this._durationPivot.x = 0;
  15894. this._durationPivot.y = 0;
  15895. this._currentFrame = null;
  15896. switch (this._timeline.getFrameList().length) {
  15897. case 0:
  15898. this._bone._arriveAtFrame(null, this, this._animationState, !1);
  15899. this._updateState = 0;
  15900. break;
  15901. case 1:
  15902. this._updateState = -1;
  15903. break;
  15904. default:
  15905. this._updateState = 1
  15906. }
  15907. };
  15908. c.prototype.fadeOut = function () {
  15909. this.transform.skewX = b.TransformUtil.formatRadian(this.transform.skewX);
  15910. this.transform.skewY = b.TransformUtil.formatRadian(this.transform.skewY)
  15911. };
  15912. c.prototype.update = function (a) {
  15913. if (this._updateState)
  15914. if (0 < this._updateState) {
  15915. a = 0 == this._timeline.scale ? 1 : a / this._timeline.scale;
  15916. 1 == a && (a = 0.99999999);
  15917. a += this._timeline.offset;
  15918. var d = Math.floor(a);
  15919. a -= d;
  15920. for (var e = this._totalTime * a, f = !1, k; !this._currentFrame || e > this._currentFramePosition + this._currentFrameDuration || e < this._currentFramePosition; )
  15921. f && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0), f = !0, this._currentFrame ? (k = this._timeline.getFrameList().indexOf(this._currentFrame) +
  15922. 1, k >= this._timeline.getFrameList().length && (k = 0), this._currentFrame = this._timeline.getFrameList()[k]) : (k = 0, this._currentFrame = this._timeline.getFrameList()[0]), this._currentFrameDuration = this._currentFrame.duration, this._currentFramePosition = this._currentFrame.position;
  15923. 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) -
  15924. 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + d - this._timeline.offset) * 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 :
  15925. (this._durationTransform.x = f.transform.x - this._currentFrame.transform.x, this._durationTransform.y = f.transform.y - 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 =
  15926. b.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = b.TransformUtil.formatRadian(this._durationTransform.skewY)), 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 ||
  15927. 0 != this._durationPivot.y ? !0 : !1, this._currentFrame.color && f.color ? (this._durationColor.alphaOffset = f.color.alphaOffset - this._currentFrame.color.alphaOffset, 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,
  15928. this._durationColor.redMultiplier = f.color.redMultiplier - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = f.color.greenMultiplier - 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 ||
  15929. 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 =
  15930. 1 - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = 1 - this._currentFrame.color.greenMultiplier, 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 =
  15931. f.color.redMultiplier - 1, this._durationColor.greenMultiplier = f.color.greenMultiplier - 1, this._durationColor.blueMultiplier = 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,
  15932. this.transform.scaleX = this._originTransform.scaleX + this._currentFrame.transform.scaleX, this.transform.scaleY = 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,
  15933. this.transform.scaleX = this._currentFrame.transform.scaleX, this.transform.scaleY = this._currentFrame.transform.scaleY, 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,
  15934. this._currentFrame.color.blueMultiplier, !0) : this._bone._isColorChanged && this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1));
  15935. if (this._tweenTransform || this._tweenColor)
  15936. a = (e - this._currentFramePosition) / this._currentFrameDuration, this._tweenEasing && (a = c.getEaseValue(a, this._tweenEasing));
  15937. this._tweenTransform && (d = this._currentFrame.transform, e = this._currentFrame.pivot, this._animationState.blend ? (this.transform.x = this._originTransform.x +
  15938. d.x + this._durationTransform.x * a, this.transform.y = this._originTransform.y + d.y + this._durationTransform.y * a, this.transform.skewX = this._originTransform.skewX + d.skewX + this._durationTransform.skewX * a, this.transform.skewY = this._originTransform.skewY + d.skewY + this._durationTransform.skewY * a, this.transform.scaleX = this._originTransform.scaleX + d.scaleX + this._durationTransform.scaleX * a, this.transform.scaleY = this._originTransform.scaleY + d.scaleY + this._durationTransform.scaleY * a, this.pivot.x = this._originPivot.x +
  15939. e.x + this._durationPivot.x * a, this.pivot.y = this._originPivot.y + e.y + this._durationPivot.y * a) : (this.transform.x = d.x + this._durationTransform.x * a, this.transform.y = d.y + this._durationTransform.y * a, this.transform.skewX = d.skewX + this._durationTransform.skewX * a, this.transform.skewY = d.skewY + this._durationTransform.skewY * a, this.transform.scaleX = d.scaleX + this._durationTransform.scaleX * a, this.transform.scaleY = d.scaleY + this._durationTransform.scaleY * a, this.pivot.x = e.x + this._durationPivot.x * a, this.pivot.y = e.y + this._durationPivot.y *
  15940. a));
  15941. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset + 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 *
  15942. a, this._currentFrame.color.greenMultiplier + this._durationColor.greenMultiplier * a, this._currentFrame.color.blueMultiplier + 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))
  15943. } else
  15944. this._updateState =
  15945. 0, this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y = 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,
  15946. 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._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  15947. };
  15948. c.prototype.clear = function () {
  15949. this._updateState = 0;
  15950. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState =
  15951. this._bone = null
  15952. };
  15953. c.HALF_PI = 0.5 * Math.PI;
  15954. c._pool = [];
  15955. return c
  15956. }
  15957. ();
  15958. c.TimelineState = k;
  15959. k.prototype.__class__ = "dragonBones.animation.TimelineState";
  15960. var m = function () {
  15961. function a() {
  15962. this.layer = this.loop = 0;
  15963. this._timelineStates = {}
  15964. }
  15965. a._borrowObject = function () {
  15966. return 0 == a._pool.length ? new a : a._pool.pop()
  15967. };
  15968. a._returnObject = function (b) {
  15969. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  15970. b.clear()
  15971. };
  15972. a._clear = function () {
  15973. for (var b = a._pool.length; b--; )
  15974. a._pool[b].clear();
  15975. a._pool.length = 0
  15976. };
  15977. a.prototype.fadeIn = function (a, b, c, d,
  15978. e, f, k, m) {
  15979. this.layer = f;
  15980. this.clip = b;
  15981. this.name = this.clip.name;
  15982. this.totalTime = this.clip.duration;
  15983. this._armature = a;
  15984. 2 > Math.round(this.clip.duration * 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);
  15985. this._pauseBeforeFadeInComplete = m;
  15986. this._fadeInTime = c * this.timeScale;
  15987. this._fadeState = 1;
  15988. this._fadeOutBeginTime = 0;
  15989. this._fadeOutWeight = -1;
  15990. this._fadeWeight = 0;
  15991. this._fadeIn = !0;
  15992. this._fadeOut = !1;
  15993. this.loopCount =
  15994. -1;
  15995. this.displayControl = k;
  15996. this.isPlaying = !0;
  15997. this.isComplete = !1;
  15998. this.weight = 1;
  15999. this.tweenEnabled = this.enabled = this.blend = !0;
  16000. this.updateTimelineStates()
  16001. };
  16002. a.prototype.fadeOut = function (a, b) {
  16003. "undefined" === typeof b && (b = !1);
  16004. if (this._armature && !(0 <= this._fadeOutWeight)) {
  16005. this._fadeState = -1;
  16006. this._fadeOutWeight = this._fadeWeight;
  16007. this._fadeOutTime = a * this.timeScale;
  16008. this._fadeOutBeginTime = this.currentTime;
  16009. this._fadeOut = !0;
  16010. this.isPlaying = !b;
  16011. this.displayControl = !1;
  16012. for (var c in this._timelineStates)
  16013. this._timelineStates[c].fadeOut();
  16014. this.enabled = !0
  16015. }
  16016. };
  16017. a.prototype.play = function () {
  16018. this.isPlaying = !0
  16019. };
  16020. a.prototype.stop = function () {
  16021. this.isPlaying = !1
  16022. };
  16023. a.prototype.getMixingTransform = function (a) {
  16024. return this._mixingTransforms ? Number(this._mixingTransforms[a]) : -1
  16025. };
  16026. a.prototype.addMixingTransform = function (a, b, c) {
  16027. "undefined" === typeof b && (b = 2);
  16028. "undefined" === typeof c && (c = !0);
  16029. if (this.clip && this.clip.getTimeline(a)) {
  16030. this._mixingTransforms || (this._mixingTransforms = {});
  16031. if (c) {
  16032. c = this._armature._boneList.length;
  16033. for (var d, e; c--; )
  16034. d = this._armature._boneList[c],
  16035. d.name == a && (e = d), e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  16036. } else
  16037. this._mixingTransforms[a] = b;
  16038. this.updateTimelineStates()
  16039. } else
  16040. throw Error();
  16041. };
  16042. a.prototype.removeMixingTransform = function (a, b) {
  16043. "undefined" === typeof a && (a = null);
  16044. "undefined" === typeof b && (b = !0);
  16045. if (a) {
  16046. if (b)
  16047. for (var c = this._armature._boneList.length, d, e; c--; )
  16048. d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  16049. else
  16050. delete this._mixingTransforms[a];
  16051. for (var f in this._mixingTransforms) {
  16052. var k =
  16053. !0;
  16054. break
  16055. }
  16056. k || (this._mixingTransforms = null)
  16057. } else
  16058. this._mixingTransforms = null;
  16059. this.updateTimelineStates()
  16060. };
  16061. a.prototype.advanceTime = function (a) {
  16062. if (!this.enabled)
  16063. return !1;
  16064. var b,
  16065. c;
  16066. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(f.AnimationEvent.FADE_IN) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_IN), b.animationState = this, this._armature._eventList.push(b)));
  16067. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(f.AnimationEvent.FADE_OUT) && (b = new f.AnimationEvent(f.AnimationEvent.FADE_OUT),
  16068. b.animationState = this, this._armature._eventList.push(b)));
  16069. this.currentTime += a * this.timeScale;
  16070. if (this.isPlaying && !this.isComplete) {
  16071. var d;
  16072. if (this._pauseBeforeFadeInComplete)
  16073. this.isPlaying = this._pauseBeforeFadeInComplete = !1, a = 0, d = Math.floor(a);
  16074. 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)),
  16075. this.loopCount = d))
  16076. 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 = 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));
  16077. for (var e in this._timelineStates)
  16078. this._timelineStates[e].update(a);
  16079. b = this.clip.getFrameList();
  16080. if (0 < b.length) {
  16081. a = this.totalTime * (a - d);
  16082. for (d = !1; !this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position; )
  16083. d && this._armature._arriveAtFrame(this._currentFrame, 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];
  16084. d && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  16085. }
  16086. }
  16087. if (0 < this._fadeState)
  16088. 0 == this._fadeInTime ? (this._fadeWeight =
  16089. 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 = 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),
  16090. b.animationState = this, this._armature._eventList.push(b))));
  16091. else if (0 > this._fadeState) {
  16092. if (0 == this._fadeOutTime)
  16093. 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;
  16094. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  16095. if (0 >= this._fadeWeight)
  16096. return this._fadeState = this._fadeWeight =
  16097. 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
  16098. }
  16099. c && (this.isComplete = !0, 0 > this.loop && this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  16100. return !1
  16101. };
  16102. a.prototype.updateTimelineStates = function () {
  16103. if (this._mixingTransforms) {
  16104. for (var a in this._timelineStates)
  16105. null == this._mixingTransforms[a] && this.removeTimelineState(a);
  16106. for (a in this._mixingTransforms)
  16107. this._timelineStates[a] ||
  16108. this.addTimelineState(a)
  16109. } else
  16110. for (a in this.clip.getTimelines())
  16111. this._timelineStates[a] || this.addTimelineState(a)
  16112. };
  16113. a.prototype.addTimelineState = function (a) {
  16114. var b = this._armature.getBone(a);
  16115. if (b) {
  16116. var c = k._borrowObject(),
  16117. d = this.clip.getTimeline(a);
  16118. c.fadeIn(b, this, d);
  16119. this._timelineStates[a] = c
  16120. }
  16121. };
  16122. a.prototype.removeTimelineState = function (a) {
  16123. k._returnObject(this._timelineStates[a]);
  16124. delete this._timelineStates[a]
  16125. };
  16126. a.prototype.clear = function () {
  16127. this.clip = null;
  16128. this.enabled = !1;
  16129. this._mixingTransforms = this._currentFrame =
  16130. this._armature = null;
  16131. for (var a in this._timelineStates)
  16132. this.removeTimelineState(a)
  16133. };
  16134. a._pool = [];
  16135. return a
  16136. }
  16137. ();
  16138. c.AnimationState = m;
  16139. m.prototype.__class__ = "dragonBones.animation.AnimationState";
  16140. d = function () {
  16141. function a(b) {
  16142. this._armature = b;
  16143. this._animationLayer = [];
  16144. this._isPlaying = !1;
  16145. this.animationNameList = [];
  16146. this.tweenEnabled = !0;
  16147. this.timeScale = 1
  16148. }
  16149. a.prototype.getLastAnimationName = function () {
  16150. return this._lastAnimationState ? this._lastAnimationState.name : null
  16151. };
  16152. a.prototype.getLastAnimationState = function () {
  16153. return this._lastAnimationState
  16154. };
  16155. a.prototype.getAnimationDataList = function () {
  16156. return this._animationDataList
  16157. };
  16158. a.prototype.setAnimationDataList = function (a) {
  16159. this._animationDataList = a;
  16160. this.animationNameList.length = 0;
  16161. for (var b in this._animationDataList)
  16162. this.animationNameList[this.animationNameList.length] = this._animationDataList[b].name
  16163. };
  16164. a.prototype.getIsPlaying = function () {
  16165. return this._isPlaying && !this.getIsComplete()
  16166. };
  16167. a.prototype.getIsComplete = function () {
  16168. if (this._lastAnimationState) {
  16169. if (!this._lastAnimationState.isComplete)
  16170. return !1;
  16171. for (var a = this._animationLayer.length; a--; )
  16172. for (var b = this._animationLayer[a], c = b.length; c--; )
  16173. if (!b[c].isComplete)
  16174. return !1;
  16175. return !0
  16176. }
  16177. return !1
  16178. };
  16179. a.prototype.dispose = function () {
  16180. if (this._armature) {
  16181. this.stop();
  16182. for (var a = this._animationLayer.length; a--; ) {
  16183. for (var b = this._animationLayer[a], c = b.length; c--; )
  16184. m._returnObject(b[c]);
  16185. b.length = 0
  16186. }
  16187. this._animationLayer.length = 0;
  16188. this.animationNameList.length = 0;
  16189. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  16190. }
  16191. };
  16192. a.prototype.gotoAndPlay =
  16193. function (b, c, d, e, f, k, g, l, h, E) {
  16194. "undefined" === typeof c && (c = -1);
  16195. "undefined" === typeof d && (d = -1);
  16196. "undefined" === typeof e && (e = NaN);
  16197. "undefined" === typeof f && (f = 0);
  16198. "undefined" === typeof k && (k = null);
  16199. "undefined" === typeof g && (g = a.SAME_LAYER_AND_GROUP);
  16200. "undefined" === typeof l && (l = !0);
  16201. "undefined" === typeof h && (h = !0);
  16202. "undefined" === typeof E && (E = !0);
  16203. if (!this._animationDataList)
  16204. return null;
  16205. for (var u = this._animationDataList.length, C; u--; )
  16206. if (this._animationDataList[u].name == b) {
  16207. C = this._animationDataList[u];
  16208. break
  16209. }
  16210. if (!C)
  16211. return null;
  16212. this._isPlaying = !0;
  16213. c = 0 > c ? 0 > C.fadeInTime ? 0.3 : C.fadeInTime : c;
  16214. d = 0 > d ? 0 > C.scale ? 1 : C.scale : d / C.duration;
  16215. e = isNaN(e) ? C.loop : e;
  16216. f = this.addLayer(f);
  16217. var s;
  16218. switch (g) {
  16219. case a.NONE:
  16220. break;
  16221. case a.SAME_LAYER:
  16222. s = this._animationLayer[f];
  16223. for (u = s.length; u--; )
  16224. g = s[u], g.fadeOut(c, h);
  16225. break;
  16226. case a.SAME_GROUP:
  16227. for (y = this._animationLayer.length; y--; )
  16228. for (s = this._animationLayer[y], u = s.length; u--; )
  16229. g = s[u], g.group == k && g.fadeOut(c, h);
  16230. break;
  16231. case a.ALL:
  16232. for (var y = this._animationLayer.length; y--; )
  16233. for (s = this._animationLayer[y], u = s.length; u--; )
  16234. g =
  16235. s[u], g.fadeOut(c, h);
  16236. break;
  16237. default:
  16238. for (s = this._animationLayer[f], u = s.length; u--; )
  16239. g = s[u], g.group == k && g.fadeOut(c, h)
  16240. }
  16241. this._lastAnimationState = m._borrowObject();
  16242. this._lastAnimationState.group = k;
  16243. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  16244. this._lastAnimationState.fadeIn(this._armature, C, c, 1 / d, e, f, l, E);
  16245. this.addState(this._lastAnimationState);
  16246. e = this._armature._slotList;
  16247. for (u = e.length; u--; )
  16248. f = e[u], (f = f.getChildArmature()) && f.animation.gotoAndPlay(b, c);
  16249. return this._lastAnimationState
  16250. };
  16251. a.prototype.play =
  16252. function () {
  16253. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  16254. };
  16255. a.prototype.stop = function () {
  16256. this._isPlaying = !1
  16257. };
  16258. a.prototype.getState = function (a, b) {
  16259. "undefined" === typeof b && (b = 0);
  16260. var c = this._animationLayer.length;
  16261. if (0 == c)
  16262. return null;
  16263. b >= c && (b = c - 1);
  16264. c = this._animationLayer[b];
  16265. if (!c)
  16266. return null;
  16267. for (var d = c.length; d--; )
  16268. if (c[d].name == a)
  16269. return c[d];
  16270. return null
  16271. };
  16272. a.prototype.hasAnimation = function (a) {
  16273. for (var b = this._animationDataList.length; b--; )
  16274. if (this._animationDataList[b].name == a)
  16275. return !0;
  16276. return !1
  16277. };
  16278. a.prototype.advanceTime = function (a) {
  16279. if (this._isPlaying) {
  16280. a *= this.timeScale;
  16281. var b = this._armature._boneList.length,
  16282. c,
  16283. d,
  16284. e = b,
  16285. f,
  16286. k,
  16287. m,
  16288. g,
  16289. l,
  16290. n,
  16291. h,
  16292. q,
  16293. u,
  16294. y,
  16295. G,
  16296. I,
  16297. M,
  16298. N,
  16299. F,
  16300. K,
  16301. H;
  16302. for (b--; e--; ) {
  16303. k = this._armature._boneList[e];
  16304. m = k.name;
  16305. g = 1;
  16306. I = G = y = u = q = h = n = l = 0;
  16307. for (c = this._animationLayer.length; c--; ) {
  16308. M = 0;
  16309. N = this._animationLayer[c];
  16310. f = N.length;
  16311. for (d = 0; d < f; d++)
  16312. F = N[d], e == b && F.advanceTime(a) ?
  16313. (this.removeState(F), d--, f--) : (K = F._timelineStates[m]) && K.tweenActive && (F = F._fadeWeight * F.weight * g, H = K.transform, K = K.pivot, l += H.x * F, n += H.y * F, h += H.skewX * F, q += H.skewY * F, u += H.scaleX * F, y += H.scaleY * F, G += K.x * F, I += K.y * F, M += F);
  16314. if (M >= g)
  16315. break;
  16316. else
  16317. g -= M
  16318. }
  16319. H = k.tween;
  16320. K = k._tweenPivot;
  16321. H.x = l;
  16322. H.y = n;
  16323. H.skewX = h;
  16324. H.skewY = q;
  16325. H.scaleX = u;
  16326. H.scaleY = y;
  16327. K.x = G;
  16328. K.y = I
  16329. }
  16330. }
  16331. };
  16332. a.prototype.addLayer = function (a) {
  16333. a >= this._animationLayer.length && (a = this._animationLayer.length, this._animationLayer[a] = []);
  16334. return a
  16335. };
  16336. a.prototype.addState = function (a) {
  16337. this._animationLayer[a.layer].push(a)
  16338. };
  16339. a.prototype.removeState = function (a) {
  16340. var b = a.layer,
  16341. c = this._animationLayer[b];
  16342. c.splice(c.indexOf(a), 1);
  16343. m._returnObject(a);
  16344. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  16345. };
  16346. a.NONE = "none";
  16347. a.SAME_LAYER = "sameLayer";
  16348. a.SAME_GROUP = "sameGroup";
  16349. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  16350. a.ALL = "all";
  16351. return a
  16352. }
  16353. ();
  16354. c.Animation = d;
  16355. d.prototype.__class__ = "dragonBones.animation.Animation"
  16356. })(d.animation || (d.animation = {}));
  16357. var c = d.animation;
  16358. (function (a) {
  16359. var c = function () {
  16360. function a() {
  16361. this.skewY =
  16362. this.skewX = this.y = this.x = 0;
  16363. this.scaleY = this.scaleX = 1
  16364. }
  16365. a.prototype.getRotation = function () {
  16366. return this.skewX
  16367. };
  16368. a.prototype.setRotation = function (a) {
  16369. this.skewX = this.skewY = a
  16370. };
  16371. a.prototype.copy = function (a) {
  16372. this.x = a.x;
  16373. this.y = a.y;
  16374. this.skewX = a.skewX;
  16375. this.skewY = a.skewY;
  16376. this.scaleX = a.scaleX;
  16377. this.scaleY = a.scaleY
  16378. };
  16379. a.prototype.toString = function () {
  16380. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY + " scaleX=" + this.scaleX + " scaleY=" + this.scaleY + ")]"
  16381. };
  16382. return a
  16383. }
  16384. ();
  16385. a.DBTransform = c;
  16386. c.prototype.__class__ =
  16387. "dragonBones.objects.DBTransform";
  16388. var d = function () {
  16389. function a() {
  16390. this.duration = this.position = 0
  16391. }
  16392. a.prototype.dispose = function () {};
  16393. return a
  16394. }
  16395. ();
  16396. a.Frame = d;
  16397. d.prototype.__class__ = "dragonBones.objects.Frame";
  16398. var f = function (a) {
  16399. function b() {
  16400. a.call(this);
  16401. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  16402. this.zOrder = NaN;
  16403. this.visible = !0;
  16404. this.global = new c;
  16405. this.transform = new c;
  16406. this.pivot = new e.Point
  16407. }
  16408. __extends(b, a);
  16409. b.prototype.dispose = function () {
  16410. a.prototype.dispose.call(this);
  16411. this.color = this.pivot = this.transform =
  16412. this.global = null
  16413. };
  16414. return b
  16415. }
  16416. (d);
  16417. a.TransformFrame = f;
  16418. f.prototype.__class__ = "dragonBones.objects.TransformFrame";
  16419. var m = function () {
  16420. function a() {
  16421. this._frameList = [];
  16422. this.duration = 0;
  16423. this.scale = 1
  16424. }
  16425. a.prototype.getFrameList = function () {
  16426. return this._frameList
  16427. };
  16428. a.prototype.dispose = function () {
  16429. for (var a = this._frameList.length; a--; )
  16430. this._frameList[a].dispose();
  16431. this._frameList.length = 0;
  16432. this._frameList = null
  16433. };
  16434. a.prototype.addFrame = function (a) {
  16435. if (!a)
  16436. throw Error();
  16437. if (0 > this._frameList.indexOf(a))
  16438. this._frameList[this._frameList.length] =
  16439. a;
  16440. else
  16441. throw Error();
  16442. };
  16443. return a
  16444. }
  16445. ();
  16446. a.Timeline = m;
  16447. m.prototype.__class__ = "dragonBones.objects.Timeline";
  16448. var h = function (a) {
  16449. function b() {
  16450. a.call(this);
  16451. this.originTransform = new c;
  16452. this.originPivot = new e.Point;
  16453. this.offset = 0;
  16454. this.transformed = !1
  16455. }
  16456. __extends(b, a);
  16457. b.prototype.dispose = function () {
  16458. this != b.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  16459. };
  16460. b.HIDE_TIMELINE = new b;
  16461. return b
  16462. }
  16463. (m);
  16464. a.TransformTimeline = h;
  16465. h.prototype.__class__ = "dragonBones.objects.TransformTimeline";
  16466. var u =
  16467. function (a) {
  16468. function b() {
  16469. a.call(this);
  16470. this.loop = this.frameRate = 0;
  16471. this.tweenEasing = NaN;
  16472. this.fadeInTime = 0;
  16473. this._timelines = {}
  16474. }
  16475. __extends(b, a);
  16476. b.prototype.getTimelines = function () {
  16477. return this._timelines
  16478. };
  16479. b.prototype.dispose = function () {
  16480. a.prototype.dispose.call(this);
  16481. for (var b in this._timelines)
  16482. this._timelines[b].dispose();
  16483. this._timelines = null
  16484. };
  16485. b.prototype.getTimeline = function (a) {
  16486. return this._timelines[a]
  16487. };
  16488. b.prototype.addTimeline = function (a, b) {
  16489. if (!a)
  16490. throw Error();
  16491. this._timelines[b] = a
  16492. };
  16493. return b
  16494. }
  16495. (m);
  16496. a.AnimationData =
  16497. u;
  16498. u.prototype.__class__ = "dragonBones.objects.AnimationData";
  16499. var y = function () {
  16500. function a() {
  16501. this.transform = new c
  16502. }
  16503. a.prototype.dispose = function () {
  16504. this.pivot = this.transform = null
  16505. };
  16506. a.ARMATURE = "armature";
  16507. a.IMAGE = "image";
  16508. return a
  16509. }
  16510. ();
  16511. a.DisplayData = y;
  16512. y.prototype.__class__ = "dragonBones.objects.DisplayData";
  16513. var z = function () {
  16514. function a() {
  16515. this._displayDataList = [];
  16516. this.zOrder = 0;
  16517. this.blendMode = "normal"
  16518. }
  16519. a.prototype.getDisplayDataList = function () {
  16520. return this._displayDataList
  16521. };
  16522. a.prototype.dispose = function () {
  16523. for (var a =
  16524. this._displayDataList.length; a--; )
  16525. this._displayDataList[a].dispose();
  16526. this._displayDataList.length = 0;
  16527. this._displayDataList = null
  16528. };
  16529. a.prototype.addDisplayData = function (a) {
  16530. if (!a)
  16531. throw Error();
  16532. if (0 > this._displayDataList.indexOf(a))
  16533. this._displayDataList[this._displayDataList.length] = a;
  16534. else
  16535. throw Error();
  16536. };
  16537. a.prototype.getDisplayData = function (a) {
  16538. for (var b = this._displayDataList.length; b--; )
  16539. if (this._displayDataList[b].name == a)
  16540. return this._displayDataList[b];
  16541. return null
  16542. };
  16543. return a
  16544. }
  16545. ();
  16546. a.SlotData = z;
  16547. z.prototype.__class__ =
  16548. "dragonBones.objects.SlotData";
  16549. var v = function () {
  16550. function a() {
  16551. this.length = 0;
  16552. this.global = new c;
  16553. this.transform = new c;
  16554. this.scaleMode = 1;
  16555. this.fixedRotation = !1
  16556. }
  16557. a.prototype.dispose = function () {
  16558. this.transform = this.global = null
  16559. };
  16560. return a
  16561. }
  16562. ();
  16563. a.BoneData = v;
  16564. v.prototype.__class__ = "dragonBones.objects.BoneData";
  16565. var A = function () {
  16566. function a() {
  16567. this._slotDataList = []
  16568. }
  16569. a.prototype.getSlotDataList = function () {
  16570. return this._slotDataList
  16571. };
  16572. a.prototype.dispose = function () {
  16573. for (var a = this._slotDataList.length; a--; )
  16574. this._slotDataList[a].dispose();
  16575. this._slotDataList.length = 0;
  16576. this._slotDataList = null
  16577. };
  16578. a.prototype.getSlotData = function (a) {
  16579. for (var b = this._slotDataList.length; b--; )
  16580. if (this._slotDataList[b].name == a)
  16581. return this._slotDataList[b];
  16582. return null
  16583. };
  16584. a.prototype.addSlotData = function (a) {
  16585. if (!a)
  16586. throw Error();
  16587. if (0 > this._slotDataList.indexOf(a))
  16588. this._slotDataList[this._slotDataList.length] = a;
  16589. else
  16590. throw Error();
  16591. };
  16592. return a
  16593. }
  16594. ();
  16595. a.SkinData = A;
  16596. A.prototype.__class__ = "dragonBones.objects.SkinData";
  16597. var t = function () {
  16598. function a() {
  16599. this._boneDataList = [];
  16600. this._skinDataList =
  16601. [];
  16602. this._animationDataList = []
  16603. }
  16604. a.prototype.getBoneDataList = function () {
  16605. return this._boneDataList
  16606. };
  16607. a.prototype.getSkinDataList = function () {
  16608. return this._skinDataList
  16609. };
  16610. a.prototype.getAnimationDataList = function () {
  16611. return this._animationDataList
  16612. };
  16613. a.prototype.dispose = function () {
  16614. for (var a = this._boneDataList.length; a--; )
  16615. this._boneDataList[a].dispose();
  16616. for (a = this._skinDataList.length; a--; )
  16617. this._skinDataList[a].dispose();
  16618. for (a = this._animationDataList.length; a--; )
  16619. this._animationDataList[a].dispose();
  16620. this._boneDataList.length =
  16621. 0;
  16622. this._skinDataList.length = 0;
  16623. this._animationDataList.length = 0;
  16624. this._animationDataList = this._skinDataList = this._boneDataList = null
  16625. };
  16626. a.prototype.getBoneData = function (a) {
  16627. for (var b = this._boneDataList.length; b--; )
  16628. if (this._boneDataList[b].name == a)
  16629. return this._boneDataList[b];
  16630. return null
  16631. };
  16632. a.prototype.getSkinData = function (a) {
  16633. if (!a)
  16634. return this._skinDataList[0];
  16635. for (var b = this._skinDataList.length; b--; )
  16636. if (this._skinDataList[b].name == a)
  16637. return this._skinDataList[b];
  16638. return null
  16639. };
  16640. a.prototype.getAnimationData = function (a) {
  16641. for (var b =
  16642. this._animationDataList.length; b--; )
  16643. if (this._animationDataList[b].name == a)
  16644. return this._animationDataList[b];
  16645. return null
  16646. };
  16647. a.prototype.addBoneData = function (a) {
  16648. if (!a)
  16649. throw Error();
  16650. if (0 > this._boneDataList.indexOf(a))
  16651. this._boneDataList[this._boneDataList.length] = a;
  16652. else
  16653. throw Error();
  16654. };
  16655. a.prototype.addSkinData = function (a) {
  16656. if (!a)
  16657. throw Error();
  16658. if (0 > this._skinDataList.indexOf(a))
  16659. this._skinDataList[this._skinDataList.length] = a;
  16660. else
  16661. throw Error();
  16662. };
  16663. a.prototype.addAnimationData = function (a) {
  16664. if (!a)
  16665. throw Error();
  16666. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  16667. };
  16668. a.prototype.sortBoneDataList = function () {
  16669. var a = this._boneDataList.length;
  16670. if (0 != a) {
  16671. for (var b = []; a--; ) {
  16672. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent; )
  16673. d++, e = this.getBoneData(e.parent);
  16674. b[a] = {
  16675. level : d,
  16676. boneData : c
  16677. }
  16678. }
  16679. b.sort(this.sortBoneData);
  16680. for (a = b.length; a--; )
  16681. this._boneDataList[a] = b[a].boneData
  16682. }
  16683. };
  16684. a.prototype.sortBoneData = function (a, b) {
  16685. return a.level > b.level ? 1 : -1
  16686. };
  16687. return a
  16688. }
  16689. ();
  16690. a.ArmatureData = t;
  16691. t.prototype.__class__ =
  16692. "dragonBones.objects.ArmatureData";
  16693. var B = function () {
  16694. function a() {
  16695. this._armatureDataList = [];
  16696. this._subTexturePivots = {}
  16697. }
  16698. a.prototype.getArmatureNames = function () {
  16699. var a = [],
  16700. b;
  16701. for (b in this._armatureDataList)
  16702. a[a.length] = this._armatureDataList[b].name;
  16703. return a
  16704. };
  16705. a.prototype.getArmatureDataList = function () {
  16706. return this._armatureDataList
  16707. };
  16708. a.prototype.dispose = function () {
  16709. for (var a in this._armatureDataList)
  16710. this._armatureDataList[a].dispose();
  16711. this._armatureDataList.length = 0;
  16712. this._subTexturePivots = this._armatureDataList =
  16713. null
  16714. };
  16715. a.prototype.getArmatureData = function (a) {
  16716. for (var b = this._armatureDataList.length; b--; )
  16717. if (this._armatureDataList[b].name == a)
  16718. return this._armatureDataList[b];
  16719. return null
  16720. };
  16721. a.prototype.addArmatureData = function (a) {
  16722. if (!a)
  16723. throw Error();
  16724. if (0 > this._armatureDataList.indexOf(a))
  16725. this._armatureDataList[this._armatureDataList.length] = a;
  16726. else
  16727. throw Error();
  16728. };
  16729. a.prototype.removeArmatureData = function (a) {
  16730. a = this._armatureDataList.indexOf(a);
  16731. 0 <= a && this._armatureDataList.splice(a, 1)
  16732. };
  16733. a.prototype.removeArmatureDataByName =
  16734. function (a) {
  16735. for (var b = this._armatureDataList.length; b--; )
  16736. this._armatureDataList[b].name == a && this._armatureDataList.splice(b, 1)
  16737. };
  16738. a.prototype.getSubTexturePivot = function (a) {
  16739. return this._subTexturePivots[a]
  16740. };
  16741. a.prototype.addSubTexturePivot = function (a, b, c) {
  16742. var d = this._subTexturePivots[c];
  16743. d ? (d.x = a, d.y = b) : this._subTexturePivots[c] = d = new e.Point(a, b);
  16744. return d
  16745. };
  16746. a.prototype.removeSubTexturePivot = function (a) {
  16747. if (a)
  16748. delete this._subTexturePivots[a];
  16749. else
  16750. for (a in this._subTexturePivots)
  16751. delete this._subTexturePivots[a]
  16752. };
  16753. return a
  16754. }
  16755. ();
  16756. a.SkeletonData = B;
  16757. B.prototype.__class__ = "dragonBones.objects.SkeletonData";
  16758. m = function () {
  16759. function a() {}
  16760. a.parseTextureAtlasData = function (a, c) {
  16761. "undefined" === typeof c && (c = 1);
  16762. if (!a)
  16763. throw Error();
  16764. var d = {};
  16765. d.__name = a[b.ConstValues.A_NAME];
  16766. var f = a[b.ConstValues.SUB_TEXTURE],
  16767. k;
  16768. for (k in f) {
  16769. var m = f[k],
  16770. g = m[b.ConstValues.A_NAME],
  16771. m = new e.Rectangle(Number(m[b.ConstValues.A_X]) / c, Number(m[b.ConstValues.A_Y]) / c, Number(m[b.ConstValues.A_WIDTH]) / c, Number(m[b.ConstValues.A_HEIGHT]) / c);
  16772. d[g] = m
  16773. }
  16774. return d
  16775. };
  16776. a.parseSkeletonData =
  16777. function (c) {
  16778. if (!c)
  16779. throw Error();
  16780. var d = Number(c[b.ConstValues.A_FRAME_RATE]),
  16781. e = new B;
  16782. e.name = c[b.ConstValues.A_NAME];
  16783. c = c[b.ConstValues.ARMATURE];
  16784. for (var f in c)
  16785. e.addArmatureData(a.parseArmatureData(c[f], e, d));
  16786. return e
  16787. };
  16788. a.parseArmatureData = function (c, d, e) {
  16789. var f = new t;
  16790. f.name = c[b.ConstValues.A_NAME];
  16791. var k = c[b.ConstValues.BONE],
  16792. m;
  16793. for (m in k)
  16794. f.addBoneData(a.parseBoneData(k[m]));
  16795. k = c[b.ConstValues.SKIN];
  16796. for (m in k)
  16797. f.addSkinData(a.parseSkinData(k[m], d));
  16798. b.DBDataUtil.transformArmatureData(f);
  16799. f.sortBoneDataList();
  16800. c = c[b.ConstValues.ANIMATION];
  16801. for (m in c)
  16802. f.addAnimationData(a.parseAnimationData(c[m], f, e));
  16803. return f
  16804. };
  16805. a.parseBoneData = function (c) {
  16806. var d = new v;
  16807. d.name = c[b.ConstValues.A_NAME];
  16808. d.parent = c[b.ConstValues.A_PARENT];
  16809. d.length = Number(c[b.ConstValues.A_LENGTH]) || 0;
  16810. var e = Number(c[b.ConstValues.A_SCALE_MODE]);
  16811. !isNaN(e) && e && (d.scaleMode = e);
  16812. if (e = c[b.ConstValues.A_FIXED_ROTATION])
  16813. d.fixedRotation = e;
  16814. a.parseTransform(c[b.ConstValues.TRANSFORM], d.global);
  16815. d.transform.copy(d.global);
  16816. return d
  16817. };
  16818. a.parseSkinData = function (c,
  16819. d) {
  16820. var e = new A;
  16821. e.name = c[b.ConstValues.A_NAME];
  16822. var f = c[b.ConstValues.SLOT],
  16823. k;
  16824. for (k in f)
  16825. e.addSlotData(a.parseSlotData(f[k], d));
  16826. return e
  16827. };
  16828. a.parseSlotData = function (c, d) {
  16829. var e = new z;
  16830. e.name = c[b.ConstValues.A_NAME];
  16831. e.parent = c[b.ConstValues.A_PARENT];
  16832. e.zOrder = Number(c[b.ConstValues.A_Z_ORDER]);
  16833. e.blendMode = c[b.ConstValues.A_BLENDMODE];
  16834. e.blendMode || (e.blendMode = "normal");
  16835. var f = c[b.ConstValues.DISPLAY],
  16836. k;
  16837. for (k in f)
  16838. e.addDisplayData(a.parseDisplayData(f[k], d));
  16839. return e
  16840. };
  16841. a.parseDisplayData = function (c, d) {
  16842. var e =
  16843. new y;
  16844. e.name = c[b.ConstValues.A_NAME];
  16845. e.type = c[b.ConstValues.A_TYPE];
  16846. e.pivot = d.addSubTexturePivot(0, 0, e.name);
  16847. a.parseTransform(c[b.ConstValues.TRANSFORM], e.transform, e.pivot);
  16848. return e
  16849. };
  16850. a.parseAnimationData = function (c, d, e) {
  16851. var f = new u;
  16852. f.name = c[b.ConstValues.A_NAME];
  16853. f.frameRate = e;
  16854. f.loop = Number(c[b.ConstValues.A_LOOP]) || 0;
  16855. f.fadeInTime = Number(c[b.ConstValues.A_FADE_IN_TIME]);
  16856. f.duration = Number(c[b.ConstValues.A_DURATION]) / e;
  16857. f.scale = Number(c[b.ConstValues.A_SCALE]);
  16858. if (c.hasOwnProperty(b.ConstValues.A_TWEEN_EASING)) {
  16859. var k =
  16860. c[b.ConstValues.A_TWEEN_EASING];
  16861. f.tweenEasing = void 0 == k || null == k ? NaN : Number(k)
  16862. } else
  16863. f.tweenEasing = NaN;
  16864. a.parseTimeline(c, f, a.parseMainFrame, e);
  16865. var m,
  16866. k = c[b.ConstValues.TIMELINE],
  16867. g;
  16868. for (g in k)
  16869. m = k[g], c = a.parseTransformTimeline(m, f.duration, e), m = m[b.ConstValues.A_NAME], f.addTimeline(c, m);
  16870. b.DBDataUtil.addHideTimeline(f, d);
  16871. b.DBDataUtil.transformAnimationData(f, d);
  16872. return f
  16873. };
  16874. a.parseTimeline = function (a, c, d, e) {
  16875. var f = 0,
  16876. k;
  16877. a = a[b.ConstValues.FRAME];
  16878. for (var m in a)
  16879. k = d(a[m], e), k.position = f, c.addFrame(k), f += k.duration;
  16880. k && (k.duration = c.duration - k.position)
  16881. };
  16882. a.parseTransformTimeline = function (c, d, e) {
  16883. var f = new h;
  16884. f.duration = d;
  16885. a.parseTimeline(c, f, a.parseTransformFrame, e);
  16886. f.scale = Number(c[b.ConstValues.A_SCALE]);
  16887. f.offset = Number(c[b.ConstValues.A_OFFSET]);
  16888. return f
  16889. };
  16890. a.parseFrame = function (a, c, d) {
  16891. c.duration = Number(a[b.ConstValues.A_DURATION]) / d;
  16892. c.action = a[b.ConstValues.A_ACTION];
  16893. c.event = a[b.ConstValues.A_EVENT];
  16894. c.sound = a[b.ConstValues.A_SOUND]
  16895. };
  16896. a.parseMainFrame = function (b, c) {
  16897. var e = new d;
  16898. a.parseFrame(b, e, c);
  16899. return e
  16900. };
  16901. a.parseTransformFrame =
  16902. function (c, d) {
  16903. var k = new f;
  16904. a.parseFrame(c, k, d);
  16905. k.visible = 1 != Number(c[b.ConstValues.A_HIDE]);
  16906. if (c.hasOwnProperty(b.ConstValues.A_TWEEN_EASING)) {
  16907. var m = c[b.ConstValues.A_TWEEN_EASING];
  16908. k.tweenEasing = void 0 == m || null == m ? NaN : Number(m)
  16909. } else
  16910. k.tweenEasing = 0;
  16911. k.tweenRotate = Number(c[b.ConstValues.A_TWEEN_ROTATE]) || 0;
  16912. k.displayIndex = Number(c[b.ConstValues.A_DISPLAY_INDEX]) || 0;
  16913. k.zOrder = Number(c[b.ConstValues.A_Z_ORDER]) || 0;
  16914. a.parseTransform(c[b.ConstValues.TRANSFORM], k.global, k.pivot);
  16915. k.transform.copy(k.global);
  16916. if (m =
  16917. c[b.ConstValues.COLOR_TRANSFORM])
  16918. k.color = new e.ColorTransform, k.color.alphaOffset = Number(m[b.ConstValues.A_ALPHA_OFFSET]), k.color.redOffset = Number(m[b.ConstValues.A_RED_OFFSET]), k.color.greenOffset = Number(m[b.ConstValues.A_GREEN_OFFSET]), k.color.blueOffset = Number(m[b.ConstValues.A_BLUE_OFFSET]), k.color.alphaMultiplier = 0.01 * Number(m[b.ConstValues.A_ALPHA_MULTIPLIER]), k.color.redMultiplier = 0.01 * Number(m[b.ConstValues.A_RED_MULTIPLIER]), k.color.greenMultiplier = 0.01 * Number(m[b.ConstValues.A_GREEN_MULTIPLIER]),
  16919. k.color.blueMultiplier = 0.01 * Number(m[b.ConstValues.A_BLUE_MULTIPLIER]);
  16920. return k
  16921. };
  16922. a.parseTransform = function (a, c, d) {
  16923. "undefined" === typeof d && (d = null);
  16924. a && (c && (c.x = Number(a[b.ConstValues.A_X]), c.y = Number(a[b.ConstValues.A_Y]), c.skewX = Number(a[b.ConstValues.A_SKEW_X]) * b.ConstValues.ANGLE_TO_RADIAN, c.skewY = Number(a[b.ConstValues.A_SKEW_Y]) * b.ConstValues.ANGLE_TO_RADIAN, c.scaleX = Number(a[b.ConstValues.A_SCALE_X]), c.scaleY = Number(a[b.ConstValues.A_SCALE_Y])), d && (d.x = Number(a[b.ConstValues.A_PIVOT_X]), d.y =
  16925. Number(a[b.ConstValues.A_PIVOT_Y])))
  16926. };
  16927. return a
  16928. }
  16929. ();
  16930. a.DataParser = m;
  16931. m.prototype.__class__ = "dragonBones.objects.DataParser"
  16932. })(d.objects || (d.objects = {}));
  16933. var a = d.objects;
  16934. (function (b) {
  16935. var c = function (b) {
  16936. function c() {
  16937. b.call(this);
  16938. this._dataDic = {};
  16939. this._textureAtlasDic = {};
  16940. this._textureAtlasLoadingDic = {}
  16941. }
  16942. __extends(c, b);
  16943. c.prototype.getSkeletonData = function (a) {
  16944. return this._dataDic[a]
  16945. };
  16946. c.prototype.addSkeletonData = function (a, b) {
  16947. "undefined" === typeof b && (b = null);
  16948. if (!a)
  16949. throw Error();
  16950. b = b || a.name;
  16951. if (!b)
  16952. throw Error("Unnamed data!");
  16953. this._dataDic[b] = a
  16954. };
  16955. c.prototype.removeSkeletonData = function (a) {
  16956. delete this._dataDic[a]
  16957. };
  16958. c.prototype.getTextureAtlas = function (a) {
  16959. return this._textureAtlasDic[a]
  16960. };
  16961. c.prototype.addTextureAtlas = function (a, b) {
  16962. "undefined" === typeof b && (b = null);
  16963. if (!a)
  16964. throw Error();
  16965. b = b || a.name;
  16966. if (!b)
  16967. throw Error("Unnamed data!");
  16968. this._textureAtlasDic[b] = a
  16969. };
  16970. c.prototype.removeTextureAtlas = function (a) {
  16971. delete this._textureAtlasDic[a]
  16972. };
  16973. c.prototype.dispose = function (a) {
  16974. "undefined" === typeof a && (a = !0);
  16975. if (a) {
  16976. for (var b in this._dataDic)
  16977. this._dataDic[b].dispose();
  16978. for (b in this._textureAtlasDic)
  16979. this._textureAtlasDic[b].dispose()
  16980. }
  16981. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  16982. };
  16983. c.prototype.buildArmature = function (b, c, d, e, f) {
  16984. if (d) {
  16985. var k = this._dataDic[d];
  16986. if (k)
  16987. var m = k.getArmatureData(b)
  16988. } else
  16989. for (d in this._dataDic)
  16990. if (k = this._dataDic[d], m = k.getArmatureData(b))
  16991. break;
  16992. if (!m)
  16993. return null;
  16994. this._currentDataName = d;
  16995. this._currentTextureAtlasName = e || d;
  16996. e = this._generateArmature();
  16997. e.name = b;
  16998. var g,
  16999. l,
  17000. h = m.getBoneDataList(),
  17001. n;
  17002. for (n in h)
  17003. l = h[n], g = new y, g.name = l.name, g.fixedRotation = l.fixedRotation, g.scaleMode = l.scaleMode, g.origin.copy(l.transform), m.getBoneData(l.parent) ? e.addChild(g, l.parent) : e.addChild(g, null);
  17004. if (c && c != b) {
  17005. var u = k.getArmatureData(c);
  17006. if (!u)
  17007. for (d in this._dataDic)
  17008. if (k = this._dataDic[d], u = k.getArmatureData(c))
  17009. break
  17010. }
  17011. u ? e.animation.setAnimationDataList(u.getAnimationDataList()) : e.animation.setAnimationDataList(m.getAnimationDataList());
  17012. g = m.getSkinData(f);
  17013. if (!g)
  17014. throw Error();
  17015. b = [];
  17016. d = g.getSlotDataList();
  17017. for (n in d)
  17018. if (k =
  17019. d[n], g = e.getBone(k.parent)) {
  17020. f = k.getDisplayDataList();
  17021. c = this._generateSlot();
  17022. c.name = k.name;
  17023. c._blendMode = k.blendMode;
  17024. c._originZOrder = k.zOrder;
  17025. c._dislayDataList = f;
  17026. b.length = 0;
  17027. for (k = f.length; k--; )
  17028. switch (m = f[k], m.type) {
  17029. case a.DisplayData.ARMATURE:
  17030. (m = this.buildArmature(m.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (b[k] = m);
  17031. break;
  17032. default:
  17033. b[k] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], m.name, m.pivot.x, m.pivot.y)
  17034. }
  17035. c.setDisplayList(b);
  17036. c._changeDisplay(0);
  17037. g.addChild(c)
  17038. }
  17039. e._slotsZOrderChanged = !0;
  17040. e.advanceTime(0);
  17041. return e
  17042. };
  17043. c.prototype.getTextureDisplay = function (a, b, c, d) {
  17044. if (b)
  17045. var e = this._textureAtlasDic[b];
  17046. if (!e && !b)
  17047. for (b in this._textureAtlasDic) {
  17048. e = this._textureAtlasDic[b];
  17049. if (e.getRegion(a))
  17050. break;
  17051. e = null
  17052. }
  17053. if (e) {
  17054. if (isNaN(c) || isNaN(d))
  17055. if (b = this._dataDic[b])
  17056. if (b = b.getSubTexturePivot(a))
  17057. c = b.x, d = b.y;
  17058. return this._generateDisplay(e, a, c, d)
  17059. }
  17060. return null
  17061. };
  17062. c.prototype._generateArmature = function () {
  17063. return null
  17064. };
  17065. c.prototype._generateSlot = function () {
  17066. return null
  17067. };
  17068. c.prototype._generateDisplay =
  17069. function (a, b, c, d) {
  17070. return null
  17071. };
  17072. return c
  17073. }
  17074. (f.EventDispatcher);
  17075. b.BaseFactory = c;
  17076. c.prototype.__class__ = "dragonBones.factorys.BaseFactory"
  17077. })(d.factorys || (d.factorys = {}));
  17078. (function (b) {
  17079. var d = function () {
  17080. function a() {}
  17081. a.ANGLE_TO_RADIAN = Math.PI / 180;
  17082. a.DRAGON_BONES = "dragonBones";
  17083. a.ARMATURE = "armature";
  17084. a.SKIN = "skin";
  17085. a.BONE = "bone";
  17086. a.SLOT = "slot";
  17087. a.DISPLAY = "display";
  17088. a.ANIMATION = "animation";
  17089. a.TIMELINE = "timeline";
  17090. a.FRAME = "frame";
  17091. a.TRANSFORM = "transform";
  17092. a.COLOR_TRANSFORM = "colorTransform";
  17093. a.TEXTURE_ATLAS = "TextureAtlas";
  17094. a.SUB_TEXTURE = "SubTexture";
  17095. a.A_VERSION = "version";
  17096. a.A_IMAGE_PATH = "imagePath";
  17097. a.A_FRAME_RATE = "frameRate";
  17098. a.A_NAME = "name";
  17099. a.A_PARENT = "parent";
  17100. a.A_LENGTH = "length";
  17101. a.A_TYPE = "type";
  17102. a.A_FADE_IN_TIME = "fadeInTime";
  17103. a.A_DURATION = "duration";
  17104. a.A_SCALE = "scale";
  17105. a.A_OFFSET = "offset";
  17106. a.A_LOOP = "loop";
  17107. a.A_EVENT = "event";
  17108. a.A_SOUND = "sound";
  17109. a.A_ACTION = "action";
  17110. a.A_HIDE = "hide";
  17111. a.A_TWEEN_EASING = "tweenEasing";
  17112. a.A_TWEEN_ROTATE = "tweenRotate";
  17113. a.A_DISPLAY_INDEX = "displayIndex";
  17114. a.A_Z_ORDER = "z";
  17115. a.A_BLENDMODE = "blendMode";
  17116. a.A_WIDTH =
  17117. "width";
  17118. a.A_HEIGHT = "height";
  17119. a.A_SCALE_MODE = "scaleMode";
  17120. a.A_FIXED_ROTATION = "fixedRotation";
  17121. a.A_X = "x";
  17122. a.A_Y = "y";
  17123. a.A_SKEW_X = "skX";
  17124. a.A_SKEW_Y = "skY";
  17125. a.A_SCALE_X = "scX";
  17126. a.A_SCALE_Y = "scY";
  17127. a.A_PIVOT_X = "pX";
  17128. a.A_PIVOT_Y = "pY";
  17129. a.A_ALPHA_OFFSET = "aO";
  17130. a.A_RED_OFFSET = "rO";
  17131. a.A_GREEN_OFFSET = "gO";
  17132. a.A_BLUE_OFFSET = "bO";
  17133. a.A_ALPHA_MULTIPLIER = "aM";
  17134. a.A_RED_MULTIPLIER = "rM";
  17135. a.A_GREEN_MULTIPLIER = "gM";
  17136. a.A_BLUE_MULTIPLIER = "bM";
  17137. return a
  17138. }
  17139. ();
  17140. b.ConstValues = d;
  17141. d.prototype.__class__ = "dragonBones.utils.ConstValues";
  17142. var f = function () {
  17143. function a() {}
  17144. a.transformPointWithParent = function (b, c) {
  17145. var d = a._helpMatrix;
  17146. a.transformToMatrix(c, d);
  17147. d.invert();
  17148. var e = b.x,
  17149. f = b.y;
  17150. b.x = d.a * e + d.c * f + d.tx;
  17151. b.y = d.d * f + d.b * e + d.ty;
  17152. b.skewX = a.formatRadian(b.skewX - c.skewX);
  17153. b.skewY = a.formatRadian(b.skewY - c.skewY)
  17154. };
  17155. a.transformToMatrix = function (a, b) {
  17156. b.a = a.scaleX * Math.cos(a.skewY);
  17157. b.b = a.scaleX * Math.sin(a.skewY);
  17158. b.c = -a.scaleY * Math.sin(a.skewX);
  17159. b.d = a.scaleY * Math.cos(a.skewX);
  17160. b.tx = a.x;
  17161. b.ty = a.y
  17162. };
  17163. a.formatRadian = function (b) {
  17164. b %= a.DOUBLE_PI;
  17165. b > Math.PI && (b -= a.DOUBLE_PI);
  17166. b < -Math.PI && (b += a.DOUBLE_PI);
  17167. return b
  17168. };
  17169. a.DOUBLE_PI = 2 * Math.PI;
  17170. a._helpMatrix = new e.Matrix;
  17171. return a
  17172. }
  17173. ();
  17174. b.TransformUtil = f;
  17175. f.prototype.__class__ = "dragonBones.utils.TransformUtil";
  17176. d = function () {
  17177. function b() {}
  17178. b.transformArmatureData = function (a) {
  17179. for (var b = a.getBoneDataList(), c = b.length, d, e; c--; )
  17180. if (d = b[c], d.parent && (e = a.getBoneData(d.parent)))
  17181. d.transform.copy(d.global), f.transformPointWithParent(d.transform, e.global)
  17182. };
  17183. b.transformArmatureDataAnimations = function (a) {
  17184. for (var c = a.getAnimationDataList(), d = c.length; d--; )
  17185. b.transformAnimationData(c[d],
  17186. a)
  17187. };
  17188. b.transformAnimationData = function (a, c) {
  17189. for (var d = c.getSkinData(null), e = c.getBoneDataList(), d = d.getSlotDataList(), m = e.length, g, h, l, u, y, E, D, C, s, J; m--; )
  17190. if (g = e[m], h = a.getTimeline(g.name)) {
  17191. l = null;
  17192. for (var L in d)
  17193. if (l = d[L], l.parent == g.name)
  17194. break;
  17195. u = g.parent ? a.getTimeline(g.parent) : null;
  17196. y = h.getFrameList();
  17197. C = D = E = null;
  17198. J = y.length;
  17199. for (var G = 0; G < J; G++) {
  17200. s = y[G];
  17201. u ? (b._helpTransform1.copy(s.global), b.getTimelineTransform(u, s.position, b._helpTransform2), f.transformPointWithParent(b._helpTransform1, b._helpTransform2),
  17202. s.transform.copy(b._helpTransform1)) : s.transform.copy(s.global);
  17203. s.transform.x -= g.transform.x;
  17204. s.transform.y -= g.transform.y;
  17205. s.transform.skewX -= g.transform.skewX;
  17206. s.transform.skewY -= g.transform.skewY;
  17207. s.transform.scaleX -= g.transform.scaleX;
  17208. s.transform.scaleY -= g.transform.scaleY;
  17209. !h.transformed && l && (s.zOrder -= l.zOrder);
  17210. E || (E = h.originTransform, E.copy(s.transform), E.skewX = f.formatRadian(E.skewX), E.skewY = f.formatRadian(E.skewY), D = h.originPivot, D.x = s.pivot.x, D.y = s.pivot.y);
  17211. s.transform.x -= E.x;
  17212. s.transform.y -=
  17213. E.y;
  17214. s.transform.skewX = f.formatRadian(s.transform.skewX - E.skewX);
  17215. s.transform.skewY = f.formatRadian(s.transform.skewY - E.skewY);
  17216. s.transform.scaleX -= E.scaleX;
  17217. s.transform.scaleY -= E.scaleY;
  17218. h.transformed || (s.pivot.x -= D.x, s.pivot.y -= D.y);
  17219. if (C) {
  17220. var I = s.transform.skewX - C.transform.skewX;
  17221. C.tweenRotate ? 0 < C.tweenRotate ? (0 > I && (s.transform.skewX += 2 * Math.PI, s.transform.skewY += 2 * Math.PI), 1 < C.tweenRotate && (s.transform.skewX += 2 * Math.PI * (C.tweenRotate - 1), s.transform.skewY += 2 * Math.PI * (C.tweenRotate - 1))) : (0 < I && (s.transform.skewX -=
  17222. 2 * Math.PI, s.transform.skewY -= 2 * Math.PI), 1 > C.tweenRotate && (s.transform.skewX += 2 * Math.PI * (C.tweenRotate + 1), s.transform.skewY += 2 * Math.PI * (C.tweenRotate + 1))) : (s.transform.skewX = C.transform.skewX + f.formatRadian(s.transform.skewX - C.transform.skewX), s.transform.skewY = C.transform.skewY + f.formatRadian(s.transform.skewY - C.transform.skewY))
  17223. }
  17224. C = s
  17225. }
  17226. h.transformed = !0
  17227. }
  17228. };
  17229. b.getTimelineTransform = function (a, b, d) {
  17230. for (var e = a.getFrameList(), m = e.length, g; m--; )
  17231. if (a = e[m], a.position <= b && a.position + a.duration > b) {
  17232. g = a.tweenEasing;
  17233. m == e.length - 1 || isNaN(g) || b == a.position ? d.copy(a.global) : (b = (b - a.position) / a.duration, g && (b = c.TimelineState.getEaseValue(b, g)), e = e[m + 1], d.x = a.global.x + (e.global.x - a.global.x) * b, d.y = a.global.y + (e.global.y - a.global.y) * b, d.skewX = f.formatRadian(a.global.skewX + (e.global.skewX - a.global.skewX) * b), d.skewY = f.formatRadian(a.global.skewY + (e.global.skewY - a.global.skewY) * b), d.scaleX = a.global.scaleX + (e.global.scaleX - a.global.scaleX) * b, d.scaleY = a.global.scaleY + (e.global.scaleY - a.global.scaleY) * b);
  17234. break
  17235. }
  17236. };
  17237. b.addHideTimeline =
  17238. function (b, c) {
  17239. for (var d = c.getBoneDataList(), e = d.length, f; e--; )
  17240. f = d[e], f = f.name, b.getTimeline(f) || b.addTimeline(a.TransformTimeline.HIDE_TIMELINE, f)
  17241. };
  17242. b._helpTransform1 = new a.DBTransform;
  17243. b._helpTransform2 = new a.DBTransform;
  17244. return b
  17245. }
  17246. ();
  17247. b.DBDataUtil = d;
  17248. d.prototype.__class__ = "dragonBones.utils.DBDataUtil"
  17249. })(d.utils || (d.utils = {}));
  17250. var b = d.utils,
  17251. m = function () {
  17252. function b() {
  17253. this.global = new a.DBTransform;
  17254. this.origin = new a.DBTransform;
  17255. this.offset = new a.DBTransform;
  17256. this.tween = new a.DBTransform;
  17257. this.tween.scaleX =
  17258. this.tween.scaleY = 0;
  17259. this._globalTransformMatrix = new e.Matrix;
  17260. this._visible = !0;
  17261. this._isDisplayOnStage = this._isColorChanged = !1;
  17262. this._scaleType = 0;
  17263. this.fixedRotation = !1
  17264. }
  17265. b.prototype.getVisible = function () {
  17266. return this._visible
  17267. };
  17268. b.prototype.setVisible = function (a) {
  17269. this._visible = a
  17270. };
  17271. b.prototype._setParent = function (a) {
  17272. this.parent = a
  17273. };
  17274. b.prototype._setArmature = function (a) {
  17275. this.armature && this.armature._removeDBObject(this);
  17276. (this.armature = a) && this.armature._addDBObject(this)
  17277. };
  17278. b.prototype.dispose = function () {
  17279. this._globalTransformMatrix =
  17280. this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  17281. };
  17282. b.prototype._update = function () {
  17283. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  17284. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  17285. if (this.parent) {
  17286. var a = this.origin.x + this.offset.x + this.tween.x,
  17287. b = this.origin.y + this.offset.y + this.tween.y,
  17288. c = this.parent._globalTransformMatrix;
  17289. this._globalTransformMatrix.tx = this.global.x = c.a * a + c.c * b + c.tx;
  17290. this._globalTransformMatrix.ty = this.global.y =
  17291. c.d * b + c.b * a + c.ty;
  17292. this.fixedRotation ? (this.global.skewX = 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);
  17293. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX, this.global.scaleY *= this.parent.global.scaleY)
  17294. } else
  17295. this._globalTransformMatrix.tx =
  17296. this.global.x = 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;
  17297. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  17298. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  17299. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  17300. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  17301. };
  17302. return b
  17303. }
  17304. ();
  17305. d.DBObject = m;
  17306. m.prototype.__class__ = "dragonBones.DBObject";
  17307. var u = function (a) {
  17308. function b(c) {
  17309. a.call(this);
  17310. this._displayBridge = c;
  17311. this._displayList = [];
  17312. this._displayIndex = -1;
  17313. this._scaleType = 1;
  17314. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  17315. this._isHideDisplay = this._isDisplayOnStage = !1;
  17316. this._blendMode = "normal";
  17317. this._displayBridge.updateBlendMode(this._blendMode)
  17318. }
  17319. __extends(b, a);
  17320. b.prototype.getZOrder = function () {
  17321. return this._originZOrder +
  17322. this._tweenZorder + this._offsetZOrder
  17323. };
  17324. b.prototype.setZOrder = function (a) {
  17325. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  17326. };
  17327. b.prototype.getDisplay = function () {
  17328. var a = this._displayList[this._displayIndex];
  17329. return a instanceof h ? a.getDisplay() : a
  17330. };
  17331. b.prototype.setDisplay = function (a) {
  17332. this._displayList[this._displayIndex] = a;
  17333. this._setDisplay(a)
  17334. };
  17335. b.prototype.getBlendMode = function () {
  17336. return this._blendMode
  17337. };
  17338. b.prototype.setBlendMode =
  17339. function (a) {
  17340. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  17341. };
  17342. b.prototype.getChildArmature = function () {
  17343. var a = this._displayList[this._displayIndex];
  17344. return a instanceof h ? a : null
  17345. };
  17346. b.prototype.setChildArmature = function (a) {
  17347. (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  17348. };
  17349. b.prototype.getDisplayList = function () {
  17350. return this._displayList
  17351. };
  17352. b.prototype.setDisplayList = function (a) {
  17353. if (!a)
  17354. throw Error();
  17355. for (var b =
  17356. this._displayList.length = a.length; b--; )
  17357. this._displayList[b] = a[b];
  17358. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  17359. };
  17360. b.prototype._setDisplay = function (a) {
  17361. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  17362. this.updateChildArmatureAnimation();
  17363. a && this._displayBridge.updateBlendMode(this._blendMode);
  17364. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  17365. };
  17366. b.prototype._changeDisplay = function (a) {
  17367. if (0 > a)
  17368. this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  17369. else {
  17370. if (this._isHideDisplay) {
  17371. this._isHideDisplay = !1;
  17372. var b = !0;
  17373. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  17374. }
  17375. var c = this._displayList.length;
  17376. a >= c && 0 < c && (a = c - 1);
  17377. this._displayIndex !=
  17378. a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof h ? 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()
  17379. }
  17380. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  17381. };
  17382. b.prototype.setVisible = function (a) {
  17383. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  17384. };
  17385. b.prototype._setArmature = function (b) {
  17386. a.prototype._setArmature.call(this, b);
  17387. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  17388. };
  17389. b.prototype.dispose = function () {
  17390. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  17391. };
  17392. b.prototype._update = function () {
  17393. a.prototype._update.call(this);
  17394. if (this._isDisplayOnStage) {
  17395. var b =
  17396. this.parent._tweenPivot.x,
  17397. c = this.parent._tweenPivot.y;
  17398. if (b || c) {
  17399. var d = this.parent._globalTransformMatrix;
  17400. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  17401. this._globalTransformMatrix.ty += d.b * b + d.d * c
  17402. }
  17403. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  17404. }
  17405. };
  17406. b.prototype._updateVisible = function (a) {
  17407. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  17408. };
  17409. b.prototype.updateChildArmatureAnimation = function () {
  17410. var a = this.getChildArmature();
  17411. if (a)
  17412. if (this._isHideDisplay)
  17413. a.animation.stop(),
  17414. a.animation._lastAnimationState = null;
  17415. else {
  17416. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  17417. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  17418. }
  17419. };
  17420. return b
  17421. }
  17422. (m);
  17423. d.Slot = u;
  17424. u.prototype.__class__ = "dragonBones.Slot";
  17425. var y = function (a) {
  17426. function b() {
  17427. a.call(this);
  17428. this._children = [];
  17429. this._scaleType = 2;
  17430. this._tweenPivot = new e.Point;
  17431. this.scaleMode = 1
  17432. }
  17433. __extends(b, a);
  17434. b.prototype.setVisible = function (a) {
  17435. if (this._visible != a)
  17436. for (this._visible = a, a = this._children.length; a--; ) {
  17437. var b =
  17438. this._children[a];
  17439. b instanceof u && b._updateVisible(this._visible)
  17440. }
  17441. };
  17442. b.prototype._setArmature = function (b) {
  17443. a.prototype._setArmature.call(this, b);
  17444. for (b = this._children.length; b--; )
  17445. this._children[b]._setArmature(this.armature)
  17446. };
  17447. b.prototype.dispose = function () {
  17448. if (this._children) {
  17449. a.prototype.dispose.call(this);
  17450. for (var b = this._children.length; b--; )
  17451. this._children[b].dispose();
  17452. this._children.length = 0;
  17453. this.slot = this._tweenPivot = this._children = null
  17454. }
  17455. };
  17456. b.prototype.contains = function (a) {
  17457. if (!a)
  17458. throw Error();
  17459. if (a ==
  17460. this)
  17461. return !1;
  17462. for (; a != this && null != a; )
  17463. a = a.parent;
  17464. return a == this
  17465. };
  17466. b.prototype.addChild = function (a) {
  17467. if (!a)
  17468. throw Error();
  17469. if (a == this || a instanceof b && a.contains(this))
  17470. throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");
  17471. a.parent && a.parent.removeChild(a);
  17472. this._children[this._children.length] = a;
  17473. a._setParent(this);
  17474. a._setArmature(this.armature);
  17475. !this.slot && a instanceof u && (this.slot = a)
  17476. };
  17477. b.prototype.removeChild = function (a) {
  17478. if (!a)
  17479. throw Error();
  17480. var b =
  17481. this._children.indexOf(a);
  17482. if (0 <= b)
  17483. this._children.splice(b, 1), a._setParent(null), a._setArmature(null), a == this.slot && (this.slot = null);
  17484. else
  17485. throw Error();
  17486. };
  17487. b.prototype.getSlots = function () {
  17488. for (var a = [], b = this._children.length; b--; )
  17489. this._children[b]instanceof u && a.unshift(this._children[b]);
  17490. return a
  17491. };
  17492. b.prototype._arriveAtFrame = function (a, c, d, e) {
  17493. if (a) {
  17494. if (c = d.getMixingTransform(this.name), !d.displayControl || 2 != c && -1 != c || this.displayController && this.displayController != d.name || !this.slot || (c = a.displayIndex,
  17495. 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),
  17496. c.armature = this.armature, c.animationState = d, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action)
  17497. for (var m in this._children)
  17498. this._children[m]instanceof u && (d = this._children[m].getChildArmature()) && d.animation.gotoAndPlay(a.action)
  17499. } else
  17500. this.slot && this.slot._changeDisplay(-1)
  17501. };
  17502. b.prototype._updateColor = function (a, b, c, d, e, f, m, g, h) {
  17503. (h || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, f, m, g);
  17504. this._isColorChanged = h
  17505. };
  17506. b._soundManager = f.SoundEventManager.getInstance();
  17507. return b
  17508. }
  17509. (m);
  17510. d.Bone = y;
  17511. y.prototype.__class__ = "dragonBones.Bone";
  17512. var h = function (a) {
  17513. function b(d) {
  17514. a.call(this);
  17515. this.animation = new c.Animation(this);
  17516. this._display = d;
  17517. this._slotsZOrderChanged = !1;
  17518. this._slotList = [];
  17519. this._boneList = [];
  17520. this._eventList = []
  17521. }
  17522. __extends(b, a);
  17523. b.prototype.getDisplay = function () {
  17524. return this._display
  17525. };
  17526. b.prototype.dispose = function () {
  17527. if (this.animation) {
  17528. this.animation.dispose();
  17529. for (var a = this._slotList.length; a--; )
  17530. this._slotList[a].dispose();
  17531. for (a = this._boneList.length; a--; )
  17532. this._boneList[a].dispose();
  17533. this._slotList.length = 0;
  17534. this._boneList.length = 0;
  17535. this._eventList.length = 0;
  17536. this.animation = this._display = this._eventList = this._boneList = this._slotList = null
  17537. }
  17538. };
  17539. b.prototype.advanceTime = function (a) {
  17540. this.animation.advanceTime(a);
  17541. a *= this.animation.timeScale;
  17542. for (var b = this._boneList.length; b--; )
  17543. this._boneList[b]._update();
  17544. for (var b = this._slotList.length, c; b--; )
  17545. c = this._slotList[b], c._update(), c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  17546. this._slotsZOrderChanged && (this.updateSlotsZOrder(),
  17547. this.hasEventListener(f.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new f.ArmatureEvent(f.ArmatureEvent.Z_ORDER_UPDATED)));
  17548. if (this._eventList.length) {
  17549. a = this._eventList.length;
  17550. for (b = 0; b < a; b++)
  17551. this.dispatchEvent(this._eventList[b]);
  17552. this._eventList.length = 0
  17553. }
  17554. };
  17555. b.prototype.getSlots = function (a) {
  17556. "undefined" === typeof a && (a = !0);
  17557. return a ? this._slotList.concat() : this._slotList
  17558. };
  17559. b.prototype.getBones = function (a) {
  17560. "undefined" === typeof a && (a = !0);
  17561. return a ? this._boneList.concat() : this._boneList
  17562. };
  17563. b.prototype.getSlot =
  17564. function (a) {
  17565. for (var b = this._slotList.length; b--; )
  17566. if (this._slotList[b].name == a)
  17567. return this._slotList[b];
  17568. return null
  17569. };
  17570. b.prototype.getSlotByDisplay = function (a) {
  17571. if (a)
  17572. for (var b = this._slotList.length; b--; )
  17573. if (this._slotList[b].getDisplay() == a)
  17574. return this._slotList[b];
  17575. return null
  17576. };
  17577. b.prototype.removeSlot = function (a) {
  17578. if (!a)
  17579. throw Error();
  17580. if (0 <= this._slotList.indexOf(a))
  17581. a.parent.removeChild(a);
  17582. else
  17583. throw Error();
  17584. };
  17585. b.prototype.removeSlotByName = function (a) {
  17586. a && (a = this.getSlot(a)) && this.removeSlot(a)
  17587. };
  17588. b.prototype.getBone =
  17589. function (a) {
  17590. for (var b = this._boneList.length; b--; )
  17591. if (this._boneList[b].name == a)
  17592. return this._boneList[b];
  17593. return null
  17594. };
  17595. b.prototype.getBoneByDisplay = function (a) {
  17596. return (a = this.getSlotByDisplay(a)) ? a.parent : null
  17597. };
  17598. b.prototype.removeBone = function (a) {
  17599. if (!a)
  17600. throw Error();
  17601. if (0 <= this._boneList.indexOf(a))
  17602. a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  17603. else
  17604. throw Error();
  17605. };
  17606. b.prototype.removeBoneByName = function (a) {
  17607. a && (a = this.getBone(a)) && this.removeBone(a)
  17608. };
  17609. b.prototype.addChild = function (a, b) {
  17610. if (!a)
  17611. throw Error();
  17612. if (b) {
  17613. var c = this.getBone(b);
  17614. if (c)
  17615. c.addChild(a);
  17616. else
  17617. throw Error();
  17618. } else
  17619. a.parent && a.parent.removeChild(a), a._setArmature(this)
  17620. };
  17621. b.prototype.updateSlotsZOrder = function () {
  17622. this._slotList.sort(this.sortSlot);
  17623. for (var a = this._slotList.length, b; a--; )
  17624. b = this._slotList[a], b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  17625. this._slotsZOrderChanged = !1
  17626. };
  17627. b.prototype._addDBObject = function (a) {
  17628. a instanceof u ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof y && 0 > this._boneList.indexOf(a) &&
  17629. (this._boneList[this._boneList.length] = a, this._sortBoneList())
  17630. };
  17631. b.prototype._removeDBObject = function (a) {
  17632. a instanceof u ? (a = this._slotList.indexOf(a), 0 <= a && this._slotList.splice(a, 1)) : a instanceof y && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  17633. };
  17634. b.prototype._sortBoneList = function () {
  17635. var a = this._boneList.length;
  17636. if (0 != a) {
  17637. for (var b = [], c, d, e; a--; ) {
  17638. c = 0;
  17639. for (e = d = this._boneList[a]; e; )
  17640. c++, e = e.parent;
  17641. b[a] = {
  17642. level : c,
  17643. bone : d
  17644. }
  17645. }
  17646. b.sort(this.sortBone);
  17647. for (a = b.length; a--; )
  17648. this._boneList[a] = b[a].bone
  17649. }
  17650. };
  17651. b.prototype._arriveAtFrame = function (a, c, d, e) {
  17652. a.event && this.hasEventListener(f.FrameEvent.ANIMATION_FRAME_EVENT) && (c = new f.FrameEvent(f.FrameEvent.ANIMATION_FRAME_EVENT), c.animationState = d, c.frameLabel = a.event, this._eventList.push(c));
  17653. a.sound && b._soundManager.hasEventListener(f.SoundEvent.SOUND) && (c = new f.SoundEvent(f.SoundEvent.SOUND), c.armature = this, c.animationState = d, c.sound = a.sound, b._soundManager.dispatchEvent(c));
  17654. a.action && d.isPlaying && this.animation.gotoAndPlay(a.action)
  17655. };
  17656. b.prototype.sortSlot =
  17657. function (a, b) {
  17658. return a.getZOrder() < b.getZOrder() ? 1 : -1
  17659. };
  17660. b.prototype.sortBone = function (a, b) {
  17661. return a.level < b.level ? 1 : -1
  17662. };
  17663. b._soundManager = f.SoundEventManager.getInstance();
  17664. return b
  17665. }
  17666. (f.EventDispatcher);
  17667. d.Armature = h;
  17668. h.prototype.__class__ = "dragonBones.Armature"
  17669. })(dragonBones || (dragonBones = {}));
  17670. __extends = this.__extends || function (d, e) {
  17671. function f() {
  17672. this.constructor = d
  17673. }
  17674. for (var c in e)
  17675. e.hasOwnProperty(c) && (d[c] = e[c]);
  17676. f.prototype = e.prototype;
  17677. d.prototype = new f
  17678. };
  17679. (function (d) {
  17680. (function (d) {
  17681. var c = function () {
  17682. function a() {}
  17683. a.prototype.getVisible = function () {
  17684. return this._display ? this._display.visible : !1
  17685. };
  17686. a.prototype.setVisible = function (a) {
  17687. this._display && (this._display.visible = a)
  17688. };
  17689. a.prototype.getDisplay = function () {
  17690. return this._display
  17691. };
  17692. a.prototype.setDisplay = function (a) {
  17693. if (this._display != a) {
  17694. if (this._display) {
  17695. var c = this._display.parent;
  17696. if (c)
  17697. var d = c.getChildIndex(this._display);
  17698. this.removeDisplay()
  17699. }
  17700. this._display = a;
  17701. this.addDisplay(c, d)
  17702. }
  17703. };
  17704. a.prototype.dispose = function () {
  17705. this._display =
  17706. null
  17707. };
  17708. a.prototype.updateTransform = function (b, c) {
  17709. this._display._x = b.tx;
  17710. this._display._y = b.ty;
  17711. this._display._skewX = c.skewX * a.RADIAN_TO_ANGLE;
  17712. this._display._skewY = c.skewY * a.RADIAN_TO_ANGLE;
  17713. this._display._scaleX = c.scaleX;
  17714. this._display._scaleY = c.scaleY;
  17715. this._display._setSizeDirty()
  17716. };
  17717. a.prototype.updateColor = function (a, c, d, e, f, g, l, k) {
  17718. this._display && (this._display._alpha = f)
  17719. };
  17720. a.prototype.updateBlendMode = function (a) {
  17721. this._display && a && (this._display.blendMode = a)
  17722. };
  17723. a.prototype.addDisplay = function (a, c) {
  17724. a && this._display &&
  17725. (this._display._parent && this._display._parent.removeChild(this._display), 0 > c ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(c, a.numChildren)))
  17726. };
  17727. a.prototype.removeDisplay = function () {
  17728. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  17729. };
  17730. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  17731. return a
  17732. }
  17733. ();
  17734. d.DragonBonesEgretBridge = c;
  17735. c.prototype.__class__ = "dragonBones.display.DragonBonesEgretBridge"
  17736. })(d.display || (d.display = {}));
  17737. var e = d.display;
  17738. (function (e) {
  17739. var c = function () {
  17740. function a(a,
  17741. c, e) {
  17742. "undefined" === typeof e && (e = 1);
  17743. this.texture = a;
  17744. this.textureAtlasRawData = c;
  17745. this._textureData = {};
  17746. this.scale = e;
  17747. this.name = c[d.utils.ConstValues.A_NAME];
  17748. this.parseData(c);
  17749. this.spriteSheet = new egret.SpriteSheet(a)
  17750. }
  17751. a.prototype.getTexture = function (a) {
  17752. var c = this.spriteSheet.getTexture(a);
  17753. c || (c = this._textureData[a], c = this.spriteSheet.createTexture(a, c.x, c.y, c.width, c.height));
  17754. return c
  17755. };
  17756. a.prototype.dispose = function () {
  17757. this.texture = null
  17758. };
  17759. a.prototype.getRegion = function (a) {
  17760. throw Error("error");
  17761. };
  17762. a.prototype.parseData =
  17763. function (a) {
  17764. for (var c = a.SubTexture.length, d = 0; d < c; d++) {
  17765. var e = a.SubTexture[d];
  17766. this._textureData[e.name] = e
  17767. }
  17768. };
  17769. return a
  17770. }
  17771. ();
  17772. e.EgretTextureAtlas = c;
  17773. c.prototype.__class__ = "dragonBones.textures.EgretTextureAtlas"
  17774. })(d.textures || (d.textures = {}));
  17775. (function (f) {
  17776. var c = function (a) {
  17777. function b() {
  17778. a.call(this)
  17779. }
  17780. __extends(b, a);
  17781. b.prototype._generateArmature = function () {
  17782. return new d.Armature(new egret.DisplayObjectContainer)
  17783. };
  17784. b.prototype._generateSlot = function () {
  17785. return new d.Slot(new e.DragonBonesEgretBridge)
  17786. };
  17787. b.prototype._generateDisplay =
  17788. function (a, b, c, d) {
  17789. var e = new egret.Bitmap;
  17790. e.texture = a.getTexture(b);
  17791. e.anchorOffsetX = c;
  17792. e.anchorOffsetY = d;
  17793. return e
  17794. };
  17795. return b
  17796. }
  17797. (f.BaseFactory);
  17798. f.EgretFactory = c;
  17799. c.prototype.__class__ = "dragonBones.factorys.EgretFactory"
  17800. })(d.factorys || (d.factorys = {}))
  17801. })(dragonBones || (dragonBones = {}));
  17802. __extends = this.__extends || function (d, e) {
  17803. function f() {
  17804. this.constructor = d
  17805. }
  17806. for (var c in e)
  17807. e.hasOwnProperty(c) && (d[c] = e[c]);
  17808. f.prototype = e.prototype;
  17809. d.prototype = new f
  17810. };
  17811. (function (d) {
  17812. var e = function (e) {
  17813. function c(a) {
  17814. "undefined" === typeof a && (a = 60);
  17815. e.call(this);
  17816. this.frameRate = a;
  17817. this._time = 0;
  17818. 60 == a && (c.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, c.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame ||
  17819. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  17820. c.requestAnimationFrame || (c.requestAnimationFrame = function (b) {
  17821. return window.setTimeout(b, 1E3 / a)
  17822. });
  17823. c.cancelAnimationFrame || (c.cancelAnimationFrame = function (a) {
  17824. return window.clearTimeout(a)
  17825. });
  17826. c.instance = this;
  17827. this.registerListener()
  17828. }
  17829. __extends(c, e);
  17830. c.prototype.enterFrame = function () {
  17831. var a = c.instance,
  17832. b = c._thisObject,
  17833. e = c._callback,
  17834. f = d.getTimer();
  17835. e.call(b,
  17836. f - a._time);
  17837. a._time = f;
  17838. a._requestAnimationId = c.requestAnimationFrame.call(window, c.prototype.enterFrame)
  17839. };
  17840. c.prototype.executeMainLoop = function (a, b) {
  17841. c._callback = a;
  17842. c._thisObject = b;
  17843. this.enterFrame()
  17844. };
  17845. c.prototype.reset = function () {
  17846. var a = c.instance;
  17847. a._requestAnimationId && (a._time = d.getTimer(), c.cancelAnimationFrame.call(window, a._requestAnimationId), a.enterFrame())
  17848. };
  17849. c.prototype.registerListener = function () {
  17850. var a = function () {
  17851. c.instance.reset()
  17852. },
  17853. b = function () {
  17854. document[d] || a()
  17855. };
  17856. window.onfocus = a;
  17857. window.onblur = function () {};
  17858. var d,
  17859. e;
  17860. "undefined" !== typeof document.hidden ? (d = "hidden", e = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", e = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", e = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", e = "webkitvisibilitychange");
  17861. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", a, !1);
  17862. d && e && document.addEventListener(e, b, !1)
  17863. };
  17864. return c
  17865. }
  17866. (d.DeviceContext);
  17867. d.HTML5DeviceContext =
  17868. e;
  17869. e.prototype.__class__ = "egret.HTML5DeviceContext"
  17870. })(egret || (egret = {}));
  17871. __extends = this.__extends || function (d, e) {
  17872. function f() {
  17873. this.constructor = d
  17874. }
  17875. for (var c in e)
  17876. e.hasOwnProperty(c) && (d[c] = e[c]);
  17877. f.prototype = e.prototype;
  17878. d.prototype = new f
  17879. };
  17880. (function (d) {
  17881. var e = function (e) {
  17882. function c(a) {
  17883. this.canvas = a;
  17884. this.canvasContext = a.getContext("2d");
  17885. var b = this.canvasContext.setTransform,
  17886. c = this;
  17887. this.canvasContext.setTransform = function (a, d, e, f, l, k) {
  17888. c._matrixA = a;
  17889. c._matrixB = d;
  17890. c._matrixC = e;
  17891. c._matrixD = f;
  17892. c._matrixTx = l;
  17893. c._matrixTy = k;
  17894. b.call(c.canvasContext, a, d, e, f, l, k)
  17895. };
  17896. this._matrixA = 1;
  17897. this._matrixC = this._matrixB = 0;
  17898. this._matrixD = 1;
  17899. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  17900. e.call(this)
  17901. }
  17902. __extends(c, e);
  17903. c.prototype.clearScreen = function () {
  17904. this.setTransform(d.Matrix.identity.identity());
  17905. for (var a = d.RenderFilter.getInstance().getDrawAreaList(), b = 0, c = a.length; b < c; b++) {
  17906. var e = a[b];
  17907. this.clearRect(e.x + this._transformTx, e.y + this._transformTy, e.width, e.height)
  17908. }
  17909. this.renderCost = 0
  17910. };
  17911. c.prototype.clearRect = function (a, b, c, d) {
  17912. this.canvasContext.clearRect(a, b, c, d)
  17913. };
  17914. c.prototype.drawImage = function (a, b, c, u, y, h, g, l, k) {
  17915. b /= d.MainContext.instance.rendererContext.texture_scale_factor;
  17916. c /= d.MainContext.instance.rendererContext.texture_scale_factor;
  17917. u /= d.MainContext.instance.rendererContext.texture_scale_factor;
  17918. y /= d.MainContext.instance.rendererContext.texture_scale_factor;
  17919. a = a._bitmapData;
  17920. h += this._transformTx;
  17921. g += this._transformTy;
  17922. var n = d.getTimer();
  17923. this.canvasContext.drawImage(a, b, c, u, y, h, g, l, k);
  17924. e.prototype.drawImage.call(this, a, b, c, u, y, h, g, l, k);
  17925. this.renderCost += d.getTimer() - n
  17926. };
  17927. c.prototype.setTransform = function (a) {
  17928. 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 =
  17929. this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  17930. };
  17931. c.prototype.setAlpha = function (a, b) {
  17932. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  17933. b ? (this.blendValue = b, this.canvasContext.globalCompositeOperation = b) : this.blendValue != d.BlendMode.NORMAL && (this.blendValue = d.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = d.BlendMode.NORMAL)
  17934. };
  17935. c.prototype.setupFont = function (a) {
  17936. var b = this.canvasContext,
  17937. c = a.italic ? "italic " : "normal ",
  17938. c = c + (a.bold ? "bold " : "normal "),
  17939. c = c + (a.size + "px " + a.fontFamily);
  17940. b.font = c;
  17941. b.textAlign = "left";
  17942. b.textBaseline = "middle"
  17943. };
  17944. c.prototype.measureText = function (a) {
  17945. return this.canvasContext.measureText(a).width
  17946. };
  17947. c.prototype.drawText = function (a, b, c, d, y) {
  17948. var h = a._strokeColorString,
  17949. g = a.stroke,
  17950. l = this.canvasContext;
  17951. l.fillStyle = a._textColorString;
  17952. l.strokeStyle = h;
  17953. g && (l.lineWidth = 2 * g, l.strokeText(b, c + this._transformTx, d + this._transformTy,
  17954. y || 65535));
  17955. l.fillText(b, c + this._transformTx, d + this._transformTy, y || 65535);
  17956. e.prototype.drawText.call(this, a, b, c, d, y)
  17957. };
  17958. c.prototype.strokeRect = function (a, b, c, d, e) {
  17959. this.canvasContext.strokeStyle = e;
  17960. this.canvasContext.strokeRect(a, b, c, d)
  17961. };
  17962. c.prototype.pushMask = function (a) {
  17963. this.canvasContext.save();
  17964. this.canvasContext.beginPath();
  17965. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  17966. this.canvasContext.clip();
  17967. this.canvasContext.closePath()
  17968. };
  17969. c.prototype.popMask = function () {
  17970. this.canvasContext.restore();
  17971. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17972. };
  17973. return c
  17974. }
  17975. (d.RendererContext);
  17976. d.HTML5CanvasRenderer = e;
  17977. e.prototype.__class__ = "egret.HTML5CanvasRenderer"
  17978. })(egret || (egret = {}));
  17979. var egret_h5_graphics;
  17980. (function (d) {
  17981. d.beginFill = function (d, c) {
  17982. "undefined" === typeof c && (c = 1);
  17983. var a = "rgba(" + (d >> 16) + "," + ((d & 65280) >> 8) + "," + (d & 255) + "," + c + ")";
  17984. this.fillStyleColor = a;
  17985. this.commandQueue.push(new e(this._setStyle, this, [a]))
  17986. };
  17987. d.drawRect = function (d, c, a, b) {
  17988. this.commandQueue.push(new e(function (a, b, c, d) {
  17989. var e = this.renderContext;
  17990. this.canvasContext.beginPath();
  17991. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  17992. this.canvasContext.closePath()
  17993. }, this, [d, c, a, b]));
  17994. this._fill()
  17995. };
  17996. d.drawCircle = function (d, c, a) {
  17997. this.commandQueue.push(new e(function (a,
  17998. c, d) {
  17999. var e = this.renderContext;
  18000. this.canvasContext.beginPath();
  18001. this.canvasContext.arc(e._transformTx + a, e._transformTy + c, d, 0, 2 * Math.PI);
  18002. this.canvasContext.closePath()
  18003. }, this, [d, c, a]));
  18004. this._fill()
  18005. };
  18006. d.lineStyle = function (d, c, a, b, m, u, y, h) {
  18007. "undefined" === typeof d && (d = NaN);
  18008. "undefined" === typeof c && (c = 0);
  18009. "undefined" === typeof a && (a = 1);
  18010. "undefined" === typeof b && (b = !1);
  18011. "undefined" === typeof m && (m = "normal");
  18012. "undefined" === typeof u && (u = null);
  18013. "undefined" === typeof y && (y = null);
  18014. "undefined" === typeof h && (h = 3);
  18015. this.strokeStyleColor &&
  18016. (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  18017. this.strokeStyleColor = c = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + a + ")";
  18018. this.commandQueue.push(new e(function (a, b) {
  18019. this.canvasContext.lineWidth = a;
  18020. this.canvasContext.strokeStyle = b;
  18021. this.canvasContext.beginPath()
  18022. }, this, [d, c]));
  18023. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  18024. this.moveTo(this.lineX, this.lineY)
  18025. };
  18026. d.lineTo = function (d, c) {
  18027. this.commandQueue.push(new e(function (a, b) {
  18028. var c = this.renderContext;
  18029. this.canvasContext.lineTo(c._transformTx +
  18030. a, c._transformTy + b)
  18031. }, this, [d, c]));
  18032. this.lineX = d;
  18033. this.lineY = c
  18034. };
  18035. d.curveTo = function (d, c, a, b) {
  18036. this.commandQueue.push(new e(function (a, b, c, d) {
  18037. var e = this.renderContext;
  18038. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  18039. }, this, [d, c, a, b]));
  18040. this.lineX = a;
  18041. this.lineY = b
  18042. };
  18043. d.moveTo = function (d, c) {
  18044. this.commandQueue.push(new e(function (a, b) {
  18045. var c = this.renderContext;
  18046. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  18047. }, this, [d, c]))
  18048. };
  18049. d.clear = function () {
  18050. this.lineY = this.lineX = this.commandQueue.length =
  18051. 0;
  18052. this.fillStyleColor = this.strokeStyleColor = null
  18053. };
  18054. d.createEndFillCommand = function () {
  18055. this.endFillCommand || (this.endFillCommand = new e(function () {
  18056. this.canvasContext.fill();
  18057. this.canvasContext.closePath()
  18058. }, this, null))
  18059. };
  18060. d.endFill = function () {
  18061. null != this.fillStyleColor && this._fill();
  18062. this.fillStyleColor = null
  18063. };
  18064. d._fill = function () {
  18065. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  18066. };
  18067. d.createEndLineCommand = function () {
  18068. this.endLineCommand || (this.endLineCommand = new e(function () {
  18069. this.canvasContext.stroke();
  18070. this.canvasContext.closePath()
  18071. }, this, null))
  18072. };
  18073. d._draw = function (d) {
  18074. this.renderContext = d;
  18075. d = this.canvasContext = this.renderContext.canvasContext;
  18076. d.save();
  18077. var c = this.commandQueue.length;
  18078. this.strokeStyleColor && 0 < c && this.commandQueue[c - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), c = this.commandQueue.length);
  18079. for (var a = 0; a < c; a++) {
  18080. var b = this.commandQueue[a];
  18081. b.method.apply(b.thisObject, b.args)
  18082. }
  18083. d.restore()
  18084. };
  18085. var e = function () {
  18086. return function (d, c, a) {
  18087. this.method =
  18088. d;
  18089. this.thisObject = c;
  18090. this.args = a
  18091. }
  18092. }
  18093. ();
  18094. e.prototype.__class__ = "Command";
  18095. d._setStyle = function (d) {
  18096. this.canvasContext.fillStyle = d;
  18097. this.canvasContext.beginPath()
  18098. };
  18099. d.init = function () {
  18100. for (var e in d)
  18101. egret.Graphics.prototype[e] = d[e];
  18102. egret.RendererContext.createRendererContext = function (c) {
  18103. return new egret.HTML5CanvasRenderer(c)
  18104. }
  18105. }
  18106. })(egret_h5_graphics || (egret_h5_graphics = {}));
  18107. egret_h5_graphics.init();
  18108. __extends = this.__extends || function (d, e) {
  18109. function f() {
  18110. this.constructor = d
  18111. }
  18112. for (var c in e)
  18113. e.hasOwnProperty(c) && (d[c] = e[c]);
  18114. f.prototype = e.prototype;
  18115. d.prototype = new f
  18116. };
  18117. (function (d) {
  18118. var e = function (e) {
  18119. function c(a) {
  18120. e.call(this);
  18121. this.size = 2E3;
  18122. this.vertSize = 6;
  18123. this.contextLost = !1;
  18124. this.glContextId = 0;
  18125. this.currentBlendMode = "";
  18126. this.currentBaseTexture = null;
  18127. this.currentBatchSize = 0;
  18128. this.maskList = [];
  18129. this.maskDataFreeList = [];
  18130. this.canvasContext = document.createElement("canvas").getContext("2d");
  18131. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  18132. this.canvas = a;
  18133. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  18134. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this),
  18135. !1);
  18136. this.projectionX = a.width / 2;
  18137. this.projectionY = -a.height / 2;
  18138. a = 6 * this.size;
  18139. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  18140. this.indices = new Uint16Array(a);
  18141. for (var b = 0, c = 0; b < a; b += 6, c += 4)
  18142. this.indices[b + 0] = c + 0, this.indices[b + 1] = c + 1, this.indices[b + 2] = c + 2, this.indices[b + 3] = c + 0, this.indices[b + 4] = c + 2, this.indices[b + 5] = c + 3;
  18143. this.initWebGL();
  18144. this.shaderManager = new d.WebGLShaderManager(this.gl);
  18145. this.worldTransform = new d.Matrix;
  18146. this.initBlendMode();
  18147. d.MainContext.instance.addEventListener(d.Event.FINISH_RENDER,
  18148. this._draw, this);
  18149. d.TextField.prototype._draw = function (a) {
  18150. this.getDirty() && (this.cacheAsBitmap = !0);
  18151. d.DisplayObject.prototype._draw.call(this, a)
  18152. }
  18153. }
  18154. __extends(c, e);
  18155. c.prototype.handleContextLost = function () {
  18156. this.contextLost = !0
  18157. };
  18158. c.prototype.handleContextRestored = function () {
  18159. this.initWebGL();
  18160. this.shaderManager.setContext(this.gl);
  18161. this.contextLost = !1
  18162. };
  18163. c.prototype.initWebGL = function () {
  18164. for (var a = {
  18165. stencil : !0
  18166. }, b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  18167. try {
  18168. b = this.canvas.getContext(c[d], a)
  18169. } catch (e) {}
  18170. if (b)
  18171. break
  18172. }
  18173. if (!b)
  18174. throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  18175. this.setContext(b)
  18176. };
  18177. c.prototype.setContext = function (a) {
  18178. this.gl = a;
  18179. a.id = this.glContextId++;
  18180. this.vertexBuffer = a.createBuffer();
  18181. this.indexBuffer = a.createBuffer();
  18182. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  18183. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  18184. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  18185. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  18186. a.disable(a.DEPTH_TEST);
  18187. a.disable(a.CULL_FACE);
  18188. a.enable(a.BLEND);
  18189. a.colorMask(!0, !0, !0, !0)
  18190. };
  18191. c.prototype.initBlendMode = function () {
  18192. c.blendModesWebGL[d.BlendMode.NORMAL] =
  18193. [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  18194. c.blendModesWebGL[d.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  18195. };
  18196. c.prototype.start = function () {
  18197. if (!this.contextLost) {
  18198. var a = this.gl;
  18199. a.activeTexture(a.TEXTURE0);
  18200. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  18201. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  18202. var b = this.shaderManager.defaultShader;
  18203. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  18204. var c = 4 * this.vertSize;
  18205. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  18206. a.vertexAttribPointer(b.aTextureCoord,
  18207. 2, a.FLOAT, !1, c, 8);
  18208. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  18209. }
  18210. };
  18211. c.prototype.clearScreen = function () {
  18212. var a = this.gl;
  18213. a.colorMask(!0, !0, !0, !0);
  18214. for (var b = d.RenderFilter.getInstance().getDrawAreaList(), c = 0, e = b.length; c < e; c++) {
  18215. var f = b[c];
  18216. a.viewport(f.x, f.y, f.width, f.height);
  18217. a.bindFramebuffer(a.FRAMEBUFFER, null);
  18218. a.clearColor(0, 0, 0, 0);
  18219. a.clear(a.COLOR_BUFFER_BIT)
  18220. }
  18221. this.renderCost = 0
  18222. };
  18223. c.prototype.setBlendMode = function (a) {
  18224. a || (a = d.BlendMode.NORMAL);
  18225. if (this.currentBlendMode != a) {
  18226. var b = c.blendModesWebGL[a];
  18227. b && (this.gl.blendFunc(b[0], b[1]), this.currentBlendMode = a)
  18228. }
  18229. };
  18230. c.prototype.drawImage = function (a, b, c, e, f, h, g, l, k) {
  18231. if (!this.contextLost) {
  18232. var n = d.MainContext.instance.rendererContext.texture_scale_factor;
  18233. b /= n;
  18234. c /= n;
  18235. e /= n;
  18236. f /= n;
  18237. this.createWebGLTexture(a);
  18238. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size)
  18239. this._draw(), this.currentBaseTexture = a.webGLTexture;
  18240. var q = this.worldTransform,
  18241. p = q.a,
  18242. r = q.b,
  18243. x = q.c,
  18244. z = q.d,
  18245. v = q.tx,
  18246. A = q.ty;
  18247. 0 == h && 0 == g || q.append(1, 0, 0, 1, h, g);
  18248. 1 == e / l && 1 == f / k || q.append(l / e,
  18249. 0, 0, k / f, 0, 0);
  18250. h = q.a;
  18251. g = q.b;
  18252. l = q.c;
  18253. k = q.d;
  18254. var n = q.tx,
  18255. t = q.ty;
  18256. q.a = p;
  18257. q.b = r;
  18258. q.c = x;
  18259. q.d = z;
  18260. q.tx = v;
  18261. q.ty = A;
  18262. p = a._sourceWidth;
  18263. r = a._sourceHeight;
  18264. a = e;
  18265. q = f;
  18266. b /= p;
  18267. c /= r;
  18268. e /= p;
  18269. f /= r;
  18270. p = this.vertices;
  18271. r = 4 * this.currentBatchSize * this.vertSize;
  18272. x = this.worldAlpha;
  18273. p[r++] = n;
  18274. p[r++] = t;
  18275. p[r++] = b;
  18276. p[r++] = c;
  18277. p[r++] = x;
  18278. p[r++] = 16777215;
  18279. p[r++] = h * a + n;
  18280. p[r++] = g * a + t;
  18281. p[r++] = e + b;
  18282. p[r++] = c;
  18283. p[r++] = x;
  18284. p[r++] = 16777215;
  18285. p[r++] = h * a + l * q + n;
  18286. p[r++] = k * q + g * a + t;
  18287. p[r++] = e + b;
  18288. p[r++] = f + c;
  18289. p[r++] = x;
  18290. p[r++] = 16777215;
  18291. p[r++] = l * q + n;
  18292. p[r++] = k * q + t;
  18293. p[r++] = b;
  18294. p[r++] = f + c;
  18295. p[r++] = x;
  18296. p[r++] =
  18297. 16777215;
  18298. this.currentBatchSize++
  18299. }
  18300. };
  18301. c.prototype._draw = function () {
  18302. if (0 != this.currentBatchSize && !this.contextLost) {
  18303. var a = d.getTimer();
  18304. this.start();
  18305. var b = this.gl;
  18306. b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
  18307. var c = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  18308. b.bufferSubData(b.ARRAY_BUFFER, 0, c);
  18309. b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
  18310. this.currentBatchSize = 0;
  18311. this.renderCost += d.getTimer() - a;
  18312. d.Profiler.getInstance().onDrawImage()
  18313. }
  18314. };
  18315. c.prototype.setTransform =
  18316. function (a) {
  18317. var b = this.worldTransform;
  18318. b.a = a.a;
  18319. b.b = a.b;
  18320. b.c = a.c;
  18321. b.d = a.d;
  18322. b.tx = a.tx;
  18323. b.ty = a.ty
  18324. };
  18325. c.prototype.setAlpha = function (a, b) {
  18326. this.worldAlpha = a;
  18327. b && this.setBlendMode(b)
  18328. };
  18329. c.prototype.createWebGLTexture = function (a) {
  18330. if (!a.webGLTexture) {
  18331. var b = this.gl;
  18332. a.webGLTexture = b.createTexture();
  18333. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  18334. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  18335. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  18336. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  18337. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  18338. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  18339. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  18340. b.bindTexture(b.TEXTURE_2D, null)
  18341. }
  18342. };
  18343. c.prototype.pushMask = function (a) {
  18344. this._draw();
  18345. var b = this.gl;
  18346. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  18347. var c = this.maskDataFreeList.pop();
  18348. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  18349. x : a.x,
  18350. y : a.y,
  18351. w : a.width,
  18352. h : a.height
  18353. };
  18354. this.maskList.push(c);
  18355. b.colorMask(!1,
  18356. !1, !1, !1);
  18357. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  18358. this.renderGraphics(c);
  18359. b.colorMask(!0, !0, !0, !0);
  18360. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  18361. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  18362. };
  18363. c.prototype.popMask = function () {
  18364. this._draw();
  18365. var a = this.gl,
  18366. b = this.maskList.pop();
  18367. 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));
  18368. 0 == this.maskList.length &&
  18369. a.disable(a.STENCIL_TEST)
  18370. };
  18371. c.prototype.setupFont = function (a) {
  18372. var b = this.canvasContext,
  18373. c = a.italic ? "italic " : "normal ",
  18374. c = c + (a.bold ? "bold " : "normal "),
  18375. c = c + (a.size + "px " + a.fontFamily);
  18376. b.font = c;
  18377. b.textAlign = "left";
  18378. b.textBaseline = "middle"
  18379. };
  18380. c.prototype.measureText = function (a) {
  18381. return this.canvasContext.measureText(a).width
  18382. };
  18383. c.prototype.renderGraphics = function (a) {
  18384. var b = this.gl,
  18385. c = this.shaderManager.primitiveShader;
  18386. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints =
  18387. [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  18388. this.updateGraphics(a);
  18389. this.shaderManager.activateShader(c);
  18390. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  18391. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  18392. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  18393. b.uniform2f(c.offsetVector, 0, 0);
  18394. b.uniform3fv(c.tintColor, [1, 1, 1]);
  18395. b.uniform1f(c.alpha, this.worldAlpha);
  18396. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  18397. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  18398. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  18399. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  18400. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  18401. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  18402. };
  18403. c.prototype.updateGraphics = function (a) {
  18404. var b = this.gl;
  18405. this.buildRectangle(a);
  18406. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  18407. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints),
  18408. b.STATIC_DRAW);
  18409. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  18410. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  18411. };
  18412. c.prototype.buildRectangle = function (a) {
  18413. var b = a.x,
  18414. c = a.y,
  18415. d = a.w;
  18416. a = a.h;
  18417. var e = this.graphicsPoints,
  18418. f = this.graphicsIndices,
  18419. g = e.length / 6;
  18420. e.push(b, c);
  18421. e.push(0, 0, 0, 1);
  18422. e.push(b + d, c);
  18423. e.push(0, 0, 0, 1);
  18424. e.push(b, c + a);
  18425. e.push(0, 0, 0, 1);
  18426. e.push(b + d, c + a);
  18427. e.push(0, 0, 0, 1);
  18428. f.push(g, g, g + 1, g + 2, g + 3, g + 3)
  18429. };
  18430. c.blendModesWebGL = {};
  18431. return c
  18432. }
  18433. (d.RendererContext);
  18434. d.WebGLRenderer =
  18435. e;
  18436. e.prototype.__class__ = "egret.WebGLRenderer"
  18437. })(egret || (egret = {}));
  18438. (function (d) {
  18439. var e = function () {
  18440. function d() {}
  18441. d.compileProgram = function (c, a, b) {
  18442. b = d.compileFragmentShader(c, b);
  18443. a = d.compileVertexShader(c, a);
  18444. var e = c.createProgram();
  18445. c.attachShader(e, a);
  18446. c.attachShader(e, b);
  18447. c.linkProgram(e);
  18448. c.getProgramParameter(e, c.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  18449. return e
  18450. };
  18451. d.compileFragmentShader = function (c, a) {
  18452. return d._compileShader(c, a, c.FRAGMENT_SHADER)
  18453. };
  18454. d.compileVertexShader = function (c, a) {
  18455. return d._compileShader(c, a, c.VERTEX_SHADER)
  18456. };
  18457. d._compileShader =
  18458. function (c, a, b) {
  18459. b = c.createShader(b);
  18460. c.shaderSource(b, a);
  18461. c.compileShader(b);
  18462. return c.getShaderParameter(b, c.COMPILE_STATUS) ? b : (console.log(c.getShaderInfoLog(b)), null)
  18463. };
  18464. d.checkCanUseWebGL = function () {
  18465. if (void 0 == d.canUseWebGL)
  18466. try {
  18467. var c = document.createElement("canvas");
  18468. d.canUseWebGL = !!window.WebGLRenderingContext && !(!c.getContext("webgl") && !c.getContext("experimental-webgl"))
  18469. } catch (a) {
  18470. d.canUseWebGL = !1
  18471. }
  18472. return d.canUseWebGL
  18473. };
  18474. return d
  18475. }
  18476. ();
  18477. d.WebGLUtils = e;
  18478. e.prototype.__class__ = "egret.WebGLUtils"
  18479. })(egret || (egret = {}));
  18480. (function (d) {
  18481. var e = function () {
  18482. function a(a) {
  18483. this.maxAttibs = 10;
  18484. this.attribState = [];
  18485. this.tempAttribState = [];
  18486. for (var c = 0; c < this.maxAttibs; c++)
  18487. this.attribState[c] = !1;
  18488. this.setContext(a)
  18489. }
  18490. a.prototype.setContext = function (a) {
  18491. this.gl = a;
  18492. this.primitiveShader = new c(a);
  18493. this.defaultShader = new f(a);
  18494. this.activateShader(this.defaultShader)
  18495. };
  18496. a.prototype.activateShader = function (a) {
  18497. this.gl.useProgram(a.program);
  18498. this.setAttribs(a.attributes)
  18499. };
  18500. a.prototype.setAttribs = function (a) {
  18501. var c,
  18502. d;
  18503. d = this.tempAttribState.length;
  18504. for (c =
  18505. 0; c < d; c++)
  18506. this.tempAttribState[c] = !1;
  18507. d = a.length;
  18508. for (c = 0; c < d; c++)
  18509. this.tempAttribState[a[c]] = !0;
  18510. a = this.gl;
  18511. d = this.attribState.length;
  18512. for (c = 0; c < d; c++)
  18513. this.attribState[c] !== this.tempAttribState[c] && (this.attribState[c] = this.tempAttribState[c], this.tempAttribState[c] ? a.enableVertexAttribArray(c) : a.disableVertexAttribArray(c))
  18514. };
  18515. return a
  18516. }
  18517. ();
  18518. d.WebGLShaderManager = e;
  18519. e.prototype.__class__ = "egret.WebGLShaderManager";
  18520. var f = function () {
  18521. function a(a) {
  18522. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  18523. this.program = null;
  18524. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  18525. this.gl = a;
  18526. this.init()
  18527. }
  18528. a.prototype.init = function () {
  18529. var a = this.gl,
  18530. c = d.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  18531. a.useProgram(c);
  18532. this.uSampler = a.getUniformLocation(c, "uSampler");
  18533. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  18534. this.offsetVector =
  18535. a.getUniformLocation(c, "offsetVector");
  18536. this.dimensions = a.getUniformLocation(c, "dimensions");
  18537. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  18538. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  18539. this.colorAttribute = a.getAttribLocation(c, "aColor");
  18540. -1 === this.colorAttribute && (this.colorAttribute = 2);
  18541. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  18542. this.program = c
  18543. };
  18544. return a
  18545. }
  18546. ();
  18547. d.EgretShader = f;
  18548. f.prototype.__class__ = "egret.EgretShader";
  18549. var c = function () {
  18550. function a(a) {
  18551. this.alpha =
  18552. this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  18553. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  18554. 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}";
  18555. this.gl = a;
  18556. this.init()
  18557. }
  18558. a.prototype.init = function () {
  18559. var a = this.gl,
  18560. c = d.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  18561. a.useProgram(c);
  18562. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  18563. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  18564. this.tintColor = a.getUniformLocation(c, "tint");
  18565. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  18566. this.colorAttribute = a.getAttribLocation(c, "aColor");
  18567. this.attributes = [this.aVertexPosition, this.colorAttribute];
  18568. this.translationMatrix =
  18569. a.getUniformLocation(c, "translationMatrix");
  18570. this.alpha = a.getUniformLocation(c, "alpha");
  18571. this.program = c
  18572. };
  18573. return a
  18574. }
  18575. ();
  18576. d.PrimitiveShader = c;
  18577. c.prototype.__class__ = "egret.PrimitiveShader"
  18578. })(egret || (egret = {}));
  18579. __extends = this.__extends || function (d, e) {
  18580. function f() {
  18581. this.constructor = d
  18582. }
  18583. for (var c in e)
  18584. e.hasOwnProperty(c) && (d[c] = e[c]);
  18585. f.prototype = e.prototype;
  18586. d.prototype = new f
  18587. };
  18588. (function (d) {
  18589. var e = function (e) {
  18590. function c() {
  18591. e.call(this)
  18592. }
  18593. __extends(c, e);
  18594. c.prototype.proceed = function (a) {
  18595. function b(b) {
  18596. d.IOErrorEvent.dispatchIOErrorEvent(a)
  18597. }
  18598. function c(b) {
  18599. switch (a.dataFormat) {
  18600. case d.URLLoaderDataFormat.TEXT:
  18601. a.data = f.responseText;
  18602. break;
  18603. case d.URLLoaderDataFormat.VARIABLES:
  18604. a.data = new d.URLVariables(f.responseText);
  18605. break;
  18606. case d.URLLoaderDataFormat.BINARY:
  18607. a.data = f.response;
  18608. break;
  18609. default:
  18610. a.data = f.responseText
  18611. }
  18612. d.callLater(d.Event.dispatchEvent, d.Event, a, d.Event.COMPLETE)
  18613. }
  18614. if (a.dataFormat ==
  18615. d.URLLoaderDataFormat.TEXTURE)
  18616. this.loadTexture(a);
  18617. else if (a.dataFormat == d.URLLoaderDataFormat.SOUND)
  18618. this.loadSound(a);
  18619. else {
  18620. var e = a._request,
  18621. f = this.getXHR();
  18622. f.onerror = b;
  18623. f.onload = c;
  18624. f.open(e.method, e.url, !0);
  18625. this.setResponseType(f, a.dataFormat);
  18626. e.method != d.URLRequestMethod.GET && e.data ? e.data instanceof d.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(e.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(e.data)) : f.send()
  18627. }
  18628. };
  18629. c.prototype.loadSound =
  18630. function (a) {
  18631. function b(f) {
  18632. window.clearTimeout(e.__timeoutId);
  18633. e.removeEventListener("canplaythrough", b, !1);
  18634. e.removeEventListener("error", c, !1);
  18635. f = new d.Sound;
  18636. f.audio = e;
  18637. a.data = f;
  18638. d.callLater(d.Event.dispatchEvent, d.Event, a, d.Event.COMPLETE)
  18639. }
  18640. function c(f) {
  18641. window.clearTimeout(e.__timeoutId);
  18642. e.removeEventListener("canplaythrough", b, !1);
  18643. e.removeEventListener("error", c, !1);
  18644. d.IOErrorEvent.dispatchIOErrorEvent(a)
  18645. }
  18646. var e = new Audio(a._request.url);
  18647. e.__timeoutId = window.setTimeout(b, 100);
  18648. e.addEventListener("canplaythrough",
  18649. b, !1);
  18650. e.addEventListener("error", c, !1);
  18651. e.load()
  18652. };
  18653. c.prototype.getXHR = function () {
  18654. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  18655. };
  18656. c.prototype.setResponseType = function (a, b) {
  18657. switch (b) {
  18658. case d.URLLoaderDataFormat.TEXT:
  18659. case d.URLLoaderDataFormat.VARIABLES:
  18660. a.responseType = d.URLLoaderDataFormat.TEXT;
  18661. break;
  18662. case d.URLLoaderDataFormat.BINARY:
  18663. a.responseType = "arraybuffer";
  18664. break;
  18665. default:
  18666. a.responseType = b
  18667. }
  18668. };
  18669. c.prototype.loadTexture = function (a) {
  18670. var b = a._request,
  18671. c = new Image;
  18672. c.crossOrigin = "Anonymous";
  18673. c.onload = function (b) {
  18674. c.onerror = null;
  18675. c.onload = null;
  18676. b = new d.Texture;
  18677. b._setBitmapData(c);
  18678. a.data = b;
  18679. d.callLater(d.Event.dispatchEvent, d.Event, a, d.Event.COMPLETE)
  18680. };
  18681. c.onerror = function (b) {
  18682. c.onerror = null;
  18683. c.onload = null;
  18684. d.IOErrorEvent.dispatchIOErrorEvent(a)
  18685. };
  18686. c.src = b.url
  18687. };
  18688. return c
  18689. }
  18690. (d.NetContext);
  18691. d.HTML5NetContext = e;
  18692. e.prototype.__class__ = "egret.HTML5NetContext"
  18693. })(egret || (egret = {}));
  18694. __extends = this.__extends || function (d, e) {
  18695. function f() {
  18696. this.constructor = d
  18697. }
  18698. for (var c in e)
  18699. e.hasOwnProperty(c) && (d[c] = e[c]);
  18700. f.prototype = e.prototype;
  18701. d.prototype = new f
  18702. };
  18703. (function (d) {
  18704. var e = function (e) {
  18705. function c(a) {
  18706. e.call(this);
  18707. this.canvas = a;
  18708. this._isTouchDown = !1
  18709. }
  18710. __extends(c, e);
  18711. c.prototype.run = function () {
  18712. var a = this;
  18713. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown", function (b) {
  18714. a._onTouchBegin(b);
  18715. b.stopPropagation();
  18716. b.preventDefault()
  18717. }, !1), this.canvas.addEventListener("MSPointerMove", function (b) {
  18718. a._onTouchMove(b);
  18719. b.stopPropagation();
  18720. b.preventDefault()
  18721. }, !1), this.canvas.addEventListener("MSPointerUp", function (b) {
  18722. a._onTouchEnd(b);
  18723. b.stopPropagation();
  18724. b.preventDefault()
  18725. }, !1)) : d.MainContext.deviceType == d.MainContext.DEVICE_MOBILE ? this.addTouchListener() : d.MainContext.deviceType == d.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  18726. window.addEventListener("mousedown", function (b) {
  18727. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  18728. });
  18729. window.addEventListener("mouseup", function (b) {
  18730. a._isTouchDown && a.inOutOfCanvas(b) && a.dispatchLeaveStageEvent();
  18731. a._isTouchDown = !1
  18732. })
  18733. };
  18734. c.prototype.addMouseListener = function () {
  18735. var a = this;
  18736. this.canvas.addEventListener("mousedown", function (b) {
  18737. a._onTouchBegin(b)
  18738. });
  18739. this.canvas.addEventListener("mousemove", function (b) {
  18740. a._onTouchMove(b)
  18741. });
  18742. this.canvas.addEventListener("mouseup", function (b) {
  18743. a._onTouchEnd(b)
  18744. })
  18745. };
  18746. c.prototype.addTouchListener = function () {
  18747. var a = this;
  18748. this.canvas.addEventListener("touchstart", function (b) {
  18749. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++)
  18750. a._onTouchBegin(b.changedTouches[d]);
  18751. b.stopPropagation();
  18752. b.preventDefault()
  18753. }, !1);
  18754. this.canvas.addEventListener("touchmove",
  18755. function (b) {
  18756. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++)
  18757. a._onTouchMove(b.changedTouches[d]);
  18758. b.stopPropagation();
  18759. b.preventDefault()
  18760. }, !1);
  18761. this.canvas.addEventListener("touchend", function (b) {
  18762. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++)
  18763. a._onTouchEnd(b.changedTouches[d]);
  18764. b.stopPropagation();
  18765. b.preventDefault()
  18766. }, !1);
  18767. this.canvas.addEventListener("touchcancel", function (b) {
  18768. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++)
  18769. a._onTouchEnd(b.changedTouches[d]);
  18770. b.stopPropagation();
  18771. b.preventDefault()
  18772. }, !1)
  18773. };
  18774. c.prototype.inOutOfCanvas = function (a) {
  18775. a = this.getLocation(this.canvas, a);
  18776. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  18777. };
  18778. c.prototype.dispatchLeaveStageEvent = function () {
  18779. d.MainContext.instance.stage.dispatchEventWith(d.Event.LEAVE_STAGE)
  18780. };
  18781. c.prototype._onTouchBegin = function (a) {
  18782. var b = this.getLocation(this.canvas, a),
  18783. c = -1;
  18784. a.hasOwnProperty("identifier") && (c = a.identifier);
  18785. this.onTouchBegan(b.x, b.y, c)
  18786. };
  18787. c.prototype._onTouchMove = function (a) {
  18788. var b = this.getLocation(this.canvas,
  18789. a),
  18790. c = -1;
  18791. a.hasOwnProperty("identifier") && (c = a.identifier);
  18792. this.onTouchMove(b.x, b.y, c)
  18793. };
  18794. c.prototype._onTouchEnd = function (a) {
  18795. var b = this.getLocation(this.canvas, a),
  18796. c = -1;
  18797. a.hasOwnProperty("identifier") && (c = a.identifier);
  18798. this.onTouchEnd(b.x, b.y, c)
  18799. };
  18800. c.prototype.getLocation = function (a, b) {
  18801. var c = document.documentElement,
  18802. e = window,
  18803. f,
  18804. h;
  18805. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), f = h.left, h = h.top) : h = f = 0;
  18806. f += e.pageXOffset - c.clientLeft;
  18807. h += e.pageYOffset - c.clientTop;
  18808. null != b.pageX ? (c = b.pageX,
  18809. e = b.pageY) : (f -= document.body.scrollLeft, h -= document.body.scrollTop, c = b.clientX, e = b.clientY);
  18810. var g = d.Point.identity;
  18811. g.x = (c - f) / d.StageDelegate.getInstance().getScaleX();
  18812. g.y = (e - h) / d.StageDelegate.getInstance().getScaleY();
  18813. return g
  18814. };
  18815. return c
  18816. }
  18817. (d.TouchContext);
  18818. d.HTML5TouchContext = e;
  18819. e.prototype.__class__ = "egret.HTML5TouchContext"
  18820. })(egret || (egret = {}));
  18821. var __extends = this.__extends || function (d, e) {
  18822. function f() {
  18823. this.constructor = d
  18824. }
  18825. for (var c in e)
  18826. e.hasOwnProperty(c) && (d[c] = e[c]);
  18827. f.prototype = e.prototype;
  18828. d.prototype = new f
  18829. }, jump;
  18830. (function (d) {
  18831. var e = function (d) {
  18832. function c() {
  18833. d.call(this);
  18834. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18835. }
  18836. __extends(c, d);
  18837. c.prototype.onAddToStage = function (a) {
  18838. this.urlloader = new egret.URLLoader;
  18839. a = new egret.URLRequest;
  18840. this.urlloader.dataFormat = egret.URLLoaderDataFormat.VARIABLES;
  18841. a.url = "http://httpbin.org/user-agent";
  18842. this.urlloader.load(a);
  18843. this.urlloader.addEventListener(egret.Event.COMPLETE, this.onComplete, this)
  18844. };
  18845. c.prototype.onComplete = function (a) {
  18846. console.log(this.urlloader.data.toString())
  18847. };
  18848. return c
  18849. }
  18850. (egret.DisplayObjectContainer);
  18851. d.NetDemo = e;
  18852. e.prototype.__class__ = "jump.NetDemo"
  18853. })(jump || (jump = {}));
  18854. var __extends = this.__extends || function (d, e) {
  18855. function f() {
  18856. this.constructor = d
  18857. }
  18858. for (var c in e)
  18859. e.hasOwnProperty(c) && (d[c] = e[c]);
  18860. f.prototype = e.prototype;
  18861. d.prototype = new f
  18862. }, LoadingUI = function (d) {
  18863. function e() {
  18864. d.call(this);
  18865. this.hint = "\u840c\u840c\u8df3\u8df3\u5154\u52a0\u8f7d\u4e2d...\n \u5f00\u59cb\u754c\u9762\u8bf7\u5728\u624b\u6307\u63d0\u793a\u5904\u5212\u7ef3\u5b50\n \u7ef3\u5b50\u8d8a\u77ed\u5154\u5b50\u8df3\u5f97\u8d8a\u9ad8\n \n \u969c\u788d\u7269\u6709\u6811\u679d\u548c\u5929\u5175,\u4f60\u5c0f\u5fc3\u55bd\n \u9ad8\u5ea6\u8d8a\u9ad8\u98ce\u666f\u8d8a\u597d,\u597d\u4e1c\u897f\u90fd\u5728\u540e\u9762\n \u7cbe\u5f69\u5373\u5c06\u5f00\u59cb...\n".split(" ");
  18866. this.hint_index =
  18867. 0;
  18868. this.createView()
  18869. }
  18870. __extends(e, d);
  18871. e.prototype.createView = function () {
  18872. this.textField = new egret.TextField;
  18873. this.addChild(this.textField);
  18874. this.textField.y = 300;
  18875. this.textField.width = 480;
  18876. this.textField.height = 100;
  18877. this.textField.textAlign = "center"
  18878. };
  18879. e.prototype.setProgress = function (d, c) {
  18880. d == c - 1 ? this.hint_index = this.hint.length - 1 : (this.hint_index = d - 1, this.hint_index %= this.hint.length);
  18881. this.textField.text = this.hint[this.hint_index] + "\u52a0\u8f7d\u4e2d..." + d + "/" + c
  18882. };
  18883. return e
  18884. }
  18885. (egret.Sprite);
  18886. LoadingUI.prototype.__class__ = "LoadingUI";
  18887. __extends = this.__extends || function (d, e) {
  18888. function f() {
  18889. this.constructor = d
  18890. }
  18891. for (var c in e)
  18892. e.hasOwnProperty(c) && (d[c] = e[c]);
  18893. f.prototype = e.prototype;
  18894. d.prototype = new f
  18895. };
  18896. (function (d) {
  18897. var e = function (e) {
  18898. function c() {
  18899. e.call(this);
  18900. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18901. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.remove_face, this)
  18902. }
  18903. __extends(c, e);
  18904. c.prototype.onAddToStage = function () {
  18905. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18906. this.init_title();
  18907. this.init_ranking();
  18908. this.init_hint();
  18909. this.init_sign();
  18910. this.init_hand()
  18911. };
  18912. c.prototype.init_title = function () {
  18913. this.title = new egret.Bitmap(GameApp.other_sheet.getTexture("title"));
  18914. this.title.anchorX = 0.5;
  18915. this.title.x = this.stage.stageWidth / 2;
  18916. this.title.y = this.stage.stageHeight / 5;
  18917. this.addChild(this.title)
  18918. };
  18919. c.prototype.init_ranking = function () {
  18920. this.ranking = new egret.Bitmap(GameApp.other_sheet.getTexture("ranking"));
  18921. this.ranking.anchorX = 0.5;
  18922. this.ranking.anchorY = 0.5;
  18923. this.ranking.x = this.stage.stageWidth / 2;
  18924. this.ranking.y = 27 * this.stage.stageHeight / 60;
  18925. this.addChild(this.ranking);
  18926. this.ranking.touchEnabled = !0;
  18927. this.ranking.addEventListener(egret.TouchEvent.TOUCH_TAP, this.open_rangking, this)
  18928. };
  18929. c.prototype.open_rangking = function () {
  18930. dp_Ranking();
  18931. };
  18932. c.prototype.back_face = function () {
  18933. this.removeChildren();
  18934. this.init_title();
  18935. this.init_ranking();
  18936. this.init_hint();
  18937. this.init_sign();
  18938. this.init_hand()
  18939. };
  18940. c.prototype.init_hint = function () {
  18941. this.hint = new egret.Bitmap(GameApp.other_sheet.getTexture("hint"));
  18942. this.hint.anchorX = 0.5;
  18943. this.hint.x = this.stage.stageWidth / 2;
  18944. this.hint.y = 8 * this.stage.stageHeight / 15;
  18945. this.addChild(this.hint)
  18946. };
  18947. c.prototype.init_sign = function () {
  18948. this.sign = new egret.Bitmap(GameApp.other_sheet.getTexture("sign"));
  18949. this.sign.anchorX = 0.5;
  18950. this.sign.x = this.stage.stageWidth / 2;
  18951. this.sign.y = 13 * this.stage.stageHeight / 15;
  18952. this.sign.touchEnabled = !0;
  18953. this.addChild(this.sign);
  18954. this.sign.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rm_face, this)
  18955. };
  18956. c.prototype.rm_face = function () {
  18957. this.sign.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,
  18958. this.rm_face, this);
  18959. this.dispatchEventWith("rmface")
  18960. };
  18961. c.prototype.init_hand = function () {
  18962. this.hand = new egret.Bitmap(GameApp.other_sheet.getTexture("hand"));
  18963. this.hand.x = this.stage.stageWidth / 2 - 7 * this.sign.width / 16;
  18964. this.hand.y = 13 * this.stage.stageHeight / 15 + this.sign.height / 2;
  18965. this.addChild(this.hand);
  18966. this.hand.touchEnabled = !0;
  18967. this.hand.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rm_face, this);
  18968. this.start_move()
  18969. };
  18970. c.prototype.getspeedOffset = function () {
  18971. var a = egret.getTimer(),
  18972. b = 1E3 / (a - this._lastTime);
  18973. this._lastTime = a;
  18974. this.speedOffset = 60 / b
  18975. };
  18976. c.prototype.start_move = function () {
  18977. this.hand.addEventListener(egret.Event.ENTER_FRAME, this.hand_move, this)
  18978. };
  18979. c.prototype.stop_move = function () {
  18980. this.hand.removeEventListener(egret.Event.ENTER_FRAME, this.hand_move, this);
  18981. this.hand.removeEventListener(egret.Event.ENTER_FRAME, this.hand_move_2, this)
  18982. };
  18983. c.prototype.hand_move = function () {
  18984. this.hand.x >= this.stage.stageWidth / 2 + 3 * this.sign.width / 8 ? (this.hand.removeEventListener(egret.Event.ENTER_FRAME, this.hand_move, this), this.hand.addEventListener(egret.Event.ENTER_FRAME,
  18985. this.hand_move_2, this)) : this.hand.x += 8
  18986. };
  18987. c.prototype.hand_move_2 = function () {
  18988. this.hand.x <= this.stage.stageWidth / 2 - 7 * this.sign.width / 16 ? (this.hand.removeEventListener(egret.Event.ENTER_FRAME, this.hand_move_2, this), this.hand.addEventListener(egret.Event.ENTER_FRAME, this.hand_move, this)) : this.hand.x -= 8
  18989. };
  18990. c.prototype.remove_face = function () {
  18991. this.stop_move();
  18992. this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.remove_face, this);
  18993. this.ranking.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.open_rangking,
  18994. this);
  18995. this.hand.removeEventListener(egret.Event.ENTER_FRAME, this.hand_move, this);
  18996. this.sign.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rm_face, this)
  18997. };
  18998. return c
  18999. }
  19000. (egret.DisplayObjectContainer);
  19001. d.StartFace = e;
  19002. e.prototype.__class__ = "jump.StartFace"
  19003. })(jump || (jump = {}));
  19004. __extends = this.__extends || function (d, e) {
  19005. function f() {
  19006. this.constructor = d
  19007. }
  19008. for (var c in e)
  19009. e.hasOwnProperty(c) && (d[c] = e[c]);
  19010. f.prototype = e.prototype;
  19011. d.prototype = new f
  19012. };
  19013. (function (d) {
  19014. var e = function (d) {
  19015. function c() {
  19016. d.call(this);
  19017. this.have_tree = !1;
  19018. this.winwidth = egret.MainContext.instance.stage.stageWidth;
  19019. this.winheight = egret.MainContext.instance.stage.stageHeight;
  19020. this.is_out = !1;
  19021. this.init_trees()
  19022. }
  19023. __extends(c, d);
  19024. c.prototype.init_trees = function () {
  19025. this.trees_texture = [];
  19026. this.trees_texture[0] = GameApp.cloud_tree_line_sheet.getTexture("tree0");
  19027. this.trees_texture[1] = GameApp.cloud_tree_line_sheet.getTexture("tree-0");
  19028. this.trees_texture[2] = GameApp.cloud_tree_line_sheet.getTexture("tree1");
  19029. this.trees_texture[3] = GameApp.cloud_tree_line_sheet.getTexture("tree-1");
  19030. this.trees = [];
  19031. for (var a = 0; 6 > a; a++) {
  19032. var b = Math.max(Math.ceil(4 * Math.random()) - 1, 0),
  19033. c = new egret.Bitmap(this.trees_texture[b]);
  19034. c.x = 0 == b || 2 == b ? -10 : this.winwidth - c.width + 15;
  19035. c.y = 0 - c.height;
  19036. this.addChild(c);
  19037. this.trees.push(c)
  19038. }
  19039. };
  19040. c.prototype.out_screen = function () {
  19041. this.is_out = this.trees[0].y > this.winheight ? !0 : !1
  19042. };
  19043. return c
  19044. }
  19045. (egret.DisplayObjectContainer);
  19046. d.Tree = e;
  19047. e.prototype.__class__ = "jump.Tree"
  19048. })(jump || (jump = {}));
  19049. var __extends = this.__extends || function (d, e) {
  19050. function f() {
  19051. this.constructor = d
  19052. }
  19053. for (var c in e)
  19054. e.hasOwnProperty(c) && (d[c] = e[c]);
  19055. f.prototype = e.prototype;
  19056. d.prototype = new f
  19057. }, GameApp = function (d) {
  19058. function e() {
  19059. d.call(this);
  19060. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  19061. }
  19062. __extends(e, d);
  19063. e.prototype.onAddToStage = function (d) {
  19064. this.loadingView = new LoadingUI;
  19065. this.stage.addChild(this.loadingView);
  19066. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  19067. RES.loadConfig("resource/resource.json",
  19068. "resource/")
  19069. };
  19070. e.prototype.onConfigComplete = function (d) {
  19071. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  19072. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  19073. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  19074. RES.loadGroup("preload")
  19075. };
  19076. e.prototype.onResourceLoadComplete = function (d) {
  19077. "preload" == d.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE,
  19078. this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), e.bigmap_sheet = RES.getRes("bigmap_json"), e.cloud_tree_line_sheet = RES.getRes("cloud_tree_line_json"), e.enemy_sprint_json = RES.getRes("enemy_sprint_json"), e.other_sheet = RES.getRes("other_json"), e.dead_json_sheet = RES.getRes("dead_json"), e.drop_json_sheet = RES.getRes("drop_json"), e.original_json_sheet = RES.getRes("original_json"), e.roll_json_sheet = RES.getRes("roll_json"), e.vjump_json_sheet =
  19079. RES.getRes("vjump_json"), e.skew_json_sheet = RES.getRes("skew_json"), e.sprint_json_sheet = RES.getRes("sprint_json"), d = new jump.GameContainer, this.addChild(d), egret.Profiler.getInstance().run())
  19080. };
  19081. e.prototype.web_net = function () {
  19082. this.test_net = new jump.NetDemo;
  19083. this.addChild(this.test_net)
  19084. };
  19085. e.prototype.onResourceProgress = function (d) {
  19086. "preload" == d.groupName && this.loadingView.setProgress(d.itemsLoaded, d.itemsTotal)
  19087. };
  19088. return e
  19089. }
  19090. (egret.DisplayObjectContainer);
  19091. GameApp.prototype.__class__ = "GameApp";
  19092. __extends = this.__extends || function (d, e) {
  19093. function f() {
  19094. this.constructor = d
  19095. }
  19096. for (var c in e)
  19097. e.hasOwnProperty(c) && (d[c] = e[c]);
  19098. f.prototype = e.prototype;
  19099. d.prototype = new f
  19100. };
  19101. (function (d) {
  19102. var e = function (d) {
  19103. function c(a) {
  19104. d.call(this);
  19105. this.is_out = !1;
  19106. this.cloud_speed = 0;
  19107. this.texture = a;
  19108. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.set_xy, this)
  19109. }
  19110. __extends(c, d);
  19111. c.prototype.set_xy = function () {
  19112. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.set_xy, this);
  19113. this.anchorX = 0.5;
  19114. this.x = Math.ceil(Math.random() * this.stage.stageWidth)
  19115. };
  19116. c.prototype.out_screen = function () {
  19117. this.y > egret.MainContext.instance.stage.stageHeight && (this.is_out = !0)
  19118. };
  19119. c.prototype.set_speed = function (a) {
  19120. this.cloud_speed =
  19121. a
  19122. };
  19123. c.prototype.cloud_run = function () {
  19124. this.y = this.y + this.cloud_speed + 0.5;
  19125. this.cloud_speed = 0;
  19126. this.out_screen()
  19127. };
  19128. return c
  19129. }
  19130. (egret.Bitmap);
  19131. d.Cloud = e;
  19132. e.prototype.__class__ = "jump.Cloud"
  19133. })(jump || (jump = {}));
  19134. __extends = this.__extends || function (d, e) {
  19135. function f() {
  19136. this.constructor = d
  19137. }
  19138. for (var c in e)
  19139. e.hasOwnProperty(c) && (d[c] = e[c]);
  19140. f.prototype = e.prototype;
  19141. d.prototype = new f
  19142. };
  19143. (function (d) {
  19144. var e = function (e) {
  19145. function c() {
  19146. e.call(this);
  19147. this.is_hitwall = !1;
  19148. this.sprint_index = this.left_right = 0;
  19149. this.hight_best = egret.MainContext.instance.stage.stageHeight / 8 * 3;
  19150. this.stage_hight = egret.MainContext.instance.stage.stageHeight;
  19151. this.i = 1;
  19152. this.hit_wall_index = 0;
  19153. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  19154. }
  19155. __extends(c, e);
  19156. c.prototype.onAddToStage = function (a) {
  19157. this.leader_state = 1;
  19158. this.bmp = new egret.Bitmap(GameApp.original_json_sheet.getTexture("original6"));
  19159. this.stageW =
  19160. egret.MainContext.instance.stage.stageWidth;
  19161. this.stageH = egret.MainContext.instance.stage.stageHeight;
  19162. this.bmp.anchorX = 0.5;
  19163. this.bmp.anchorY = 0.5;
  19164. this.bmp.scaleX = 2 / 3;
  19165. this.bmp.scaleY = 2 / 3;
  19166. this.bmp.x = this.stageW / 2;
  19167. this.bmp.y = this.stageH - this.bmp.height / 2 / 2 - 300 - 10;
  19168. this.v = this.stage_hight / 800 * 5;
  19169. this.reduce_v = 0.4 * this.stage_hight / 800;
  19170. this.ang = 90;
  19171. this.up_down = 1;
  19172. this.index = 0;
  19173. this.addChild(this.bmp);
  19174. this.addEventListener(egret.Event.ENTER_FRAME, this.init_run, this);
  19175. this.init_wave()
  19176. };
  19177. c.prototype.init_wave = function () {
  19178. this.sprint_bmp =
  19179. new egret.Bitmap;
  19180. this.addChild(this.sprint_bmp);
  19181. this.sprint_bmp.anchorX = 0.5;
  19182. this.sprint_bmp.anchorY = 0.5;
  19183. this.sprint_bmp.scaleX = 2 / 3;
  19184. this.sprint_bmp.scaleY = 2 / 3;
  19185. this.sprint_bmp.visible = !1
  19186. };
  19187. c.prototype.sprint_wave = function () {
  19188. this.sprint_index %= 24;
  19189. switch (this.sprint_index) {
  19190. case 0:
  19191. this.sprint_bmp.texture = GameApp.enemy_sprint_json.getTexture("shockwave1");
  19192. break;
  19193. case 6:
  19194. this.sprint_bmp.texture = GameApp.enemy_sprint_json.getTexture("shockwave2");
  19195. break;
  19196. case 12:
  19197. this.sprint_bmp.texture = GameApp.enemy_sprint_json.getTexture("shockwave3");
  19198. break;
  19199. case 18:
  19200. this.sprint_bmp.texture = GameApp.enemy_sprint_json.getTexture("shockwave4")
  19201. }
  19202. this.sprint_bmp.x = this.bmp.x;
  19203. this.sprint_bmp.y = this.bmp.y;
  19204. this.sprint_bmp.visible = !0;
  19205. this.sprint_index++
  19206. };
  19207. c.prototype.play_wave = function () {
  19208. this.addEventListener(egret.Event.ENTER_FRAME, this.sprint_wave, this)
  19209. };
  19210. c.prototype.stop_wave = function () {
  19211. this.removeEventListener(egret.Event.ENTER_FRAME, this.sprint_wave, this);
  19212. this.sprint_bmp.visible = !1
  19213. };
  19214. c.prototype.getspeedOffset = function () {
  19215. var a = egret.getTimer(),
  19216. b = 1E3 / (a -
  19217. this._lastTime);
  19218. this._lastTime = a;
  19219. this.speedOffset = 60 / b
  19220. };
  19221. c.prototype.init_run = function (a) {
  19222. if (1 == this.leader_state)
  19223. this.bmp.y <= this.stage_hight - this.bmp.height / 2 / 2 - this.hight_best - 10 && 2 != this.up_down && (this.up_down = 2, this.v = 5 * this.stage_hight / 800, this.reduce_v = 0.4 * this.stage_hight / 800, this.ang = 90, this.bmp.texture = GameApp.original_json_sheet.getTexture("original6")), this.bmp.y >= this.stage_hight - this.bmp.height / 2 / 2 - 10 && 1 != this.up_down && (this.up_down = 1, this.v = 18 * this.stage_hight / 800, this.reduce_v = -0.4 *
  19224. this.stage_hight / 800, this.ang = -90, this.bmp.texture = GameApp.original_json_sheet.getTexture("original10")), 1 == this.up_down ? this.bmp.y <= this.stageH - this.bmp.height / 2 / 2 - 9 * this.hight_best / 10 ? this.bmp.texture = GameApp.original_json_sheet.getTexture("original5") : this.bmp.y <= this.stageH - this.bmp.height / 2 / 2 - 8 * this.hight_best / 10 ? this.bmp.texture = GameApp.original_json_sheet.getTexture("original4") : this.bmp.y <= this.stageH - this.bmp.height / 2 / 2 && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original1-3")) :
  19225. 2 == this.up_down && this.bmp.y >= this.stageH - this.bmp.height / 2 / 2 - this.hight_best - 3 && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original7-9")), this.v += this.reduce_v, this.bmp.y += this.v * Math.sin(this.ang / 180 * Math.PI);
  19226. else if (2 == this.leader_state) {
  19227. 0 == this.up_down && (this.up_down = 1);
  19228. if (1 == this.up_down)
  19229. if (this.is_hitwall)
  19230. this.roll(), 19 == this.hit_wall_index && (this.is_hitwall = !1), this.stop_wave(), d.GameContainer.is_sprint = !1;
  19231. else if (this.v > 2 * d.GameContainer.wave_v / 3 && !0 == d.GameContainer.is_sprint ?
  19232. this.play_wave() : this.v < d.GameContainer.wave_v / 3 && this.stop_wave(), 1 == this.left_right) {
  19233. if (this.v < d.GameContainer.ov - 3 * d.GameContainer.speed_reduce) {
  19234. if (2 == d.GameContainer.rise_state)
  19235. switch (a = 1, this.index %= 8 * a, this.index) {
  19236. case 0 * a:
  19237. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint1");
  19238. break;
  19239. case 1 * a:
  19240. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint2");
  19241. break;
  19242. case 2 * a:
  19243. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint3");
  19244. break;
  19245. case 3 * a:
  19246. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint4");
  19247. break;
  19248. case 4 * a:
  19249. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint5");
  19250. break;
  19251. case 5 * a:
  19252. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint6");
  19253. break;
  19254. case 6 * a:
  19255. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint7");
  19256. break;
  19257. case 7 * a:
  19258. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint8")
  19259. }
  19260. else if (this.i = Math.max(Math.ceil((d.GameContainer.ov - this.v) / 8), 2), this.index %= 4 * this.i, 1 == d.GameContainer.rise_state)
  19261. switch (this.index) {
  19262. case 0 * this.i:
  19263. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump-1");
  19264. break;
  19265. case 1 * this.i:
  19266. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump-2");
  19267. break;
  19268. case 2 * this.i:
  19269. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump-3");
  19270. break;
  19271. case 3 * this.i:
  19272. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump-4")
  19273. }
  19274. else
  19275. switch (this.index) {
  19276. case 0 * this.i:
  19277. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump-1");
  19278. break;
  19279. case 1 * this.i:
  19280. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump-2");
  19281. break;
  19282. case 2 * this.i:
  19283. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump-3");
  19284. break;
  19285. case 3 * this.i:
  19286. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump-4")
  19287. }
  19288. this.index++
  19289. }
  19290. this.v < 29 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original-1-3"));
  19291. this.v < 21 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original-4"));
  19292. this.v < 13 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original-5"));
  19293. this.v < 5 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original-6"))
  19294. } else {
  19295. if (this.v <
  19296. d.GameContainer.ov - 3 * d.GameContainer.speed_reduce) {
  19297. if (2 == d.GameContainer.rise_state)
  19298. switch (a = 1, this.index %= 8 * a, this.index) {
  19299. case 0 * a:
  19300. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint1");
  19301. break;
  19302. case 1 * a:
  19303. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint2");
  19304. break;
  19305. case 2 * a:
  19306. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint3");
  19307. break;
  19308. case 3 * a:
  19309. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint4");
  19310. break;
  19311. case 4 * a:
  19312. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint5");
  19313. break;
  19314. case 5 * a:
  19315. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint6");
  19316. break;
  19317. case 6 * a:
  19318. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint7");
  19319. break;
  19320. case 7 * a:
  19321. this.bmp.texture = GameApp.sprint_json_sheet.getTexture("sprint8")
  19322. }
  19323. else if (this.i = Math.max(Math.ceil((d.GameContainer.ov - this.v) / 8), 2), this.index %= 4 * this.i, -1 == d.GameContainer.rise_state)
  19324. switch (this.index) {
  19325. case 0 * this.i:
  19326. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump1");
  19327. break;
  19328. case 1 * this.i:
  19329. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump2");
  19330. break;
  19331. case 2 * this.i:
  19332. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump3");
  19333. break;
  19334. case 3 * this.i:
  19335. this.bmp.texture = GameApp.vjump_json_sheet.getTexture("vjump4")
  19336. }
  19337. else
  19338. switch (this.index) {
  19339. case 0 * this.i:
  19340. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump1");
  19341. break;
  19342. case 1 * this.i:
  19343. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump2");
  19344. break;
  19345. case 2 * this.i:
  19346. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump3");
  19347. break;
  19348. case 3 * this.i:
  19349. this.bmp.texture = GameApp.skew_json_sheet.getTexture("skewjump4")
  19350. }
  19351. this.index++
  19352. }
  19353. this.v <
  19354. 29 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original1-3"));
  19355. this.v < 21 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original4"));
  19356. this.v < 13 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original5"));
  19357. this.v < 5 * d.GameContainer.speed_reduce && (this.bmp.texture = GameApp.original_json_sheet.getTexture("original6"))
  19358. }
  19359. if (2 == this.up_down && (this.v += 0.5, 0 < this.v)) {
  19360. this.i = Math.max(Math.ceil((d.GameContainer.ov -
  19361. this.v) / 8), 15);
  19362. this.index %= 4 * this.i;
  19363. if (1 == this.left_right)
  19364. switch (this.index) {
  19365. case 0 * this.i:
  19366. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop-1");
  19367. break;
  19368. case 1 * this.i:
  19369. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop-2");
  19370. break;
  19371. case 2 * this.i:
  19372. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop-3");
  19373. break;
  19374. case 3 * this.i:
  19375. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop-2")
  19376. }
  19377. else
  19378. switch (this.index) {
  19379. case 0 * this.i:
  19380. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop1");
  19381. break;
  19382. case 1 * this.i:
  19383. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop2");
  19384. break;
  19385. case 2 * this.i:
  19386. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop3");
  19387. break;
  19388. case 3 * this.i:
  19389. this.bmp.texture = GameApp.drop_json_sheet.getTexture("drop2")
  19390. }
  19391. this.index++
  19392. }
  19393. this.bmp.x > this.stageW - this.bmp.width / 4 && 2 != this.left_right && (d.GameContainer.rise_state = 0 - d.GameContainer.rise_state, this.is_hitwall = !0, this.left_right = 2, this.ang = 180 - this.ang);
  19394. this.bmp.x < this.bmp.width / 4 && 1 != this.left_right && (d.GameContainer.rise_state =
  19395. 0 - d.GameContainer.rise_state, this.is_hitwall = !0, this.left_right = 1, this.ang = 180 - this.ang);
  19396. this.bmp.x += this.v * Math.cos(this.ang / 180 * Math.PI);
  19397. this.bg_is_run || (this.bmp.y += this.v * Math.sin(this.ang / 180 * Math.PI))
  19398. } else {
  19399. this.stop_wave();
  19400. d.GameContainer.is_sprint = !1;
  19401. this.index %= 20;
  19402. if (1 == this.left_right)
  19403. switch (this.index) {
  19404. case 0:
  19405. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead1");
  19406. break;
  19407. case 5:
  19408. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead2");
  19409. break;
  19410. case 10:
  19411. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead3");
  19412. break;
  19413. case 15:
  19414. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead4")
  19415. }
  19416. else
  19417. switch (this.index) {
  19418. case 0:
  19419. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead-1");
  19420. break;
  19421. case 5:
  19422. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead-2");
  19423. break;
  19424. case 10:
  19425. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead-3");
  19426. break;
  19427. case 15:
  19428. this.bmp.texture = GameApp.dead_json_sheet.getTexture("dead-4")
  19429. }
  19430. this.bmp.y += 10;
  19431. this.index++
  19432. }
  19433. this.bmp.y > this.stageH + this.bmp.height && (this.removeEventListener(egret.Event.ENTER_FRAME,
  19434. this.init_run, this), this.stop_wave(), this.dispatchEventWith("GAMEOVER"))
  19435. };
  19436. c.prototype.roll = function () {
  19437. this.hit_wall_index %= 19;
  19438. if (1 == this.left_right)
  19439. switch (this.hit_wall_index) {
  19440. case 0:
  19441. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll1");
  19442. break;
  19443. case 5:
  19444. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll2");
  19445. break;
  19446. case 10:
  19447. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll3");
  19448. break;
  19449. case 15:
  19450. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll4")
  19451. }
  19452. else
  19453. switch (this.hit_wall_index) {
  19454. case 0:
  19455. this.bmp.texture =
  19456. GameApp.roll_json_sheet.getTexture("roll-1");
  19457. break;
  19458. case 5:
  19459. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll-2");
  19460. break;
  19461. case 10:
  19462. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll-3");
  19463. break;
  19464. case 15:
  19465. this.bmp.texture = GameApp.roll_json_sheet.getTexture("roll-4")
  19466. }
  19467. this.hit_wall_index++
  19468. };
  19469. return c
  19470. }
  19471. (egret.DisplayObjectContainer);
  19472. d.Leader = e;
  19473. e.prototype.__class__ = "jump.Leader"
  19474. })(jump || (jump = {}));
  19475. __extends = this.__extends || function (d, e) {
  19476. function f() {
  19477. this.constructor = d
  19478. }
  19479. for (var c in e)
  19480. e.hasOwnProperty(c) && (d[c] = e[c]);
  19481. f.prototype = e.prototype;
  19482. d.prototype = new f
  19483. };
  19484. (function (d) {
  19485. var e = function (e) {
  19486. function c() {
  19487. e.call(this);
  19488. this.winwidth = egret.MainContext.instance.stage.stageWidth;
  19489. this.winheight = egret.MainContext.instance.stage.stageHeight;
  19490. this.line_sound = !1;
  19491. this.temp_r = 0;
  19492. this.a_run = 1;
  19493. this.timer = new egret.Timer(200, 1);
  19494. this.timer1 = new egret.Timer(10, 1);
  19495. this.tree_index = this.enemy_num = 0;
  19496. this.launcher_h = 2 * this.winheight / 5;
  19497. this.launcher_v = 2 * this.winheight / 25;
  19498. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  19499. }
  19500. __extends(c, e);
  19501. c.prototype.onAddToStage =
  19502. function () {
  19503. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  19504. this.createGameScene()
  19505. };
  19506. c.prototype.createGameScene = function () {
  19507. this.bg = new d.BgMap;
  19508. this.addChild(this.bg);
  19509. this.enemy = [];
  19510. this.addEventListener(egret.Event.ENTER_FRAME, this.remove_enemy, this);
  19511. this.tree = new d.Tree;
  19512. this.addChild(this.tree);
  19513. this.leader = new d.Leader;
  19514. this.addChild(this.leader);
  19515. d.GameContainer.get_wave_v();
  19516. this.init_start_face();
  19517. this.init_line();
  19518. this.score = new d.Score;
  19519. /*WeixinApi.ready(function (a) {
  19520. var b =
  19521. new WeixinShareInfo;
  19522. b.title = "\u5ae6\u5a25\u4e3a\u4ec0\u4e48\u4e0d\u559c\u6b22\u732a\u516b\u6212,\u539f\u6765\u662f\u56e0\u4e3aTA";
  19523. b.desc = "\u8f7b\u677e\u8df3\u5230" + d.GameContainer.best_score + "\u7c73";
  19524. b.link = "http://42.121.113.35/test/test/index.html";
  19525. a.shareToFriend(b);
  19526. a.shareToTimeline(b)
  19527. })*/
  19528. };
  19529. c.prototype.init_line = function () {
  19530. this.line = new egret.Bitmap;
  19531. this.line.anchorY = 0.5;
  19532. this.line.visible = !1;
  19533. this.addChild(this.line);
  19534. this.rp = new egret.Bitmap(GameApp.cloud_tree_line_sheet.getTexture("p"));
  19535. this.lp =
  19536. new egret.Bitmap(GameApp.cloud_tree_line_sheet.getTexture("p"));
  19537. this.rp.anchorX = 0.5;
  19538. this.rp.anchorY = 0.5;
  19539. this.rp.scaleX = 0.5;
  19540. this.rp.scaleY = 0.5;
  19541. this.lp.anchorX = 0.5;
  19542. this.lp.anchorY = 0.5;
  19543. this.lp.scaleX = 0.5;
  19544. this.lp.scaleY = 0.5;
  19545. this.rp.visible = !1;
  19546. this.lp.visible = !1;
  19547. this.addChild(this.rp);
  19548. this.addChild(this.lp)
  19549. };
  19550. c.prototype.draw_line = function (a) {
  19551. a.type == egret.TouchEvent.TOUCH_BEGIN && (this.removeEventListener(egret.Event.ENTER_FRAME, this.lx_hitTest, this), this.line.texture = GameApp.cloud_tree_line_sheet.getTexture("line1"),
  19552. this.line.x = a.stageX, this.line.y = a.stageY, this.lp.x = a.stageX, this.lp.y = a.stageY, this.lp.visible = !0, this.rp.visible = !1, this.line.scaleX = 0, this.line.visible = !0, this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.draw_line, this));
  19553. a.type == egret.TouchEvent.TOUCH_MOVE && (this.temp_r = Math.sqrt((a.stageX - this.line.x) * (a.stageX - this.line.x) + (a.stageY - this.line.y) * (a.stageY - this.line.y)), this.line.rotation = 180 / Math.PI * Math.atan2(a.stageY - this.line.y, a.stageX - this.line.x), this.temp_r < this.winwidth / 2 ? (this.rp.x =
  19554. a.stageX, this.rp.y = a.stageY) : (this.temp_r = this.winwidth / 2, this.rp.x = this.line.x + this.temp_r * Math.cos(this.line.rotation / 180 * Math.PI), this.rp.y = this.line.y + this.temp_r * Math.sin(this.line.rotation / 180 * Math.PI)), this.line.scaleX = this.temp_r / this.line.width, this.rp.visible = !0);
  19555. a.type == egret.TouchEvent.TOUCH_END && (this.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.draw_line, this), 0 < this.temp_r && (a = 1 / Math.ceil(20 * this.temp_r / egret.MainContext.instance.stage.stageHeight) * egret.MainContext.instance.stage.stageHeight *
  19556. 3.5, d.GameContainer.ov = this.f_run(a), a > 0.75 * egret.MainContext.instance.stage.stageHeight && (d.GameContainer.is_sprint = !0), d.GameContainer.speed_reduce = this.a_run, this.addEventListener(egret.Event.ENTER_FRAME, this.lx_hitTest, this)))
  19557. };
  19558. c.get_wave_v = function () {
  19559. var a = Math.sqrt(2 * (1 / Math.ceil(20 / egret.MainContext.instance.stage.stageHeight)) * egret.MainContext.instance.stage.stageHeight * 3.5);
  19560. d.GameContainer.wave_v = a
  19561. };
  19562. c.prototype.f_run = function (a) {
  19563. return Math.sqrt(2 * this.a_run * a)
  19564. };
  19565. c.prototype.f_v = function (a) {
  19566. return a -
  19567. this.a_run
  19568. };
  19569. c.prototype.lx_hitTest = function (a) {
  19570. 3 != this.leader.leader_state && 2 == this.leader.up_down && this.line.hitTestPoint(this.leader.bmp.x, this.leader.bmp.y + 9 * this.leader.bmp.height / 60) && (this.removeEventListener(egret.Event.ENTER_FRAME, this.lx_hitTest, this), this.leader.removeEventListener(egret.Event.ENTER_FRAME, this.leader.init_run, this.leader), this.leader.up_down = 0, this.lp.x > this.rp.x && (this.line.x = this.rp.x, this.line.y = this.rp.y, this.line.rotation = 180 / Math.PI * Math.atan2(this.lp.y - this.rp.y,
  19571. this.lp.x - this.rp.x)), this.line.texture = GameApp.cloud_tree_line_sheet.getTexture("line2"), this.line.anchorY = 0.125, this.leader.bmp.texture = 1 == this.leader.left_right ? GameApp.drop_json_sheet.getTexture("groundmoment-") : GameApp.drop_json_sheet.getTexture("groundmoment"), this.timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.stop_moment, this), this.timer.reset(), this.timer.start(), this.leader.leader_state = 2, this.leader.left_right = 0, this.leader.v = d.GameContainer.ov, this.leader.ang = this.line.rotation -
  19572. 90, 0 < Math.cos(this.leader.ang / 180 * Math.PI) ? (this.leader.left_right = 1, -60 > this.leader.ang ? (d.GameContainer.rise_state = 1, -90 == this.leader.ang && (d.GameContainer.rise_state = 2)) : d.GameContainer.rise_state = 0) : (this.leader.left_right = 2, -120 < this.leader.ang ? (d.GameContainer.rise_state = -1, -90 == this.leader.ang && (d.GameContainer.rise_state = 2)) : d.GameContainer.rise_state = 0))
  19573. };
  19574. c.prototype.bg_run = function (a) {
  19575. if (2 == this.leader.leader_state && 1 == this.leader.up_down) {
  19576. if (this.leader.bmp.y < this.winheight / 2)
  19577. if (this.bg.speed =
  19578. 0 - this.leader.v * Math.sin(this.leader.ang / 180 * Math.PI), 0 < this.bg.speed) {
  19579. this.bg.start();
  19580. this.score.showScore(this.bg.get_score());
  19581. this.line.y += this.bg.speed;
  19582. this.lp.y += this.bg.speed;
  19583. this.rp.y += this.bg.speed;
  19584. 15 > this.bg.speed && (this.creat_tree(), this.creat_enemy());
  19585. this.tree.have_tree && 0 < this.tree.trees.length ? this.tree.trees[0].y += this.bg.speed : this.tree.have_tree = !1;
  19586. for (a = 0; a < this.enemy.length; a++) {
  19587. var b = this.enemy[a];
  19588. b.y < this.winheight / 2 + b.height / 2 ? b.y_move(this.bg.speed) : b.y_move(2.5 * this.bg.speed)
  19589. }
  19590. this.leader.bg_is_run =
  19591. !0;
  19592. this.jumpheight = (this.bg.speed + this.leader.v * Math.sin(this.leader.ang / 180 * Math.PI)) / 2
  19593. } else
  19594. this.bg.speed = 0, this.bg.pause(), this.leader.bg_is_run = !1;
  19595. 0 >= this.leader.v && (this.leader.leader_state = 2, this.leader.up_down = 2, this.leader.bmp.texture = 1 == this.leader.left_right ? GameApp.original_json_sheet.getTexture("original-7-9") : GameApp.original_json_sheet.getTexture("original7-9"), this.leader.ang = 90);
  19596. this.leader.v -= d.GameContainer.speed_reduce
  19597. }
  19598. 3 == this.leader.leader_state && this.bg.pause()
  19599. };
  19600. c.prototype.stop_moment =
  19601. function (a) {
  19602. this.timer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.stop_moment, this);
  19603. this.addChild(this.score);
  19604. this.line.texture = GameApp.cloud_tree_line_sheet.getTexture("line3");
  19605. this.line.anchorY = 0.75;
  19606. this.leader.bmp.texture = 1 == this.leader.left_right ? GameApp.vjump_json_sheet.getTexture("vjump-1") : GameApp.vjump_json_sheet.getTexture("vjump1");
  19607. this.leader.addEventListener(egret.Event.ENTER_FRAME, this.leader.init_run, this.leader);
  19608. this.addEventListener(egret.Event.ENTER_FRAME, this.bg_run,
  19609. this);
  19610. this.timer1.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.remove_line, this);
  19611. this.timer1.reset();
  19612. this.timer1.start()
  19613. };
  19614. c.prototype.remove_line = function (a) {
  19615. this.timer1.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.remove_line, this);
  19616. this.line.visible = !1;
  19617. this.rp.visible = !1;
  19618. this.lp.visible = !1
  19619. };
  19620. c.prototype.enemy_hit_leader = function () {
  19621. var a = new egret.Rectangle,
  19622. b = new egret.Rectangle;
  19623. a.x = this.leader.bmp.x - this.leader.width / 4;
  19624. a.y = this.leader.bmp.y - this.leader.height / 4;
  19625. a.width = this.leader.width /
  19626. 2;
  19627. a.height = this.leader.height / 2;
  19628. for (var c = 0; c < this.enemy.length; c++) {
  19629. var d = this.enemy[c];
  19630. b.x = d.x - 2 * d.width / 9;
  19631. b.y = d.y - 2 * d.height / 9;
  19632. b.width = 4 * d.width / 9;
  19633. b.height = 4 * d.height / 9;
  19634. this.myintersects(a.x, a.y, a.width, a.height, b.x, b.y, b.width, b.height) && (this.leader.leader_state = 3)
  19635. }
  19636. };
  19637. c.prototype.myintersects = function (a, b, c, d, e, f, g, l) {
  19638. return a + c > e && a < e + g && b + d > f && b < f + l
  19639. };
  19640. c.prototype.creat_enemy = function () {
  19641. if (0 >= this.enemy.length) {
  19642. var a = this.bg.get_score();
  19643. 120 <= a && 200 > a ? (d.Enemy.speed = 0.5, this.enemy_num = 1) : 200 <=
  19644. a && 300 > a ? (d.Enemy.speed = 0.8, this.enemy_num = Math.ceil(2 * Math.random())) : 300 <= a && 500 > a ? (d.Enemy.speed = 1.2, this.enemy_num = 1 + Math.ceil(2 * Math.random())) : 500 <= a && (d.Enemy.speed = 1.5, this.enemy_num = 1 + Math.ceil(2 * Math.random()));
  19645. for (a = 0; a < this.enemy_num; a++) {
  19646. var b = new d.Enemy;
  19647. this.enemy.push(b);
  19648. b.y = 0 - b.height / 3 - 2 * b.height / 3 * a;
  19649. this.addChildAt(b, 1)
  19650. }
  19651. }
  19652. };
  19653. c.prototype.remove_enemy = function (a) {
  19654. 0 < this.tree.trees.length && this.hit_left_tree();
  19655. if (0 < this.enemy.length)
  19656. for (this.enemy_hit_leader(), a = 0; a < this.enemy.length; a++) {
  19657. var b =
  19658. this.enemy[a];
  19659. b.y > this.winheight + b.height / 2 && (this.removeChild(b), this.enemy.shift())
  19660. }
  19661. };
  19662. c.prototype.hit_left_tree = function () {
  19663. var a = new egret.Rectangle,
  19664. b = new egret.Rectangle;
  19665. a.x = this.leader.bmp.x - this.leader.width / 4;
  19666. a.y = this.leader.bmp.y - this.leader.height / 4;
  19667. a.width = this.leader.width / 2;
  19668. a.height = this.leader.height / 2;
  19669. 0 < this.tree.trees.length && (this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree0") || this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree1") ? b.x =
  19670. this.tree.trees[0].x : b.x = this.tree.trees[0].x + this.tree.trees[0].width / 5, b.y = this.tree.trees[0].y + 2 * this.tree.trees[0].height / 5, b.width = 7 * this.tree.trees[0].width / 10 - 15, b.height = this.tree.trees[0].height / 5, this.myintersects(a.x, a.y, a.width, a.height, b.x, b.y, b.width, b.height) && (this.leader.leader_state = 3))
  19671. };
  19672. c.prototype.tree_swing = function () {
  19673. this.tree_index++;
  19674. this.tree_index %= 15;
  19675. 0 < this.tree.trees.length ? 0 == this.tree_index && (this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree0") ?
  19676. this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree0b") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree1") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree1b") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree-0") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree-0b") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree-1") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree-1b") :
  19677. this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree0b") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree0") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree1b") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree1") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree-0b") ? this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree-0") : this.tree.trees[0].texture == GameApp.cloud_tree_line_sheet.getTexture("tree-1b") &&
  19678. (this.tree.trees[0].texture = GameApp.cloud_tree_line_sheet.getTexture("tree-1"))) : this.stop_tree()
  19679. };
  19680. c.prototype.stop_tree = function () {
  19681. this.removeEventListener(egret.Event.ENTER_FRAME, this.tree_swing, this)
  19682. };
  19683. c.prototype.creat_tree = function () {
  19684. this.addEventListener(egret.Event.ENTER_FRAME, this.tree_swing, this);
  19685. this.bg.bmpArr[0].y > 0 - 2 * this.bg.bmpArr[0].height / 5 && (0 < this.tree.trees.length ? (this.tree.have_tree = !0, this.tree.trees[0].y += this.bg.speed, this.tree.out_screen(), this.tree.is_out && this.tree.trees.shift()) :
  19686. this.stop_tree())
  19687. };
  19688. c.prototype.init_start_face = function () {
  19689. this.start_face = new d.StartFace;
  19690. this.addChild(this.start_face);
  19691. this.start_face.addEventListener("rmface", this.rm_face, this)
  19692. };
  19693. c.prototype.rm_face = function () {
  19694. this.start_face.removeEventListener("rmface", this.rm_face, this);
  19695. this.removeChild(this.start_face);
  19696. this.touchEnabled = !0;
  19697. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.draw_line, this);
  19698. this.addEventListener(egret.TouchEvent.TOUCH_END, this.draw_line, this);
  19699. this.leader.addEventListener("GAMEOVER",
  19700. this.f_gameover, this)
  19701. };
  19702. c.prototype.f_gameover = function () {
  19703. this.stop_tree();
  19704. this.removeChild(this.line);
  19705. this.removeChild(this.lp);
  19706. this.removeChild(this.rp);
  19707. this.gameover = new d.GameOver;
  19708. this.gameover.overscore(d.Score.global_score);
  19709. this.addChild(this.gameover);
  19710. this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.draw_line, this);
  19711. this.removeEventListener(egret.TouchEvent.TOUCH_END, this.draw_line, this);
  19712. this.removeEventListener(egret.Event.ENTER_FRAME, this.lx_hitTest, this);
  19713. this.gameover.addEventListener("REPLAY",
  19714. this.f_replay, this)
  19715. };
  19716. c.prototype.f_replay = function () {
  19717. this.removeChildren();
  19718. this.createGameScene();
  19719. this.enemy_num = 0;
  19720. this.gameover.removeEventListener("REPLAY", this.f_replay, this)
  19721. };
  19722. c.best_score = 0;
  19723. c.rise_state = 0;
  19724. c.is_sprint = !1;
  19725. c.open_close_music = !0;
  19726. c.wave_v = 0;
  19727. return c
  19728. }
  19729. (egret.DisplayObjectContainer);
  19730. d.GameContainer = e;
  19731. e.prototype.__class__ = "jump.GameContainer"
  19732. })(jump || (jump = {}));
  19733. __extends = this.__extends || function (d, e) {
  19734. function f() {
  19735. this.constructor = d
  19736. }
  19737. for (var c in e)
  19738. e.hasOwnProperty(c) && (d[c] = e[c]);
  19739. f.prototype = e.prototype;
  19740. d.prototype = new f
  19741. };
  19742. (function (d) {
  19743. var e = function (e) {
  19744. function c() {
  19745. e.call(this);
  19746. this.center_x = egret.MainContext.instance.stage.stageWidth / 2;
  19747. this.center_y = egret.MainContext.instance.stage.stageHeight / 2;
  19748. this.temp_x = 0;
  19749. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  19750. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.remove_face, this)
  19751. }
  19752. __extends(c, e);
  19753. c.prototype.onAddToStage = function () {
  19754. this.txt_c = new egret.DisplayObjectContainer;
  19755. this.init_front();
  19756. this.init_colourless();
  19757. this.init_myrecord();
  19758. this.init_returnback();
  19759. this.init_ranking1()
  19760. };
  19761. c.prototype.init_ranking1 = function () {
  19762. this.ranking1 = new egret.Bitmap(GameApp.other_sheet.getTexture("ranking1"));
  19763. this.ranking1.anchorX = 0.5;
  19764. this.ranking1.x = this.stage.stageWidth / 2;
  19765. this.ranking1.y = this.stage.stageHeight / 20;
  19766. this.addChild(this.ranking1)
  19767. };
  19768. c.prototype.init_front = function () {
  19769. this.front10 = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("front10"));
  19770. this.front10.anchorX = 0.5;
  19771. this.front10.x = this.stage.stageWidth / 2;
  19772. this.front10.y = this.stage.stageHeight / 7;
  19773. this.addChild(this.front10);
  19774. this.showRanking(0, 8E3);
  19775. this.showRanking(1, 7555);
  19776. this.showRanking(2, 6666);
  19777. this.showRanking(3, 4555);
  19778. this.showRanking(4, 3586);
  19779. this.showRanking(5, 3145);
  19780. this.showRanking(6, 2553);
  19781. this.showRanking(7, 789);
  19782. this.showRanking(8, 600);
  19783. this.showRanking(9, 505);
  19784. this.addChild(this.txt_c)
  19785. };
  19786. c.prototype.init_colourless = function () {
  19787. this.colourless = new egret.Bitmap(GameApp.other_sheet.getTexture("colourless"));
  19788. this.colourless.anchorX = 1;
  19789. this.colourless.x = this.front10.x + this.front10.width / 2 - this.front10.width / 17;
  19790. this.colourless.y =
  19791. this.front10.y + this.front10.height / 22;
  19792. this.addChild(this.colourless);
  19793. this.colourless.touchEnabled = !0;
  19794. this.colourless.addEventListener(egret.TouchEvent.TOUCH_TAP, this.tap_colourless, this)
  19795. };
  19796. c.prototype.tap_colourless = function () {
  19797. if (this.front10.texture == GameApp.bigmap_sheet.getTexture("front10"))
  19798. this.colourless.anchorX = 0, this.colourless.x = this.front10.x - this.front10.width / 2 + this.front10.width / 17, this.front10.texture = GameApp.bigmap_sheet.getTexture("myrecord"), this.removeChild(this.txt_c), this.addChild(this.map_biaoyu),
  19799. this.overscore();
  19800. else if (this.front10.texture == GameApp.bigmap_sheet.getTexture("myrecord")) {
  19801. this.colourless.anchorX = 1;
  19802. this.colourless.x = this.front10.x + this.front10.width / 2 - this.front10.width / 17;
  19803. this.front10.texture = GameApp.bigmap_sheet.getTexture("front10");
  19804. this.addChild(this.txt_c);
  19805. this.removeChild(this.map_biaoyu);
  19806. this.removeChild(this.big_m);
  19807. for (var a = 0; a < this.temp_num.length; a++)
  19808. this.removeChild(this.temp_num[a])
  19809. }
  19810. };
  19811. c.prototype.init_myrecord = function () {
  19812. this.map_biaoyu = new egret.Bitmap(GameApp.other_sheet.getTexture("biaoyu"));
  19813. this.map_biaoyu.anchorX = 0.5;
  19814. this.map_biaoyu.anchorY = 0.5;
  19815. this.map_biaoyu.x = egret.MainContext.instance.stage.stageWidth / 2;
  19816. this.map_biaoyu.y = 2 * egret.MainContext.instance.stage.stageHeight / 5
  19817. };
  19818. c.prototype.init_returnback = function () {
  19819. this.returnback = new egret.Bitmap(GameApp.other_sheet.getTexture("return"));
  19820. this.returnback.x = this.stage.stageWidth / 20;
  19821. this.returnback.y = 17 * this.stage.stageHeight / 20;
  19822. this.addChild(this.returnback);
  19823. this.returnback.touchEnabled = !0;
  19824. this.returnback.addEventListener(egret.TouchEvent.TOUCH_TAP,
  19825. this.back_face, this)
  19826. };
  19827. c.prototype.back_face = function () {
  19828. this.returnback.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.back_face, this);
  19829. this.colourless.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.tap_colourless, this);
  19830. this.removeChildren();
  19831. this.dispatchEventWith("back_face")
  19832. };
  19833. c.prototype.set_x = function () {
  19834. this.one_w = new egret.Bitmap(GameApp.other_sheet.getTexture("big_0"));
  19835. this.big_m = new egret.Bitmap(GameApp.other_sheet.getTexture("big_m"));
  19836. this.big_m.scaleX = 0.5;
  19837. this.big_m.scaleY = 0.5;
  19838. if (0 ==
  19839. this.temp_x % 2)
  19840. for (var a = this.temp_x / 2 - 1, b = 0; b < this.temp_num.length; b++)
  19841. this.temp_num[b].x = b <= a ? this.center_x + this.one_w.width / 2 / 2 + (a - b) * this.one_w.width / 2 - this.big_m.width / 2 / 2 : this.center_x - this.one_w.width / 2 / 2 - (b - a - 1) * this.one_w.width / 2 - this.big_m.width / 2 / 2, this.addChild(this.temp_num[b]);
  19842. else
  19843. for (a = Math.ceil(this.temp_x / 2) - 1, b = 0; b < this.temp_num.length; b++)
  19844. this.temp_num[b].x = b < a ? this.center_x + (a - b) * this.one_w.width / 2 - this.big_m.width / 2 / 2 : b == a ? this.center_x - this.big_m.width / 2 / 2 : this.center_x - (b - a) *
  19845. this.one_w.width / 2 - this.big_m.width / 2 / 2, this.addChild(this.temp_num[b]);
  19846. this.big_m.anchorX = 0.5;
  19847. this.big_m.anchorY = 0.5;
  19848. this.big_m.y = this.temp_num[0].y;
  19849. this.big_m.x = this.temp_num[0].x + this.temp_num[0].width / 2 / 2 + this.big_m.width / 2 / 2;
  19850. this.addChild(this.big_m)
  19851. };
  19852. c.prototype.creat_num = function (a) {
  19853. a = new egret.Bitmap(a);
  19854. a.anchorX = 0.5;
  19855. a.anchorY = 0.5;
  19856. a.scaleX = 0.5;
  19857. a.scaleY = 0.5;
  19858. a.y = this.center_y;
  19859. this.temp_num.push(a)
  19860. };
  19861. c.prototype.overscore = function () {
  19862. var a = d.GameContainer.best_score;
  19863. this.temp_num = [];
  19864. for (var a =
  19865. a.toString(), b = this.temp_x = a.length; 0 <= b; b--)
  19866. switch (a[b]) {
  19867. case "0":
  19868. this.creat_num(GameApp.other_sheet.getTexture("big_0"));
  19869. break;
  19870. case "1":
  19871. this.creat_num(GameApp.other_sheet.getTexture("big_1"));
  19872. break;
  19873. case "2":
  19874. this.creat_num(GameApp.other_sheet.getTexture("big_2"));
  19875. break;
  19876. case "3":
  19877. this.creat_num(GameApp.other_sheet.getTexture("big_3"));
  19878. break;
  19879. case "4":
  19880. this.creat_num(GameApp.other_sheet.getTexture("big_4"));
  19881. break;
  19882. case "5":
  19883. this.creat_num(GameApp.other_sheet.getTexture("big_5"));
  19884. break;
  19885. case "6":
  19886. this.creat_num(GameApp.other_sheet.getTexture("big_6"));
  19887. break;
  19888. case "7":
  19889. this.creat_num(GameApp.other_sheet.getTexture("big_7"));
  19890. break;
  19891. case "8":
  19892. this.creat_num(GameApp.other_sheet.getTexture("big_8"));
  19893. break;
  19894. case "9":
  19895. this.creat_num(GameApp.other_sheet.getTexture("big_9"))
  19896. }
  19897. this.set_x()
  19898. };
  19899. c.prototype.showRanking = function (a, b) {
  19900. this.txt = new egret.TextField;
  19901. this.txt.width = egret.MainContext.instance.stage.stageWidth;
  19902. this.txt.textColor = 0;
  19903. this.txt.size = 32;
  19904. this.txt.x = egret.MainContext.instance.stage.stageWidth / 2 - 4 * this.front10.width / 15;
  19905. this.txt.y = this.front10.y + 3 * this.front10.height /
  19906. 16 + this.front10.height * a / 13;
  19907. this.txt_c.addChild(this.txt);
  19908. this.txt.text = "\u7b2c" + (a + 1) + "\u540d:" + b + "\u5206"
  19909. };
  19910. c.prototype.main_ranking = function () {};
  19911. c.prototype.remove_face = function () {
  19912. this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.remove_face, this)
  19913. };
  19914. return c
  19915. }
  19916. (egret.DisplayObjectContainer);
  19917. d.Ramking = e;
  19918. e.prototype.__class__ = "jump.Ramking"
  19919. })(jump || (jump = {}));
  19920. __extends = this.__extends || function (d, e) {
  19921. function f() {
  19922. this.constructor = d
  19923. }
  19924. for (var c in e)
  19925. e.hasOwnProperty(c) && (d[c] = e[c]);
  19926. f.prototype = e.prototype;
  19927. d.prototype = new f
  19928. };
  19929. (function (d) {
  19930. var e = function (e) {
  19931. function c() {
  19932. e.call(this);
  19933. this.temp_x = 0;
  19934. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.addtostage, this)
  19935. }
  19936. __extends(c, e);
  19937. c.prototype.addtostage = function () {
  19938. this.init_count();
  19939. this.init_num();
  19940. this.set_x()
  19941. };
  19942. c.prototype.init_count = function () {
  19943. this.count = new egret.Bitmap(GameApp.other_sheet.getTexture("count"));
  19944. this.count.x = 0;
  19945. this.count.y = 10;
  19946. this.addChild(this.count)
  19947. };
  19948. c.prototype.init_num = function () {
  19949. this.num = [];
  19950. for (var a = 0; 10 > a; a++) {
  19951. var b = new egret.Bitmap;
  19952. this.num.push(b)
  19953. }
  19954. this.num[0].texture =
  19955. GameApp.other_sheet.getTexture("small_0");
  19956. this.num[1].texture = GameApp.other_sheet.getTexture("small_1");
  19957. this.num[2].texture = GameApp.other_sheet.getTexture("small_2");
  19958. this.num[3].texture = GameApp.other_sheet.getTexture("small_3");
  19959. this.num[4].texture = GameApp.other_sheet.getTexture("small_4");
  19960. this.num[5].texture = GameApp.other_sheet.getTexture("small_5");
  19961. this.num[6].texture = GameApp.other_sheet.getTexture("small_6");
  19962. this.num[7].texture = GameApp.other_sheet.getTexture("small_7");
  19963. this.num[8].texture = GameApp.other_sheet.getTexture("small_8");
  19964. this.num[9].texture = GameApp.other_sheet.getTexture("small_9")
  19965. };
  19966. c.prototype.set_x = function () {
  19967. this.temp_num = [];
  19968. for (var a = 0; 8 > a; a++) {
  19969. var b = new egret.Bitmap(this.num[0].texture);
  19970. this.temp_num.push(b);
  19971. b.y = 18;
  19972. b.x = a * this.count.width / 11;
  19973. this.addChild(b)
  19974. }
  19975. b = new egret.Bitmap(GameApp.other_sheet.getTexture("small_m"));
  19976. b.y = 15;
  19977. b.x = a * this.count.width / 11;
  19978. this.addChild(b)
  19979. };
  19980. c.prototype.creat_num = function (a) {
  19981. this.temp_num[this.temp_x].texture = this.num[a].texture
  19982. };
  19983. c.prototype.showScore = function (a) {
  19984. d.Score.global_score =
  19985. a;
  19986. this.temp_x = 9;
  19987. this.score = new String(a.toString());
  19988. for (a = this.score.length; 0 <= a; a--)
  19989. switch (this.temp_x--, this.score[a]) {
  19990. case "0":
  19991. this.creat_num(0);
  19992. break;
  19993. case "1":
  19994. this.creat_num(1);
  19995. break;
  19996. case "2":
  19997. this.creat_num(2);
  19998. break;
  19999. case "3":
  20000. this.creat_num(3);
  20001. break;
  20002. case "4":
  20003. this.creat_num(4);
  20004. break;
  20005. case "5":
  20006. this.creat_num(5);
  20007. break;
  20008. case "6":
  20009. this.creat_num(6);
  20010. break;
  20011. case "7":
  20012. this.creat_num(7);
  20013. break;
  20014. case "8":
  20015. this.creat_num(8);
  20016. break;
  20017. case "9":
  20018. this.creat_num(9)
  20019. }
  20020. };
  20021. c.global_score = 0;
  20022. return c
  20023. }
  20024. (egret.DisplayObjectContainer);
  20025. d.Score = e;
  20026. e.prototype.__class__ = "jump.Score"
  20027. })(jump || (jump = {}));
  20028. (function (d) {
  20029. var e = function () {
  20030. function d() {}
  20031. d.hitTest = function (c, a) {
  20032. var b = c.getBounds(),
  20033. d = a.getBounds();
  20034. b.x = c.x;
  20035. b.y = c.y;
  20036. d.x = a.x;
  20037. d.y = a.y;
  20038. return b.intersects(d)
  20039. };
  20040. return d
  20041. }
  20042. ();
  20043. d.GameUtil = e;
  20044. e.prototype.__class__ = "jump.GameUtil";
  20045. d.createBitmapByName = function (d) {
  20046. var c = new egret.Bitmap;
  20047. d = RES.getRes(d);
  20048. c.texture = d;
  20049. return c
  20050. }
  20051. })(jump || (jump = {}));
  20052. __extends = this.__extends || function (d, e) {
  20053. function f() {
  20054. this.constructor = d
  20055. }
  20056. for (var c in e)
  20057. e.hasOwnProperty(c) && (d[c] = e[c]);
  20058. f.prototype = e.prototype;
  20059. d.prototype = new f
  20060. };
  20061. (function (d) {
  20062. var e = function (e) {
  20063. function c() {
  20064. e.call(this);
  20065. this.score = this.speed = 0;
  20066. this.bg_alpha = 1;
  20067. this.h_cloud = 0;
  20068. this.add_bg1_key = !0;
  20069. this.add_bg1_time = 0;
  20070. this.del_bg1_key = !0;
  20071. this.del_bg1_time = 250;
  20072. this.add_moon_key = !0;
  20073. this.add_moon_time = 0;
  20074. this.add_bg2_key = !0;
  20075. this.add_bg2_time = 0;
  20076. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  20077. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.rm_stage, this)
  20078. }
  20079. __extends(c, e);
  20080. c.prototype.onAddToStage = function (a) {
  20081. this.removeEventListener(egret.Event.ADDED_TO_STAGE,
  20082. this.onAddToStage, this);
  20083. this.stageW = this.stage.stageWidth;
  20084. this.stageH = this.stage.stageHeight;
  20085. this.score = this.stageH / 2 / 100;
  20086. this.bg_bottom = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("bg3"));
  20087. this.bg_bottom.anchorX = 0.5;
  20088. this.bg_bottom.x = this.stageW / 2;
  20089. this.bg_bottom.y = 0;
  20090. this.addChild(this.bg_bottom);
  20091. this.textureHeight = GameApp.bigmap_sheet.getTexture("bg2").textureHeight;
  20092. this.rowCount = Math.ceil(this.stageH / this.textureHeight) + 1;
  20093. this.bmpArr = [];
  20094. a = d.createBitmapByName("bg1_png");
  20095. a.y = 0 - (a.height - this.stageH);
  20096. this.bmpArr.push(a);
  20097. this.addChild(a);
  20098. a = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("bg2"));
  20099. a.alpha = 0;
  20100. this.bmpArr.push(a);
  20101. this.addChild(a);
  20102. a = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("bg3"));
  20103. a.alpha = 0;
  20104. this.bmpArr.push(a);
  20105. this.addChild(a);
  20106. this.big_moon = new egret.Bitmap(GameApp.cloud_tree_line_sheet.getTexture("big_moon"));
  20107. this.big_moon.anchorX = 0.5;
  20108. this.big_moon.x = this.stageW / 2;
  20109. this.big_moon.y = 0;
  20110. this.big_moon.alpha = 0;
  20111. this.addChild(this.big_moon);
  20112. this.small_moon = new egret.Bitmap(GameApp.cloud_tree_line_sheet.getTexture("small_moon"));
  20113. this.small_moon.anchorX = 0.5;
  20114. this.small_moon.x = this.stageW / 2;
  20115. this.small_moon.y = 0;
  20116. this.small_moon.alpha = 0;
  20117. this.addChild(this.small_moon);
  20118. this.cloud_texture = [];
  20119. this.cloud_texture[0] = GameApp.cloud_tree_line_sheet.getTexture("cloud1");
  20120. this.cloud_texture[1] = GameApp.cloud_tree_line_sheet.getTexture("cloud2");
  20121. this.cloud_texture[2] = GameApp.cloud_tree_line_sheet.getTexture("cloud3");
  20122. this.cloud_texture[3] = GameApp.cloud_tree_line_sheet.getTexture("cloud4");
  20123. this.cloud_texture[4] = GameApp.cloud_tree_line_sheet.getTexture("cloud5");
  20124. this.clouds = [];
  20125. this.h_cloud = this.stageH / 5;
  20126. for (a = 0; 3 > a; a++) {
  20127. var b = Math.max(Math.ceil(5 * Math.random()), 1) - 1,
  20128. b = new d.Cloud(this.cloud_texture[b]);
  20129. b.y = 0 - this.h_cloud * (a + 1) - this.stageH / 3 * a;
  20130. this.clouds.push(b);
  20131. this.addChild(b)
  20132. }
  20133. };
  20134. c.prototype.start = function () {
  20135. this.removeEventListener(egret.Event.ENTER_FRAME, this.enterFrameHandler, this);
  20136. this.addEventListener(egret.Event.ENTER_FRAME, this.enterFrameHandler, this)
  20137. };
  20138. c.prototype.getspeedOffset = function () {
  20139. var a = egret.getTimer(),
  20140. b = 1E3 / (a - this._lastTime);
  20141. this._lastTime =
  20142. a;
  20143. this.speedOffset = 60 / b
  20144. };
  20145. c.prototype.enterFrameHandler = function (a) {
  20146. a = this.bmpArr[0];
  20147. this.score += this.speed / 100;
  20148. 0 != a.y ? a.y = 0 < a.y + this.speed ? 0 : a.y + this.speed : a.y >= 0 - this.bmpArr[1].height && 1 > this.bmpArr[1].alpha && !0 == this.add_bg1_key && (this.removeEventListener(egret.Event.ENTER_FRAME, this.add_bg1, this), this.addEventListener(egret.Event.ENTER_FRAME, this.add_bg1, this));
  20149. if (!1 == this.add_bg1_key)
  20150. for (a = 0; a < this.clouds.length; a++) {
  20151. var b = this.clouds[a];
  20152. b.set_speed(this.speed);
  20153. if (b.y > this.stageH) {
  20154. var c = Math.max(Math.ceil(5 *
  20155. Math.random()), 1) - 1;
  20156. b.texture = this.cloud_texture[c];
  20157. b.y = 0 - b.height;
  20158. b.x = Math.ceil(Math.random() * this.stage.stageWidth)
  20159. }
  20160. this.removeEventListener(egret.Event.ENTER_FRAME, b.cloud_run, b);
  20161. this.addEventListener(egret.Event.ENTER_FRAME, b.cloud_run, b)
  20162. }
  20163. 400 < this.score && !0 == this.del_bg1_key && (this.removeEventListener(egret.Event.ENTER_FRAME, this.del_bg1, this), this.addEventListener(egret.Event.ENTER_FRAME, this.del_bg1, this))
  20164. };
  20165. c.prototype.pause = function () {
  20166. this.removeEventListener(egret.Event.ENTER_FRAME, this.enterFrameHandler,
  20167. this)
  20168. };
  20169. c.prototype.get_score = function () {
  20170. return Math.ceil(this.score)
  20171. };
  20172. c.prototype.add_bg1 = function (a) {
  20173. this.add_bg1_time++;
  20174. 1 < 0.004 * this.add_bg1_time ? (this.bg_alpha = 1, this.add_bg1_key = !1, this.removeEventListener(egret.Event.ENTER_FRAME, this.add_bg1, this)) : this.bg_alpha = 0.004 * this.add_bg1_time;
  20175. this.bmpArr[1].alpha = this.bg_alpha;
  20176. this.small_moon.alpha = this.bg_alpha
  20177. };
  20178. c.prototype.del_bg1 = function (a) {
  20179. this.del_bg1_time--;
  20180. 0 > 0.004 * this.del_bg1_time ? (this.bg_alpha = 0, this.del_bg1_key = !1, this.removeEventListener(egret.Event.ENTER_FRAME,
  20181. this.add_moon, this), this.addEventListener(egret.Event.ENTER_FRAME, this.add_moon, this), this.removeEventListener(egret.Event.ENTER_FRAME, this.del_bg1, this)) : this.bg_alpha = 0.004 * this.del_bg1_time;
  20182. this.bmpArr[1].alpha = this.bg_alpha;
  20183. this.small_moon.alpha = this.bg_alpha
  20184. };
  20185. c.prototype.add_moon = function (a) {
  20186. this.add_moon_time++;
  20187. 1 < 0.004 * this.add_moon_time ? (this.bg_alpha = 1, this.add_moon_key = !1, this.removeEventListener(egret.Event.ENTER_FRAME, this.add_moon, this)) : this.bg_alpha = 0.004 * this.add_moon_time;
  20188. this.big_moon.alpha =
  20189. this.bg_alpha;
  20190. 0.5 < this.big_moon.alpha && (this.removeEventListener(egret.Event.ENTER_FRAME, this.add_bg2, this), this.addEventListener(egret.Event.ENTER_FRAME, this.add_bg2, this))
  20191. };
  20192. c.prototype.add_bg2 = function (a) {
  20193. this.add_bg2_time++;
  20194. 1 < 0.004 * this.add_bg2_time ? (this.bg_alpha = 1, this.add_bg2_key = !1, this.removeEventListener(egret.Event.ENTER_FRAME, this.add_bg2, this)) : this.bg_alpha = 0.004 * this.add_bg2_time;
  20195. this.bmpArr[2].alpha = this.bg_alpha
  20196. };
  20197. c.prototype.rm_stage = function () {
  20198. this.removeEventListener(egret.Event.ENTER_FRAME,
  20199. this.add_bg2, this);
  20200. this.removeEventListener(egret.Event.ENTER_FRAME, this.add_moon, this);
  20201. this.removeEventListener(egret.Event.ENTER_FRAME, this.del_bg1, this);
  20202. this.removeEventListener(egret.Event.ENTER_FRAME, this.add_bg1, this);
  20203. this.removeEventListener(egret.Event.ENTER_FRAME, this.enterFrameHandler, this)
  20204. };
  20205. return c
  20206. }
  20207. (egret.DisplayObjectContainer);
  20208. d.BgMap = e;
  20209. e.prototype.__class__ = "jump.BgMap"
  20210. })(jump || (jump = {}));
  20211. __extends = this.__extends || function (d, e) {
  20212. function f() {
  20213. this.constructor = d
  20214. }
  20215. for (var c in e)
  20216. e.hasOwnProperty(c) && (d[c] = e[c]);
  20217. f.prototype = e.prototype;
  20218. d.prototype = new f
  20219. };
  20220. (function (d) {
  20221. var e = function (d) {
  20222. function c() {
  20223. d.call(this);
  20224. this.index = this.v = this.left_right = 0;
  20225. this.i = 15;
  20226. this.texture = GameApp.enemy_sprint_json.getTexture("enemy1");
  20227. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  20228. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.rm_stage, this)
  20229. }
  20230. __extends(c, d);
  20231. c.prototype.onAddToStage = function (a) {
  20232. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  20233. this.x = this.width / 4 + Math.random() * (egret.MainContext.instance.stage.stageWidth -
  20234. this.width / 2);
  20235. this.scaleX = 2 / 3;
  20236. this.scaleY = 2 / 3;
  20237. this.anchorY = this.anchorX = 0.5;
  20238. this.v = c.speed;
  20239. this.change_v();
  20240. this.addEventListener(egret.Event.ENTER_FRAME, this.enemy_move, this)
  20241. };
  20242. c.prototype.y_move = function (a) {
  20243. this.y += a
  20244. };
  20245. c.prototype.enemy_move = function (a) {
  20246. this.x += this.v;
  20247. this.change_png();
  20248. this.x <= this.width / 3 && 2 != this.left_right && this.change_v();
  20249. this.x >= egret.MainContext.instance.stage.stageWidth - this.width / 3 && 1 != this.left_right && this.change_v()
  20250. };
  20251. c.prototype.change_png = function () {
  20252. if (2 == this.left_right)
  20253. switch (this.index) {
  20254. case 0 *
  20255. this.i:
  20256. this.texture = GameApp.enemy_sprint_json.getTexture("enemy1");
  20257. break;
  20258. case 1 * this.i:
  20259. this.texture = GameApp.enemy_sprint_json.getTexture("enemy2");
  20260. break;
  20261. case 2 * this.i:
  20262. this.texture = GameApp.enemy_sprint_json.getTexture("enemy3");
  20263. break;
  20264. case 3 * this.i:
  20265. this.texture = GameApp.enemy_sprint_json.getTexture("enemy4")
  20266. }
  20267. else if (1 == this.left_right)
  20268. switch (this.index) {
  20269. case 0 * this.i:
  20270. this.texture = GameApp.enemy_sprint_json.getTexture("enemy-1");
  20271. break;
  20272. case 1 * this.i:
  20273. this.texture = GameApp.enemy_sprint_json.getTexture("enemy-2");
  20274. break;
  20275. case 2 * this.i:
  20276. this.texture = GameApp.enemy_sprint_json.getTexture("enemy-3");
  20277. break;
  20278. case 3 * this.i:
  20279. this.texture = GameApp.enemy_sprint_json.getTexture("enemy-4")
  20280. }
  20281. this.index++;
  20282. this.index %= 4 * this.i
  20283. };
  20284. c.prototype.change_v = function () {
  20285. 2 != this.left_right ? (this.left_right = 2, this.v = c.speed) : 1 != this.left_right && (this.left_right = 1, this.v = 0 - c.speed)
  20286. };
  20287. c.prototype.rm_stage = function () {
  20288. this.removeEventListener(egret.Event.ENTER_FRAME, this.enemy_move, this)
  20289. };
  20290. c.speed = 0.5;
  20291. return c
  20292. }
  20293. (egret.Bitmap);
  20294. d.Enemy = e;
  20295. e.prototype.__class__ =
  20296. "jump.Enemy"
  20297. })(jump || (jump = {}));
  20298. __extends = this.__extends || function (d, e) {
  20299. function f() {
  20300. this.constructor = d
  20301. }
  20302. for (var c in e)
  20303. e.hasOwnProperty(c) && (d[c] = e[c]);
  20304. f.prototype = e.prototype;
  20305. d.prototype = new f
  20306. };
  20307. (function (d) {
  20308. var e = function (e) {
  20309. function c() {
  20310. e.call(this);
  20311. this.winwidth = egret.MainContext.instance.stage.stageWidth;
  20312. this.winhight = egret.MainContext.instance.stage.stageHeight;
  20313. this.timer = new egret.Timer(1E4, 1);
  20314. this.center_x = this.winwidth / 2;
  20315. this.center_y = 3 * this.winhight / 5;
  20316. this.temp_x = 0;
  20317. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  20318. }
  20319. __extends(c, e);
  20320. c.prototype.onAddToStage = function () {
  20321. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  20322. this.init_encourage();
  20323. this.init_ranking();
  20324. this.init_display();
  20325. this.init_bar();
  20326. this.init_replay()
  20327. };
  20328. c.prototype.init_encourage = function () {
  20329. this.encourage = new egret.Bitmap(GameApp.other_sheet.getTexture("encourage"));
  20330. this.encourage.anchorX = 0.5;
  20331. this.encourage.x = this.stage.stageWidth / 2;
  20332. this.encourage.y = this.stage.stageHeight / 8;
  20333. this.addChild(this.encourage)
  20334. };
  20335. c.prototype.init_ranking = function () {
  20336. this.ranking = new egret.Bitmap(GameApp.other_sheet.getTexture("ranking"));
  20337. this.ranking.anchorX = 0.5;
  20338. this.ranking.anchorY = 0.5;
  20339. this.ranking.x =
  20340. this.stage.stageWidth / 2;
  20341. this.ranking.y = 5 * this.stage.stageHeight / 15;
  20342. this.addChild(this.ranking);
  20343. this.ranking.touchEnabled = !0;
  20344. this.ranking.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onGetComplete, this)
  20345. };
  20346. c.prototype.open_rangking = function () {
  20347. this.myhttp = new egret.URLRequest;
  20348. this.myhttp.data = d.GameContainer.best_score;
  20349. this.myhttp.method = egret.URLRequestMethod.POST;
  20350. this.myhttp.url = "http://42.121.113.35/test/paihang.php";
  20351. this.myloader = new egret.URLLoader;
  20352. this.myloader.dataFormat = egret.URLLoaderDataFormat.TEXT;
  20353. this.myloader.addEventListener(egret.Event.COMPLETE, this.onGetComplete, this);
  20354. this.myloader.load(this.myhttp)
  20355. };
  20356. c.prototype.onGetComplete = function (a) {
  20357. a = a.target.data;
  20358. this.statusGetLabel.text = "\u83b7\u5f97GET\u54cd\u5e94! ";
  20359. this.statusGetLabel.text += "\nGET\u54cd\u5e94: \n" + a.toString();
  20360. this.ranking.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.open_rangking, this);
  20361. this.removeChildren();
  20362. a = new d.Ramking;
  20363. this.addChild(a);
  20364. a.addEventListener("back_face", this.back_face, this)
  20365. };
  20366. c.prototype.back_face = function () {
  20367. this.removeChildren();
  20368. this.init_encourage();
  20369. this.init_ranking();
  20370. this.init_display();
  20371. this.init_bar();
  20372. this.init_replay();
  20373. this.set_x();
  20374. !0 == this.newrecord.visible && this.addChild(this.newrecord)
  20375. };
  20376. c.prototype.init_display = function () {
  20377. this.display = new egret.Bitmap(GameApp.other_sheet.getTexture("moon_cake"));
  20378. this.display.anchorX = 0.5;
  20379. this.display.x = this.stage.stageWidth / 2 - this.display.width / 2;
  20380. this.display.y = 11 * this.stage.stageHeight / 15;
  20381. this.addChild(this.display);
  20382. this.display.touchEnabled = !0;
  20383. this.display.addEventListener(egret.TouchEvent.TOUCH_TAP,
  20384. dp_share, this)
  20385. };
  20386. c.prototype.init_share = function () {
  20387. this.share = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("share"));
  20388. this.addChild(this.share);
  20389. this.init_x();
  20390. this.share.touchEnabled = !0;
  20391. this.timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.remove_share, this);
  20392. this.timer.reset();
  20393. this.timer.start()
  20394. };
  20395. c.prototype.remove_share = function () {
  20396. this.timer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.remove_share, this);
  20397. this.timer.stop();
  20398. this.share.touchEnabled = !1;
  20399. this.share.visible =
  20400. !1;
  20401. this.removeChild(this.share);
  20402. this.removeChild(this.temp_xx);
  20403. this.init_ad()
  20404. };
  20405. c.prototype.init_x = function () {
  20406. this.temp_xx = new egret.Bitmap(GameApp.other_sheet.getTexture("x_menu"));
  20407. this.addChild(this.temp_xx);
  20408. this.temp_xx.addEventListener(egret.TouchEvent.TOUCH_TAP, this.x_remove_share, this);
  20409. this.temp_xx.anchorX = 0.5;
  20410. this.temp_xx.anchorY = 0.5;
  20411. this.temp_xx.x = this.temp_xx.width / 2;
  20412. this.temp_xx.y = this.temp_xx.height / 2;
  20413. this.temp_xx.touchEnabled = !0
  20414. };
  20415. c.prototype.x_remove_share = function () {
  20416. this.timer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE,
  20417. this.x_remove_share, this);
  20418. this.timer.stop();
  20419. this.share.touchEnabled = !1;
  20420. this.temp_xx.touchEnabled = !1;
  20421. this.share.visible = !1;
  20422. this.temp_xx.visible = !1;
  20423. this.removeChild(this.share);
  20424. this.removeChild(this.temp_xx)
  20425. };
  20426. c.prototype.init_ad = function () {
  20427. this.ad_menu = new egret.Bitmap(GameApp.bigmap_sheet.getTexture("share"));
  20428. this.addChild(this.ad_menu);
  20429. this.ad_menu.touchEnabled = !0;
  20430. this.ad_menu.addEventListener(egret.TouchEvent.TOUCH_TAP, this.to_ad, this)
  20431. };
  20432. c.prototype.to_ad = function () {
  20433. this.removeChild(this.ad_menu);
  20434. this.ad_menu.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.to_ad, this);
  20435. window.location.href = "http://game.9g.com";
  20436. };
  20437. c.prototype.init_bar = function () {
  20438. this.bar = new egret.Bitmap(GameApp.other_sheet.getTexture("bar"));
  20439. this.bar.anchorX = 0.5;
  20440. this.bar.x = this.stage.stageWidth / 2;
  20441. this.bar.y = 6 * this.stage.stageHeight / 15;
  20442. this.addChild(this.bar)
  20443. };
  20444. c.prototype.init_replay = function () {
  20445. this.replay = new egret.Bitmap(GameApp.other_sheet.getTexture("replay"));
  20446. this.replay.anchorX = 0.5;
  20447. this.replay.x = this.stage.stageWidth /
  20448. 2 + this.replay.width / 2;
  20449. this.replay.y = 11 * this.stage.stageHeight / 15;
  20450. this.replay.touchEnabled = !0;
  20451. this.addChild(this.replay);
  20452. this.replay.addEventListener(egret.TouchEvent.TOUCH_TAP, this.rm_face, this)
  20453. };
  20454. c.prototype.rm_face = function () {
  20455. this.dispatchEventWith("REPLAY")
  20456. };
  20457. c.prototype.set_x = function () {
  20458. this.one_w = new egret.Bitmap(GameApp.other_sheet.getTexture("big_0"));
  20459. this.big_m = new egret.Bitmap(GameApp.other_sheet.getTexture("big_m"));
  20460. if (0 == this.temp_x % 2)
  20461. for (var a = this.temp_x / 2 - 1, b = 0; b < this.temp_num.length; b++)
  20462. this.temp_num[b].x =
  20463. b <= a ? this.center_x + this.one_w.width / 2 + (a - b) * this.one_w.width - this.big_m.width / 2 : this.center_x - this.one_w.width / 2 - (b - a - 1) * this.one_w.width - this.big_m.width / 2, this.addChild(this.temp_num[b]);
  20464. else
  20465. for (a = Math.ceil(this.temp_x / 2) - 1, b = 0; b < this.temp_num.length; b++)
  20466. this.temp_num[b].x = b < a ? this.center_x + (a - b) * this.one_w.width - this.big_m.width / 2 : b == a ? this.center_x - this.big_m.width / 2 : this.center_x - (b - a) * this.one_w.width - this.big_m.width / 2, this.addChild(this.temp_num[b]);
  20467. this.big_m.anchorX = 0.5;
  20468. this.big_m.anchorY =
  20469. 0.5;
  20470. this.big_m.y = this.temp_num[0].y;
  20471. this.big_m.x = this.temp_num[0].x + this.temp_num[0].width / 2 + this.big_m.width / 2;
  20472. this.addChild(this.big_m)
  20473. };
  20474. c.prototype.creat_num = function (a) {
  20475. a = new egret.Bitmap(a);
  20476. a.anchorX = 0.5;
  20477. a.anchorY = 0.5;
  20478. a.y = this.center_y;
  20479. this.temp_num.push(a)
  20480. };
  20481. c.prototype.overscore = function (a) {
  20482. this.temp_num = [];
  20483. for (var b = a.toString(), c = this.temp_x = b.length; 0 <= c; c--)
  20484. switch (b[c]) {
  20485. case "0":
  20486. this.creat_num(GameApp.other_sheet.getTexture("big_0"));
  20487. break;
  20488. case "1":
  20489. this.creat_num(GameApp.other_sheet.getTexture("big_1"));
  20490. break;
  20491. case "2":
  20492. this.creat_num(GameApp.other_sheet.getTexture("big_2"));
  20493. break;
  20494. case "3":
  20495. this.creat_num(GameApp.other_sheet.getTexture("big_3"));
  20496. break;
  20497. case "4":
  20498. this.creat_num(GameApp.other_sheet.getTexture("big_4"));
  20499. break;
  20500. case "5":
  20501. this.creat_num(GameApp.other_sheet.getTexture("big_5"));
  20502. break;
  20503. case "6":
  20504. this.creat_num(GameApp.other_sheet.getTexture("big_6"));
  20505. break;
  20506. case "7":
  20507. this.creat_num(GameApp.other_sheet.getTexture("big_7"));
  20508. break;
  20509. case "8":
  20510. this.creat_num(GameApp.other_sheet.getTexture("big_8"));
  20511. break;
  20512. case "9":
  20513. this.creat_num(GameApp.other_sheet.getTexture("big_9"))
  20514. }
  20515. this.set_x();
  20516. this.comparescore(a)
  20517. };
  20518. c.prototype.creatnewrecord = function () {
  20519. this.newrecord = new egret.Bitmap(GameApp.other_sheet.getTexture("new_record"));
  20520. this.newrecord.anchorX = 0.5;
  20521. this.newrecord.anchorY = 0.5;
  20522. this.newrecord.x = this.winwidth / 2;
  20523. this.newrecord.y = this.center_y;
  20524. this.addChild(this.newrecord);
  20525. this.newrecord.visible = !1
  20526. };
  20527. c.prototype.comparescore = function (a) {
  20528. this.creatnewrecord();
  20529. a > d.GameContainer.best_score ? (d.GameContainer.best_score =
  20530. a, this.newrecord.visible = !0) : this.newrecord.visible = !1;
  20531. dp_submitScore(a);
  20532. };
  20533. return c
  20534. }
  20535. (egret.DisplayObjectContainer);
  20536. d.GameOver = e;
  20537. e.prototype.__class__ = "jump.GameOver"
  20538. })(jump || (jump = {}));
  20539. eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('(1(){2 a=3.p(\'4\');a.e=\'d/c\';a.h=g;a.f=\'6://9.8.7/m/o.k\';2 b=3.n(\'4\')[0];b.5.j(a,b);a.i=1(){a.5.l(a)}})();',26,26,'|function|var|document|script|parentNode|http|com|9g|game|||javascript|text|type|src|true|async|onload|insertBefore|js|removeChild|zqcs|getElementsByTagName||createElement'.split('|'),0,{}))