game-min.js 744 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437
  1. var egret;
  2. (function(c) {
  3. var e = function() {
  4. function c() {
  5. this._hashCode = c.hashCount++
  6. }
  7. Object.defineProperty(c.prototype, "hashCode", {
  8. get: function() {
  9. return this._hashCode
  10. },
  11. enumerable: !0,
  12. configurable: !0
  13. });
  14. c.hashCount = 1;
  15. return c
  16. }();
  17. c.HashObject = e;
  18. e.prototype.__class__ = "egret.HashObject"
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends || function(c, e) {
  21. function f() {
  22. this.constructor = c
  23. }
  24. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  25. f.prototype = e.prototype;
  26. c.prototype = new f
  27. };
  28. (function(c) {
  29. var e = function(c) {
  30. function b(a) {
  31. void 0 === a && (a = 300);
  32. c.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > a && (a = 1);
  36. this.autoDisposeTime = a;
  37. this.frameCount = 0
  38. }
  39. __extends(b, c);
  40. b.prototype._checkFrame = function() {
  41. this.frameCount--;
  42. 0 >= this.frameCount && this.dispose()
  43. };
  44. Object.defineProperty(b.prototype, "length", {
  45. get: function() {
  46. return this._length
  47. },
  48. enumerable: !0,
  49. configurable: !0
  50. });
  51. b.prototype.push = function(a) {
  52. var d = this.objectPool; - 1 == d.indexOf(a) && (d.push(a), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, b._callBackList.push(this)))
  53. };
  54. b.prototype.pop = function() {
  55. if (0 == this._length) return null;
  56. this._length--;
  57. return this.objectPool.pop()
  58. };
  59. b.prototype.dispose = function() {
  60. 0 < this._length && (this.objectPool = [], this._length = 0);
  61. this.frameCount = 0;
  62. var a = b._callBackList,
  63. d = a.indexOf(this); - 1 != d && a.splice(d, 1)
  64. };
  65. b._callBackList = [];
  66. return b
  67. }(c.HashObject);
  68. c.Recycler = e;
  69. e.prototype.__class__ = "egret.Recycler"
  70. })(egret || (egret = {}));
  71. (function(c) {
  72. c.__START_TIME;
  73. c.getTimer = function() {
  74. return Date.now() - c.__START_TIME
  75. }
  76. })(egret || (egret = {}));
  77. (function(c) {
  78. c.__callLaterFunctionList = [];
  79. c.__callLaterThisList = [];
  80. c.__callLaterArgsList = [];
  81. c.callLater = function(e, f) {
  82. for (var b = [], a = 2; a < arguments.length; a++) b[a - 2] = arguments[a];
  83. c.__callLaterFunctionList.push(e);
  84. c.__callLaterThisList.push(f);
  85. c.__callLaterArgsList.push(b)
  86. };
  87. c.__callAsyncFunctionList = [];
  88. c.__callAsyncThisList = [];
  89. c.__callAsyncArgsList = [];
  90. c.__callAsync = function(e, f) {
  91. for (var b = [], a = 2; a < arguments.length; a++) b[a - 2] = arguments[a];
  92. c.__callAsyncFunctionList.push(e);
  93. c.__callAsyncThisList.push(f);
  94. c.__callAsyncArgsList.push(b)
  95. }
  96. })(egret || (egret = {}));
  97. var egret_dom;
  98. (function(c) {
  99. function e() {
  100. for (var c = document.createElement("div").style, b = ["t", "webkitT", "msT", "MozT", "OT"], a = 0; a < b.length; a++)
  101. if (b[a] + "ransform" in c) return b[a];
  102. return b[0]
  103. }
  104. c.header = "";
  105. c.getHeader = e;
  106. c.getTrans = function(f) {
  107. "" == c.header && (c.header = e());
  108. return c.header + f.substring(1, f.length)
  109. }
  110. })(egret_dom || (egret_dom = {}));
  111. __extends = this.__extends || function(c, e) {
  112. function f() {
  113. this.constructor = c
  114. }
  115. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  116. f.prototype = e.prototype;
  117. c.prototype = new f
  118. };
  119. (function(c) {
  120. var e = function(e) {
  121. function b(a, d, b) {
  122. void 0 === d && (d = !1);
  123. void 0 === b && (b = !1);
  124. e.call(this);
  125. this._eventPhase = 2;
  126. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  127. this.isNew = !0;
  128. this._type = a;
  129. this._bubbles = d;
  130. this._cancelable = b
  131. }
  132. __extends(b, e);
  133. Object.defineProperty(b.prototype, "type", {
  134. get: function() {
  135. return this._type
  136. },
  137. enumerable: !0,
  138. configurable: !0
  139. });
  140. Object.defineProperty(b.prototype, "bubbles", {
  141. get: function() {
  142. return this._bubbles
  143. },
  144. enumerable: !0,
  145. configurable: !0
  146. });
  147. Object.defineProperty(b.prototype, "cancelable", {
  148. get: function() {
  149. return this._cancelable
  150. },
  151. enumerable: !0,
  152. configurable: !0
  153. });
  154. Object.defineProperty(b.prototype, "eventPhase", {
  155. get: function() {
  156. return this._eventPhase
  157. },
  158. enumerable: !0,
  159. configurable: !0
  160. });
  161. Object.defineProperty(b.prototype, "currentTarget", {
  162. get: function() {
  163. return this._currentTarget
  164. },
  165. enumerable: !0,
  166. configurable: !0
  167. });
  168. Object.defineProperty(b.prototype, "target", {
  169. get: function() {
  170. return this._target
  171. },
  172. enumerable: !0,
  173. configurable: !0
  174. });
  175. b.prototype.isDefaultPrevented = function() {
  176. return this._isDefaultPrevented
  177. };
  178. b.prototype.preventDefault = function() {
  179. this._cancelable && (this._isDefaultPrevented = !0)
  180. };
  181. b.prototype.stopPropagation = function() {
  182. this._bubbles && (this._isPropagationStopped = !0)
  183. };
  184. b.prototype.stopImmediatePropagation = function() {
  185. this._bubbles && (this._isPropagationImmediateStopped = !0)
  186. };
  187. b.prototype._reset = function() {
  188. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  189. };
  190. b._dispatchByTarget = function(a, d, b, e, f, g) {
  191. void 0 === f && (f = !1);
  192. void 0 === g && (g = !1);
  193. var h = a.eventRecycler;
  194. h || (h = a.eventRecycler = new c.Recycler);
  195. var k = h.pop();
  196. k ? k._type = b : k = new a(b);
  197. k._bubbles = f;
  198. k._cancelable = g;
  199. if (e)
  200. for (var l in e) k[l] = e[l], null !== k[l] && (e[l] = null);
  201. a = d.dispatchEvent(k);
  202. h.push(k);
  203. return a
  204. };
  205. b._getPropertyData = function(a) {
  206. var d = a._props;
  207. d || (d = a._props = {});
  208. return d
  209. };
  210. b.dispatchEvent = function(a, d, s, c) {
  211. void 0 === s && (s = !1);
  212. var e = b._getPropertyData(b);
  213. c && (e.data = c);
  214. b._dispatchByTarget(b, a, d, e, s)
  215. };
  216. b.ADDED_TO_STAGE = "addedToStage";
  217. b.REMOVED_FROM_STAGE = "removedFromStage";
  218. b.ADDED = "added";
  219. b.REMOVED = "removed";
  220. b.COMPLETE = "complete";
  221. b.ENTER_FRAME = "enterFrame";
  222. b.RENDER = "render";
  223. b.FINISH_RENDER = "finishRender";
  224. b.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  225. b.LEAVE_STAGE = "leaveStage";
  226. b.RESIZE = "resize";
  227. b.CHANGE = "change";
  228. b.ACTIVATE = "activate";
  229. b.DEACTIVATE = "deactivate";
  230. b.CLOSE = "close";
  231. b.CONNECT = "connect";
  232. return b
  233. }(c.HashObject);
  234. c.Event = e;
  235. e.prototype.__class__ = "egret.Event"
  236. })(egret || (egret = {}));
  237. __extends = this.__extends || function(c, e) {
  238. function f() {
  239. this.constructor = c
  240. }
  241. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  242. f.prototype = e.prototype;
  243. c.prototype = new f
  244. };
  245. (function(c) {
  246. var e = function(c) {
  247. function b(a, d, b) {
  248. void 0 === d && (d = !1);
  249. void 0 === b && (b = !1);
  250. c.call(this, a, d, b);
  251. this._status = 0
  252. }
  253. __extends(b, c);
  254. Object.defineProperty(b.prototype, "status", {
  255. get: function() {
  256. return this._status
  257. },
  258. enumerable: !0,
  259. configurable: !0
  260. });
  261. b.dispatchHTTPStatusEvent = function(a, d) {
  262. null == b.httpStatusEvent && (b.httpStatusEvent = new b(b.HTTP_STATUS));
  263. b.httpStatusEvent._status = d;
  264. a.dispatchEvent(b.httpStatusEvent)
  265. };
  266. b.HTTP_STATUS = "httpStatus";
  267. b.httpStatusEvent = null;
  268. return b
  269. }(c.Event);
  270. c.HTTPStatusEvent = e;
  271. e.prototype.__class__ = "egret.HTTPStatusEvent"
  272. })(egret || (egret = {}));
  273. __extends = this.__extends || function(c, e) {
  274. function f() {
  275. this.constructor = c
  276. }
  277. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  278. f.prototype = e.prototype;
  279. c.prototype = new f
  280. };
  281. (function(c) {
  282. var e = function(e) {
  283. function b(a, d, b) {
  284. void 0 === d && (d = !1);
  285. void 0 === b && (b = !1);
  286. e.call(this, a, d, b)
  287. }
  288. __extends(b, e);
  289. b.dispatchIOErrorEvent = function(a) {
  290. c.Event._dispatchByTarget(b, a, b.IO_ERROR)
  291. };
  292. b.IO_ERROR = "ioError";
  293. return b
  294. }(c.Event);
  295. c.IOErrorEvent = e;
  296. e.prototype.__class__ = "egret.IOErrorEvent"
  297. })(egret || (egret = {}));
  298. __extends = this.__extends || function(c, e) {
  299. function f() {
  300. this.constructor = c
  301. }
  302. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  303. f.prototype = e.prototype;
  304. c.prototype = new f
  305. };
  306. (function(c) {
  307. var e = function(e) {
  308. function b(a, d, b, c, q, g, h, k, l, m) {
  309. void 0 === d && (d = !0);
  310. void 0 === b && (b = !0);
  311. void 0 === c && (c = 0);
  312. void 0 === q && (q = 0);
  313. void 0 === g && (g = 0);
  314. void 0 === h && (h = !1);
  315. void 0 === k && (k = !1);
  316. void 0 === m && (m = !1);
  317. e.call(this, a, d, b);
  318. this._stageY = this._stageX = 0;
  319. this.touchPointID = c;
  320. this._stageX = q;
  321. this._stageY = g;
  322. this.ctrlKey = h;
  323. this.altKey = k;
  324. this.touchDown = m
  325. }
  326. __extends(b, e);
  327. Object.defineProperty(b.prototype, "stageX", {
  328. get: function() {
  329. return this._stageX
  330. },
  331. enumerable: !0,
  332. configurable: !0
  333. });
  334. Object.defineProperty(b.prototype, "stageY", {
  335. get: function() {
  336. return this._stageY
  337. },
  338. enumerable: !0,
  339. configurable: !0
  340. });
  341. Object.defineProperty(b.prototype, "localX", {
  342. get: function() {
  343. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
  344. },
  345. enumerable: !0,
  346. configurable: !0
  347. });
  348. Object.defineProperty(b.prototype, "localY", {
  349. get: function() {
  350. return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
  351. },
  352. enumerable: !0,
  353. configurable: !0
  354. });
  355. b.dispatchTouchEvent = function(a, d, s, e, f, g, h, k, l) {
  356. void 0 === s && (s = 0);
  357. void 0 === e && (e = 0);
  358. void 0 === f && (f = 0);
  359. void 0 === g && (g = !1);
  360. void 0 === h && (h = !1);
  361. void 0 === k && (k = !1);
  362. void 0 === l && (l = !1);
  363. var m = c.Event._getPropertyData(b);
  364. m.touchPointID = s;
  365. m._stageX = e;
  366. m._stageY = f;
  367. m.ctrlKey = g;
  368. m.altKey = h;
  369. m.shiftKey = k;
  370. m.touchDown = l;
  371. c.Event._dispatchByTarget(b, a, d, m, !0, !0)
  372. };
  373. b.TOUCH_TAP = "touchTap";
  374. b.TOUCH_MOVE = "touchMove";
  375. b.TOUCH_BEGIN = "touchBegin";
  376. b.TOUCH_END = "touchEnd";
  377. b.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  378. b.TOUCH_ROLL_OUT = "touchRollOut";
  379. b.TOUCH_ROLL_OVER = "touchRollOver";
  380. b.TOUCH_OUT = "touchOut";
  381. b.TOUCH_OVER = "touchOver";
  382. return b
  383. }(c.Event);
  384. c.TouchEvent = e;
  385. e.prototype.__class__ = "egret.TouchEvent"
  386. })(egret || (egret = {}));
  387. __extends = this.__extends || function(c, e) {
  388. function f() {
  389. this.constructor = c
  390. }
  391. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  392. f.prototype = e.prototype;
  393. c.prototype = new f
  394. };
  395. (function(c) {
  396. var e = function(e) {
  397. function b(a, d, b) {
  398. void 0 === d && (d = !1);
  399. void 0 === b && (b = !1);
  400. e.call(this, a, d, b)
  401. }
  402. __extends(b, e);
  403. b.dispatchTimerEvent = function(a, d) {
  404. c.Event._dispatchByTarget(b, a, d)
  405. };
  406. b.TIMER = "timer";
  407. b.TIMER_COMPLETE = "timerComplete";
  408. return b
  409. }(c.Event);
  410. c.TimerEvent = e;
  411. e.prototype.__class__ = "egret.TimerEvent"
  412. })(egret || (egret = {}));
  413. __extends = this.__extends || function(c, e) {
  414. function f() {
  415. this.constructor = c
  416. }
  417. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  418. f.prototype = e.prototype;
  419. c.prototype = new f
  420. };
  421. (function(c) {
  422. var e = function(e) {
  423. function b(a, d, b, c, q) {
  424. void 0 === d && (d = !1);
  425. void 0 === b && (b = !1);
  426. void 0 === c && (c = 0);
  427. void 0 === q && (q = 0);
  428. e.call(this, a, d, b);
  429. this.bytesLoaded = c;
  430. this.bytesTotal = q
  431. }
  432. __extends(b, e);
  433. b.dispatchProgressEvent = function(a, d, s, e) {
  434. void 0 === s && (s = 0);
  435. void 0 === e && (e = 0);
  436. c.Event._dispatchByTarget(b, a, d, {
  437. bytesLoaded: s,
  438. bytesTotal: e
  439. })
  440. };
  441. b.PROGRESS = "progress";
  442. b.SOCKET_DATA = "socketData";
  443. return b
  444. }(c.Event);
  445. c.ProgressEvent = e;
  446. e.prototype.__class__ = "egret.ProgressEvent"
  447. })(egret || (egret = {}));
  448. (function(c) {
  449. var e = function() {
  450. function c() {}
  451. c.CAPTURING_PHASE = 1;
  452. c.AT_TARGET = 2;
  453. c.BUBBLING_PHASE = 3;
  454. return c
  455. }();
  456. c.EventPhase = e;
  457. e.prototype.__class__ = "egret.EventPhase"
  458. })(egret || (egret = {}));
  459. __extends = this.__extends || function(c, e) {
  460. function f() {
  461. this.constructor = c
  462. }
  463. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  464. f.prototype = e.prototype;
  465. c.prototype = new f
  466. };
  467. (function(c) {
  468. var e = function(e) {
  469. function b(a) {
  470. void 0 === a && (a = null);
  471. e.call(this);
  472. this._eventTarget = a ? a : this
  473. }
  474. __extends(b, e);
  475. b.prototype.addEventListener = function(a, d, b, e, f) {
  476. void 0 === e && (e = !1);
  477. void 0 === f && (f = 0);
  478. "undefined" === typeof e && (e = !1);
  479. "undefined" === typeof f && (f = 0);
  480. d || c.Logger.fatal("addEventListener侦听函数不能为空");
  481. e ? (this._captureEventsMap || (this._captureEventsMap = {}), e = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), e = this._eventsMap);
  482. var g = e[a];
  483. g || (g = e[a] = []);
  484. this._insertEventBin(g, d, b, f)
  485. };
  486. b.prototype._insertEventBin = function(a, d, b, c, e) {
  487. void 0 === e && (e = void 0);
  488. for (var f = -1, h = a.length, k = 0; k < h; k++) {
  489. var l = a[k];
  490. if (l.listener === d && l.thisObject === b && l.display === e) return !1; - 1 == f && l.priority < c && (f = k)
  491. }
  492. d = {
  493. listener: d,
  494. thisObject: b,
  495. priority: c
  496. };
  497. e && (d.display = e); - 1 != f ? a.splice(f, 0, d) : a.push(d);
  498. return !0
  499. };
  500. b.prototype.removeEventListener = function(a, d, b, c) {
  501. void 0 === c && (c = !1);
  502. if (c = c ? this._captureEventsMap : this._eventsMap) {
  503. var e = c[a];
  504. e && (this._removeEventBin(e, d, b), 0 == e.length && delete c[a])
  505. }
  506. };
  507. b.prototype._removeEventBin = function(a, d, b, c) {
  508. void 0 === c && (c = void 0);
  509. for (var e = a.length, f = 0; f < e; f++) {
  510. var h = a[f];
  511. if (h.listener === d && h.thisObject === b && h.display === c) return a.splice(f, 1), !0
  512. }
  513. return !1
  514. };
  515. b.prototype.hasEventListener = function(a) {
  516. return this._eventsMap && this._eventsMap[a] || this._captureEventsMap && this._captureEventsMap[a]
  517. };
  518. b.prototype.willTrigger = function(a) {
  519. return this.hasEventListener(a)
  520. };
  521. b.prototype.dispatchEvent = function(a) {
  522. a._reset();
  523. a._target = this._eventTarget;
  524. a._currentTarget = this._eventTarget;
  525. return this._notifyListener(a)
  526. };
  527. b.prototype._notifyListener = function(a) {
  528. var d = 1 == a._eventPhase ? this._captureEventsMap : this._eventsMap;
  529. if (!d) return !0;
  530. d = d[a._type];
  531. if (!d) return !0;
  532. var b = d.length;
  533. if (0 == b) return !0;
  534. for (var d = d.concat(), c = 0; c < b; c++) {
  535. var e = d[c];
  536. e.listener.call(e.thisObject, a);
  537. if (a._isPropagationImmediateStopped) break
  538. }
  539. return !a._isDefaultPrevented
  540. };
  541. b.prototype.dispatchEventWith = function(a, d, b) {
  542. void 0 === d && (d = !1);
  543. c.Event.dispatchEvent(this, a, d, b)
  544. };
  545. return b
  546. }(c.HashObject);
  547. c.EventDispatcher = e;
  548. e.prototype.__class__ = "egret.EventDispatcher"
  549. })(egret || (egret = {}));
  550. __extends = this.__extends || function(c, e) {
  551. function f() {
  552. this.constructor = c
  553. }
  554. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  555. f.prototype = e.prototype;
  556. c.prototype = new f
  557. };
  558. (function(c) {
  559. var e = function(e) {
  560. function b() {
  561. e.call(this);
  562. this.reuseEvent = new c.Event("")
  563. }
  564. __extends(b, e);
  565. b.prototype.run = function() {
  566. c.Ticker.getInstance().run();
  567. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  568. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  569. this.touchContext.run()
  570. };
  571. b.prototype.renderLoop = function(a) {
  572. if (0 < c.__callLaterFunctionList.length) {
  573. var d = c.__callLaterFunctionList;
  574. c.__callLaterFunctionList = [];
  575. var s = c.__callLaterThisList;
  576. c.__callLaterThisList = [];
  577. var e = c.__callLaterArgsList;
  578. c.__callLaterArgsList = []
  579. }
  580. a = this.stage;
  581. var f = b.cachedEvent;
  582. f._type = c.Event.RENDER;
  583. this.dispatchEvent(f);
  584. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  585. d && this.doCallLaterList(d, s, e);
  586. 0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
  587. d = this.rendererContext;
  588. d.onRenderStart();
  589. d.clearScreen();
  590. a._updateTransform();
  591. f._type = c.Event.FINISH_UPDATE_TRANSFORM;
  592. this.dispatchEvent(f);
  593. a._draw(d);
  594. f._type = c.Event.FINISH_RENDER;
  595. this.dispatchEvent(f);
  596. d.onRenderFinish()
  597. };
  598. b.prototype.broadcastEnterFrame = function(a) {
  599. a = this.reuseEvent;
  600. a._type = c.Event.ENTER_FRAME;
  601. this.dispatchEvent(a);
  602. for (var d = c.DisplayObject._enterFrameCallBackList.concat(), b = d.length, e = 0; e < b; e++) {
  603. var f = d[e];
  604. a._target = f.display;
  605. a._currentTarget = f.display;
  606. f.listener.call(f.thisObject, a)
  607. }
  608. d = c.Recycler._callBackList;
  609. for (e = d.length - 1; 0 <= e; e--) d[e]._checkFrame()
  610. };
  611. b.prototype.broadcastRender = function() {
  612. var a = this.reuseEvent;
  613. a._type = c.Event.RENDER;
  614. for (var d = c.DisplayObject._renderCallBackList.concat(), b = d.length, e = 0; e < b; e++) {
  615. var f = d[e],
  616. g = f.display;
  617. a._target = g;
  618. a._currentTarget = g;
  619. f.listener.call(f.thisObject, a)
  620. }
  621. };
  622. b.prototype.doCallLaterList = function(a, d, b) {
  623. for (var c = a.length, e = 0; e < c; e++) {
  624. var f = a[e];
  625. null != f && f.apply(d[e], b[e])
  626. }
  627. };
  628. b.prototype.doCallAsyncList = function() {
  629. var a = c.__callAsyncFunctionList.concat(),
  630. d = c.__callAsyncThisList.concat(),
  631. b = c.__callAsyncArgsList.concat();
  632. c.__callAsyncFunctionList.length = 0;
  633. c.__callAsyncThisList.length = 0;
  634. for (var e = c.__callAsyncArgsList.length = 0; e < a.length; e++) {
  635. var f = a[e];
  636. null != f && f.apply(d[e], b[e])
  637. }
  638. };
  639. b.DEVICE_PC = "web";
  640. b.DEVICE_MOBILE = "native";
  641. b.RUNTIME_HTML5 = "runtime_html5";
  642. b.RUNTIME_NATIVE = "runtime_native";
  643. b.cachedEvent = new c.Event("");
  644. return b
  645. }(c.EventDispatcher);
  646. c.MainContext = e;
  647. e.prototype.__class__ = "egret.MainContext"
  648. })(egret || (egret = {}));
  649. var testDeviceType = function() {
  650. if (!this.navigator) return !0;
  651. var c = navigator.userAgent.toLowerCase();
  652. return -1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  653. }, testRuntimeType = function() {
  654. return this.navigator ? !0 : !1
  655. };
  656. egret.MainContext.instance = new egret.MainContext;
  657. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  658. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  659. delete testDeviceType;
  660. delete testRuntimeType;
  661. (function(c) {
  662. var e = function() {
  663. function e() {
  664. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  665. this._maxDeltaTime = 500;
  666. this._totalDeltaTime = 0
  667. }
  668. e.getInstance = function() {
  669. null == e.instance && (e.instance = new e);
  670. return e.instance
  671. };
  672. e.prototype.run = function() {
  673. c.Ticker.getInstance().register(this.update, this);
  674. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, c.MainContext.instance.stage.addChild(this._txt));
  675. var b = c.MainContext.instance;
  676. b.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  677. b.addEventListener(c.Event.RENDER, this.onStartRender, this);
  678. b.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  679. b.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  680. };
  681. e.prototype.onEnterFrame = function(b) {
  682. this._lastTime = c.getTimer()
  683. };
  684. e.prototype.onStartRender = function(b) {
  685. b = c.getTimer();
  686. this._logicPerformanceCost = b - this._lastTime;
  687. this._lastTime = b
  688. };
  689. e.prototype.onFinishUpdateTransform = function(b) {
  690. b = c.getTimer();
  691. this._updateTransformPerformanceCost = b - this._lastTime;
  692. this._lastTime = b
  693. };
  694. e.prototype.onFinishRender = function(b) {
  695. b = c.getTimer();
  696. this._renderPerformanceCost = b - this._lastTime;
  697. this._lastTime = b
  698. };
  699. e.prototype.update = function(b) {
  700. this._tick++;
  701. this._totalDeltaTime += b;
  702. if (this._totalDeltaTime >= this._maxDeltaTime) {
  703. b = (this._preDrawCount - 1).toString();
  704. var a = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  705. this._txt.text = "draw:" + b + "\ncost:" + a + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  706. this._tick = this._totalDeltaTime = 0
  707. }
  708. this._preDrawCount = 0
  709. };
  710. e.prototype.onDrawImage = function() {
  711. this._preDrawCount++
  712. };
  713. return e
  714. }();
  715. c.Profiler = e;
  716. e.prototype.__class__ = "egret.Profiler"
  717. })(egret || (egret = {}));
  718. __extends = this.__extends || function(c, e) {
  719. function f() {
  720. this.constructor = c
  721. }
  722. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  723. f.prototype = e.prototype;
  724. c.prototype = new f
  725. };
  726. (function(c) {
  727. var e = function(e) {
  728. function b() {
  729. e.apply(this, arguments);
  730. this._timeScale = 1;
  731. this._paused = !1;
  732. this.callBackList = []
  733. }
  734. __extends(b, e);
  735. b.prototype.run = function() {
  736. c.__START_TIME = (new Date).getTime();
  737. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  738. };
  739. b.prototype.update = function(a) {
  740. var d = this.callBackList.concat(),
  741. b = d.length;
  742. a *= this._timeScale;
  743. a *= this._timeScale;
  744. for (var c = 0; c < b; c++) {
  745. var e = d[c];
  746. e.listener.call(e.thisObject, a)
  747. }
  748. };
  749. b.prototype.register = function(a, d, b) {
  750. void 0 === b && (b = 0);
  751. this._insertEventBin(this.callBackList, a, d, b)
  752. };
  753. b.prototype.unregister = function(a, d) {
  754. this._removeEventBin(this.callBackList, a, d)
  755. };
  756. b.prototype.setTimeout = function(a, d, b) {
  757. for (var e = [], f = 3; f < arguments.length; f++) e[f - 3] = arguments[f];
  758. c.Logger.warning("Ticker#setTimeout方法即将废弃,请使用egret.setTimeout");
  759. c.setTimeout.apply(null, [a, d, b].concat(e))
  760. };
  761. b.prototype.setTimeScale = function(a) {
  762. this._timeScale = a
  763. };
  764. b.prototype.getTimeScale = function() {
  765. return this._timeScale
  766. };
  767. b.prototype.pause = function() {
  768. this._paused = !0
  769. };
  770. b.prototype.resume = function() {
  771. this._paused = !1
  772. };
  773. b.getInstance = function() {
  774. null == b.instance && (b.instance = new b);
  775. return b.instance
  776. };
  777. return b
  778. }(c.EventDispatcher);
  779. c.Ticker = e;
  780. e.prototype.__class__ = "egret.Ticker"
  781. })(egret || (egret = {}));
  782. (function(c) {
  783. var e = function() {
  784. function c() {}
  785. c.LEFT = "left";
  786. c.RIGHT = "right";
  787. c.CENTER = "center";
  788. c.JUSTIFY = "justify";
  789. c.CONTENT_JUSTIFY = "contentJustify";
  790. return c
  791. }();
  792. c.HorizontalAlign = e;
  793. e.prototype.__class__ = "egret.HorizontalAlign"
  794. })(egret || (egret = {}));
  795. (function(c) {
  796. var e = function() {
  797. function c() {}
  798. c.TOP = "top";
  799. c.BOTTOM = "bottom";
  800. c.MIDDLE = "middle";
  801. c.JUSTIFY = "justify";
  802. c.CONTENT_JUSTIFY = "contentJustify";
  803. return c
  804. }();
  805. c.VerticalAlign = e;
  806. e.prototype.__class__ = "egret.VerticalAlign"
  807. })(egret || (egret = {}));
  808. __extends = this.__extends || function(c, e) {
  809. function f() {
  810. this.constructor = c
  811. }
  812. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  813. f.prototype = e.prototype;
  814. c.prototype = new f
  815. };
  816. (function(c) {
  817. var e = function(e) {
  818. function b(a, d) {
  819. void 0 === d && (d = 0);
  820. e.call(this);
  821. this._currentCount = 0;
  822. this.delay = a;
  823. this.repeatCount = d
  824. }
  825. __extends(b, e);
  826. b.prototype.currentCount = function() {
  827. return this._currentCount
  828. };
  829. Object.defineProperty(b.prototype, "running", {
  830. get: function() {
  831. return this._running
  832. },
  833. enumerable: !0,
  834. configurable: !0
  835. });
  836. b.prototype.reset = function() {
  837. this.stop();
  838. this._currentCount = 0
  839. };
  840. b.prototype.start = function() {
  841. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount = 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  842. };
  843. b.prototype.stop = function() {
  844. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  845. };
  846. b.prototype.onEnterFrame = function(a) {
  847. a = c.getTimer();
  848. a - this.lastTime > this.delay && (this.lastTime = a, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  849. };
  850. return b
  851. }(c.EventDispatcher);
  852. c.Timer = e;
  853. e.prototype.__class__ = "egret.Timer"
  854. })(egret || (egret = {}));
  855. (function(c) {
  856. function e(c) {
  857. c = c.prototype ? c.prototype : Object.getPrototypeOf(c);
  858. if (c.hasOwnProperty("__class__")) return c.__class__;
  859. var b = c.constructor.toString(),
  860. a = b.indexOf("("),
  861. b = b.substring(9, a);
  862. Object.defineProperty(c, "__class__", {
  863. value: b,
  864. enumerable: !1,
  865. writable: !0
  866. });
  867. return b
  868. }
  869. c.getQualifiedClassName = e;
  870. c.getQualifiedSuperclassName = function(c) {
  871. c = c.prototype ? c.prototype : Object.getPrototypeOf(c);
  872. if (c.hasOwnProperty("__superclass__")) return c.__superclass__;
  873. var b = Object.getPrototypeOf(c);
  874. if (null == b) return null;
  875. b = e(b.constructor);
  876. if (!b) return null;
  877. Object.defineProperty(c, "__superclass__", {
  878. value: b,
  879. enumerable: !1,
  880. writable: !0
  881. });
  882. return b
  883. }
  884. })(egret || (egret = {}));
  885. (function(c) {
  886. var e = {};
  887. c.getDefinitionByName = function(c) {
  888. if (!c) return null;
  889. var b = e[c];
  890. if (b) return b;
  891. for (var a = c.split("."), d = a.length, b = __global, s = 0; s < d; s++)
  892. if (b = b[a[s]], !b) return null;
  893. return e[c] = b
  894. }
  895. })(egret || (egret = {}));
  896. var __global = __global || this;
  897. (function(c) {
  898. function e(a) {
  899. for (var d in f) {
  900. var b = f[d];
  901. b.delay -= a;
  902. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete f[d])
  903. }
  904. }
  905. var f = {}, b = 0;
  906. c.setTimeout = function(a, d, s) {
  907. for (var x = [], q = 3; q < arguments.length; q++) x[q - 3] = arguments[q];
  908. x = {
  909. listener: a,
  910. thisObject: d,
  911. delay: s,
  912. params: x
  913. };
  914. 0 == b && c.Ticker.getInstance().register(e, null);
  915. b++;
  916. f[b] = x;
  917. return b
  918. };
  919. c.clearTimeout = function(a) {
  920. delete f[a]
  921. }
  922. })(egret || (egret = {}));
  923. (function(c) {
  924. c.hasDefinition = function(e) {
  925. return c.getDefinitionByName(e) ? !0 : !1
  926. }
  927. })(egret || (egret = {}));
  928. (function(c) {
  929. c.toColorString = function(c) {
  930. if (isNaN(c) || 0 > c) c = 0;
  931. 16777215 < c && (c = 16777215);
  932. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  933. return "#" + c
  934. }
  935. })(egret || (egret = {}));
  936. __extends = this.__extends || function(c, e) {
  937. function f() {
  938. this.constructor = c
  939. }
  940. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  941. f.prototype = e.prototype;
  942. c.prototype = new f
  943. };
  944. (function(c) {
  945. var e = function(e) {
  946. function b(a, d, b, c, q, g) {
  947. void 0 === a && (a = 1);
  948. void 0 === d && (d = 0);
  949. void 0 === b && (b = 0);
  950. void 0 === c && (c = 1);
  951. void 0 === q && (q = 0);
  952. void 0 === g && (g = 0);
  953. e.call(this);
  954. this.a = a;
  955. this.b = d;
  956. this.c = b;
  957. this.d = c;
  958. this.tx = q;
  959. this.ty = g
  960. }
  961. __extends(b, e);
  962. b.prototype.prepend = function(a, d, b, c, e, f) {
  963. var h = this.tx;
  964. if (1 != a || 0 != d || 0 != b || 1 != c) {
  965. var k = this.a,
  966. l = this.c;
  967. this.a = k * a + this.b * b;
  968. this.b = k * d + this.b * c;
  969. this.c = l * a + this.d * b;
  970. this.d = l * d + this.d * c
  971. }
  972. this.tx = h * a + this.ty * b + e;
  973. this.ty = h * d + this.ty * c + f;
  974. return this
  975. };
  976. b.prototype.append = function(a, d, b, c, e, f) {
  977. var h = this.a,
  978. k = this.b,
  979. l = this.c,
  980. m = this.d;
  981. if (1 != a || 0 != d || 0 != b || 1 != c) this.a = a * h + d * l, this.b = a * k + d * m, this.c = b * h + c * l, this.d = b * k + c * m;
  982. this.tx = e * h + f * l + this.tx;
  983. this.ty = e * k + f * m + this.ty;
  984. return this
  985. };
  986. b.prototype.prependTransform = function(a, d, b, e, f, g, h, k, l) {
  987. if (f % 360) {
  988. var m = c.NumberUtils.cos(f);
  989. f = c.NumberUtils.sin(f)
  990. } else m = 1, f = 0; if (k || l) this.tx -= k, this.ty -= l;
  991. g || h ? (this.prepend(m * b, f * b, -f * e, m * e, 0, 0), this.prepend(c.NumberUtils.cos(h), c.NumberUtils.sin(h), -c.NumberUtils.sin(g), c.NumberUtils.cos(g), a, d)) : this.prepend(m * b, f * b, -f * e, m * e, a, d);
  992. return this
  993. };
  994. b.prototype.appendTransform = function(a, d, b, e, f, g, h, k, l) {
  995. if (f % 360) {
  996. var m = c.NumberUtils.cos(f);
  997. f = c.NumberUtils.sin(f)
  998. } else m = 1, f = 0;
  999. g || h ? (this.append(c.NumberUtils.cos(h), c.NumberUtils.sin(h), -c.NumberUtils.sin(g), c.NumberUtils.cos(g), a, d), this.append(m * b, f * b, -f * e, m * e, 0, 0)) : this.append(m * b, f * b, -f * e, m * e, a, d);
  1000. if (k || l) this.tx -= k * this.a + l * this.c, this.ty -= k * this.b + l * this.d;
  1001. return this
  1002. };
  1003. b.prototype.rotate = function(a) {
  1004. var d = Math.cos(a);
  1005. a = Math.sin(a);
  1006. var b = this.a,
  1007. c = this.c,
  1008. e = this.tx;
  1009. this.a = b * d - this.b * a;
  1010. this.b = b * a + this.b * d;
  1011. this.c = c * d - this.d * a;
  1012. this.d = c * a + this.d * d;
  1013. this.tx = e * d - this.ty * a;
  1014. this.ty = e * a + this.ty * d;
  1015. return this
  1016. };
  1017. b.prototype.skew = function(a, d) {
  1018. this.append(c.NumberUtils.cos(d), c.NumberUtils.sin(d), -c.NumberUtils.sin(a), c.NumberUtils.cos(a), 0, 0);
  1019. return this
  1020. };
  1021. b.prototype.scale = function(a, d) {
  1022. this.a *= a;
  1023. this.d *= d;
  1024. this.c *= a;
  1025. this.b *= d;
  1026. this.tx *= a;
  1027. this.ty *= d;
  1028. return this
  1029. };
  1030. b.prototype.translate = function(a, d) {
  1031. this.tx += a;
  1032. this.ty += d;
  1033. return this
  1034. };
  1035. b.prototype.identity = function() {
  1036. this.a = this.d = 1;
  1037. this.b = this.c = this.tx = this.ty = 0;
  1038. return this
  1039. };
  1040. b.prototype.identityMatrix = function(a) {
  1041. this.a = a.a;
  1042. this.b = a.b;
  1043. this.c = a.c;
  1044. this.d = a.d;
  1045. this.tx = a.tx;
  1046. this.ty = a.ty;
  1047. return this
  1048. };
  1049. b.prototype.invert = function() {
  1050. var a = this.a,
  1051. d = this.b,
  1052. b = this.c,
  1053. c = this.d,
  1054. e = this.tx,
  1055. f = a * c - d * b;
  1056. this.a = c / f;
  1057. this.b = -d / f;
  1058. this.c = -b / f;
  1059. this.d = a / f;
  1060. this.tx = (b * this.ty - c * e) / f;
  1061. this.ty = -(a * this.ty - d * e) / f;
  1062. return this
  1063. };
  1064. b.transformCoords = function(a, d, b) {
  1065. var e = c.Point.identity;
  1066. e.x = a.a * d + a.c * b + a.tx;
  1067. e.y = a.d * b + a.b * d + a.ty;
  1068. return e
  1069. };
  1070. b.prototype.toArray = function(a) {
  1071. this.array || (this.array = new Float32Array(9));
  1072. a ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1073. this.array[8] = 1;
  1074. return this.array
  1075. };
  1076. b.identity = new b;
  1077. b.DEG_TO_RAD = Math.PI / 180;
  1078. return b
  1079. }(c.HashObject);
  1080. c.Matrix = e;
  1081. e.prototype.__class__ = "egret.Matrix"
  1082. })(egret || (egret = {}));
  1083. __extends = this.__extends || function(c, e) {
  1084. function f() {
  1085. this.constructor = c
  1086. }
  1087. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1088. f.prototype = e.prototype;
  1089. c.prototype = new f
  1090. };
  1091. (function(c) {
  1092. var e = function(c) {
  1093. function b(a, d) {
  1094. void 0 === a && (a = 0);
  1095. void 0 === d && (d = 0);
  1096. c.call(this);
  1097. this.x = a;
  1098. this.y = d
  1099. }
  1100. __extends(b, c);
  1101. b.prototype.clone = function() {
  1102. return new b(this.x, this.y)
  1103. };
  1104. b.prototype.equals = function(a) {
  1105. return this.x == a.x && this.y == a.y
  1106. };
  1107. b.distance = function(a, d) {
  1108. return Math.sqrt((a.x - d.x) * (a.x - d.x) + (a.y - d.y) * (a.y - d.y))
  1109. };
  1110. b.identity = new b(0, 0);
  1111. return b
  1112. }(c.HashObject);
  1113. c.Point = e;
  1114. e.prototype.__class__ = "egret.Point"
  1115. })(egret || (egret = {}));
  1116. __extends = this.__extends || function(c, e) {
  1117. function f() {
  1118. this.constructor = c
  1119. }
  1120. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1121. f.prototype = e.prototype;
  1122. c.prototype = new f
  1123. };
  1124. (function(c) {
  1125. var e = function(c) {
  1126. function b(a, d, b, e) {
  1127. void 0 === a && (a = 0);
  1128. void 0 === d && (d = 0);
  1129. void 0 === b && (b = 0);
  1130. void 0 === e && (e = 0);
  1131. c.call(this);
  1132. this.x = a;
  1133. this.y = d;
  1134. this.width = b;
  1135. this.height = e
  1136. }
  1137. __extends(b, c);
  1138. Object.defineProperty(b.prototype, "right", {
  1139. get: function() {
  1140. return this.x + this.width
  1141. },
  1142. set: function(a) {
  1143. this.width = a - this.x
  1144. },
  1145. enumerable: !0,
  1146. configurable: !0
  1147. });
  1148. Object.defineProperty(b.prototype, "bottom", {
  1149. get: function() {
  1150. return this.y + this.height
  1151. },
  1152. set: function(a) {
  1153. this.height = a - this.y
  1154. },
  1155. enumerable: !0,
  1156. configurable: !0
  1157. });
  1158. b.prototype.initialize = function(a, d, b, c) {
  1159. this.x = a;
  1160. this.y = d;
  1161. this.width = b;
  1162. this.height = c;
  1163. return this
  1164. };
  1165. b.prototype.contains = function(a, d) {
  1166. return this.x <= a && this.x + this.width >= a && this.y <= d && this.y + this.height >= d
  1167. };
  1168. b.prototype.intersects = function(a) {
  1169. var d = a.right,
  1170. b = a.bottom,
  1171. c = this.right,
  1172. e = this.bottom;
  1173. return this.contains(a.x, a.y) || this.contains(a.x, b) || this.contains(d, a.y) || this.contains(d, b) || a.contains(this.x, this.y) || a.contains(this.x, e) || a.contains(c, this.y) || a.contains(c, e) ? !0 : !1
  1174. };
  1175. b.prototype.clone = function() {
  1176. return new b(this.x, this.y, this.width, this.height)
  1177. };
  1178. b.prototype.containsPoint = function(a) {
  1179. return this.x < a.x && this.x + this.width > a.x && this.y < a.y && this.y + this.height > a.y ? !0 : !1
  1180. };
  1181. b.identity = new b(0, 0, 0, 0);
  1182. return b
  1183. }(c.HashObject);
  1184. c.Rectangle = e;
  1185. e.prototype.__class__ = "egret.Rectangle"
  1186. })(egret || (egret = {}));
  1187. (function(c) {
  1188. var e = function() {
  1189. function e() {}
  1190. e.fatal = function(b, a) {
  1191. void 0 === a && (a = null);
  1192. c.Logger.traceToConsole("Fatal", b, a);
  1193. throw Error(c.Logger.getTraceCode("Fatal", b, a));
  1194. };
  1195. e.info = function(b, a) {
  1196. void 0 === a && (a = null);
  1197. c.Logger.traceToConsole("Info", b, a)
  1198. };
  1199. e.warning = function(b, a) {
  1200. void 0 === a && (a = null);
  1201. c.Logger.traceToConsole("Warning", b, a)
  1202. };
  1203. e.traceToConsole = function(b, a, d) {
  1204. // console.log(c.Logger.getTraceCode(b, a, d))
  1205. };
  1206. e.getTraceCode = function(b, a, d) {
  1207. return "[" + b + "]" + a + ":" + (null == d ? "" : d)
  1208. };
  1209. return e
  1210. }();
  1211. c.Logger = e;
  1212. e.prototype.__class__ = "egret.Logger"
  1213. })(egret || (egret = {}));
  1214. __extends = this.__extends || function(c, e) {
  1215. function f() {
  1216. this.constructor = c
  1217. }
  1218. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1219. f.prototype = e.prototype;
  1220. c.prototype = new f
  1221. };
  1222. (function(c) {
  1223. var e = function(e) {
  1224. function b() {
  1225. e.call(this);
  1226. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1227. this._xmlDict = {};
  1228. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1229. }
  1230. __extends(b, e);
  1231. b.getInstance = function() {
  1232. b._instance || (b._instance = new b);
  1233. return b._instance
  1234. };
  1235. b.prototype.parserXML = function(a) {
  1236. for (var d = 0;
  1237. "\n" == a.charAt(d) || "\t" == a.charAt(d) || "\r" == a.charAt(d) || " " == a.charAt(d);) d++;
  1238. 0 != d && (a = a.substring(d, a.length));
  1239. this._isSupportDOMParser ? d = this._parser.parseFromString(a, "text/xml") : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(a));
  1240. null == d && c.Logger.info("xml not found!");
  1241. return d
  1242. };
  1243. b._instance = null;
  1244. return b
  1245. }(c.HashObject);
  1246. c.SAXParser = e;
  1247. e.prototype.__class__ = "egret.SAXParser"
  1248. })(egret || (egret = {}));
  1249. __extends = this.__extends || function(c, e) {
  1250. function f() {
  1251. this.constructor = c
  1252. }
  1253. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1254. f.prototype = e.prototype;
  1255. c.prototype = new f
  1256. };
  1257. (function(c) {
  1258. var e = function(d) {
  1259. function a() {
  1260. d.call(this);
  1261. this._designHeight = this._designWidth = 0;
  1262. this._scaleY = this._scaleX = 1;
  1263. this._stageHeight = this._stageWidth = this._offSetY = 0
  1264. }
  1265. __extends(a, d);
  1266. a.getInstance = function() {
  1267. null == a.instance && (b.initialize(), a.instance = new a);
  1268. return a.instance
  1269. };
  1270. a.prototype.setDesignSize = function(d, a, b) {
  1271. this._designWidth = d;
  1272. this._designHeight = a;
  1273. b && (c.Logger.warning("该方法目前不应传入 resolutionPolicy 参数,请在 docs/1.0_Final_ReleaseNote中查看如何升级"), this._setResolutionPolicy(b))
  1274. };
  1275. a.prototype._setResolutionPolicy = function(d) {
  1276. this._resolutionPolicy = d;
  1277. d.init(this);
  1278. d._apply(this, this._designWidth, this._designHeight)
  1279. };
  1280. a.prototype.getScaleX = function() {
  1281. return this._scaleX
  1282. };
  1283. a.prototype.getScaleY = function() {
  1284. return this._scaleY
  1285. };
  1286. a.prototype.getOffSetY = function() {
  1287. return this._offSetY
  1288. };
  1289. a.canvas_name = "egretCanvas";
  1290. a.canvas_div_name = "gameDiv";
  1291. return a
  1292. }(c.HashObject);
  1293. c.StageDelegate = e;
  1294. e.prototype.__class__ = "egret.StageDelegate";
  1295. var f = function() {
  1296. function d(a, b) {
  1297. this._containerStrategy = a;
  1298. this._contentStrategy = b
  1299. }
  1300. d.prototype.init = function(d) {
  1301. this._containerStrategy.init(d);
  1302. this._contentStrategy.init(d)
  1303. };
  1304. d.prototype._apply = function(d, a, b) {
  1305. this._containerStrategy._apply(d, a, b);
  1306. this._contentStrategy._apply(d, a, b)
  1307. };
  1308. return d
  1309. }();
  1310. c.ResolutionPolicy = f;
  1311. f.prototype.__class__ = "egret.ResolutionPolicy";
  1312. var b = function() {
  1313. function d() {}
  1314. d.initialize = function() {
  1315. d.EQUAL_TO_FRAME = new a
  1316. };
  1317. d.prototype.init = function(d) {};
  1318. d.prototype._apply = function(d, a, b) {};
  1319. d.prototype._setupContainer = function() {
  1320. var d = document.body,
  1321. a;
  1322. d && (a = d.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1323. };
  1324. return d
  1325. }();
  1326. c.ContainerStrategy = b;
  1327. b.prototype.__class__ = "egret.ContainerStrategy";
  1328. var a = function(d) {
  1329. function a() {
  1330. d.apply(this, arguments)
  1331. }
  1332. __extends(a, d);
  1333. a.prototype._apply = function(d) {
  1334. this._setupContainer()
  1335. };
  1336. return a
  1337. }(b);
  1338. c.EqualToFrame = a;
  1339. a.prototype.__class__ = "egret.EqualToFrame";
  1340. f = function() {
  1341. function d() {}
  1342. d.prototype.init = function(d) {};
  1343. d.prototype._apply = function(d, a, b) {};
  1344. d.prototype.setEgretSize = function(d, a, b, s, f, l) {
  1345. void 0 === l && (l = 0);
  1346. c.StageDelegate.getInstance()._stageWidth = Math.round(d);
  1347. c.StageDelegate.getInstance()._stageHeight = Math.round(a);
  1348. d = document.getElementById(e.canvas_div_name);
  1349. d.style.width = b + "px";
  1350. d.style.height = s + "px";
  1351. d.style.top = l + "px"
  1352. };
  1353. d.prototype._getClientWidth = function() {
  1354. return document.documentElement.clientWidth
  1355. };
  1356. d.prototype._getClientHeight = function() {
  1357. return document.documentElement.clientHeight
  1358. };
  1359. return d
  1360. }();
  1361. c.ContentStrategy = f;
  1362. f.prototype.__class__ = "egret.ContentStrategy";
  1363. var d = function(d) {
  1364. function a(b) {
  1365. void 0 === b && (b = 0);
  1366. d.call(this);
  1367. this.minWidth = b
  1368. }
  1369. __extends(a, d);
  1370. a.prototype._apply = function(d, a, b) {
  1371. a = this._getClientWidth();
  1372. var s = this._getClientHeight(),
  1373. c = s / b,
  1374. e = a / c,
  1375. f = 1;
  1376. 0 != this.minWidth && (f = Math.min(1, e / this.minWidth));
  1377. this.setEgretSize(e / f, b, a, s * f);
  1378. d._scaleX = c * f;
  1379. d._scaleY = c * f
  1380. };
  1381. return a
  1382. }(f);
  1383. c.FixedHeight = d;
  1384. d.prototype.__class__ = "egret.FixedHeight";
  1385. d = function(d) {
  1386. function a(b) {
  1387. void 0 === b && (b = 0);
  1388. d.call(this);
  1389. this.minHeight = b
  1390. }
  1391. __extends(a, d);
  1392. a.prototype._apply = function(d, a, b) {
  1393. b = this._getClientWidth();
  1394. var s = this._getClientHeight(),
  1395. c = b / a,
  1396. e = s / c,
  1397. f = 1;
  1398. 0 != this.minHeight && (f = Math.min(1, e / this.minHeight));
  1399. this.setEgretSize(a, e / f, b * f, s, b * (1 - f) / 2);
  1400. d._scaleX = c * f;
  1401. d._scaleY = c * f
  1402. };
  1403. return a
  1404. }(f);
  1405. c.FixedWidth = d;
  1406. d.prototype.__class__ = "egret.FixedWidth";
  1407. d = function(d) {
  1408. function a(b, c) {
  1409. d.call(this);
  1410. this.width = b;
  1411. this.height = c
  1412. }
  1413. __extends(a, d);
  1414. a.prototype._apply = function(d, a, b) {
  1415. b = this.width;
  1416. var s = this.height,
  1417. c = b / a;
  1418. this.setEgretSize(a, s / c, b, s);
  1419. d._scaleX = c;
  1420. d._scaleY = c
  1421. };
  1422. return a
  1423. }(f);
  1424. c.FixedSize = d;
  1425. d.prototype.__class__ = "egret.FixedSize";
  1426. d = function(d) {
  1427. function a() {
  1428. d.call(this)
  1429. }
  1430. __extends(a, d);
  1431. a.prototype._apply = function(d, a, b) {
  1432. this.setEgretSize(a, b, a, b, Math.floor((a - a) / 2));
  1433. d._scaleX = 1;
  1434. d._scaleY = 1
  1435. };
  1436. return a
  1437. }(f);
  1438. c.NoScale = d;
  1439. d.prototype.__class__ = "egret.NoScale";
  1440. d = function(d) {
  1441. function a() {
  1442. d.call(this)
  1443. }
  1444. __extends(a, d);
  1445. a.prototype._apply = function(d, a, b) {
  1446. var s = this._getClientWidth(),
  1447. c = this._getClientHeight(),
  1448. e = s,
  1449. f = c,
  1450. x = e / a < f / b ? e / a : f / b,
  1451. e = a * x,
  1452. f = b * x,
  1453. s = Math.floor((s - e) / 2);
  1454. d._offSetY = Math.floor((c - f) / 2);
  1455. this.setEgretSize(a, b / 1, 1 * e, f, s, d._offSetY);
  1456. d._scaleX = 1 * x;
  1457. d._scaleY = 1 * x
  1458. };
  1459. return a
  1460. }(f);
  1461. c.ShowAll = d;
  1462. d.prototype.__class__ = "egret.ShowAll";
  1463. f = function(d) {
  1464. function a() {
  1465. d.call(this)
  1466. }
  1467. __extends(a, d);
  1468. a.prototype._apply = function(d, a, b) {
  1469. var s = this._getClientWidth(),
  1470. c = this._getClientHeight(),
  1471. s = s / a,
  1472. c = c / b;
  1473. this.setEgretSize(a, b, a * s, b * c);
  1474. d._scaleX = s;
  1475. d._scaleY = c
  1476. };
  1477. return a
  1478. }(f);
  1479. c.FullScreen = f;
  1480. f.prototype.__class__ = "egret.FullScreen"
  1481. })(egret || (egret = {}));
  1482. __extends = this.__extends || function(c, e) {
  1483. function f() {
  1484. this.constructor = c
  1485. }
  1486. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1487. f.prototype = e.prototype;
  1488. c.prototype = new f
  1489. };
  1490. (function(c) {
  1491. var e = function(e) {
  1492. function b() {
  1493. e.call(this);
  1494. this._originalData = {};
  1495. this._drawAreaList = []
  1496. }
  1497. __extends(b, e);
  1498. b.getInstance = function() {
  1499. null == b.instance && (b.instance = new b);
  1500. return b.instance
  1501. };
  1502. b.prototype.addDrawArea = function(a) {
  1503. this._drawAreaList.push(a)
  1504. };
  1505. b.prototype.clearDrawArea = function() {
  1506. this._drawAreaList = []
  1507. };
  1508. b.prototype.drawImage = function(a, d, b, e, f, g, h, k, l, m, n) {
  1509. void 0 === n && (n = void 0);
  1510. h = h || 0;
  1511. k = k || 0;
  1512. var p = d._texture_to_render;
  1513. if (null != p && 0 != g && 0 != f && 0 != l && 0 != m) {
  1514. var r = c.MainContext.instance.rendererContext.texture_scale_factor;
  1515. f /= r;
  1516. g /= r;
  1517. if (0 != this._drawAreaList.length && c.MainContext.instance.rendererContext._cacheCanvasContext) {
  1518. r = c.DisplayObject.getTransformBounds(d._getSize(c.Rectangle.identity), d._worldTransform);
  1519. d._worldBounds.initialize(r.x, r.y, r.width, r.height);
  1520. r = this._originalData;
  1521. r.sourceX = b;
  1522. r.sourceY = e;
  1523. r.sourceWidth = f;
  1524. r.sourceHeight = g;
  1525. r.destX = h;
  1526. r.destY = k;
  1527. r.destWidth = l;
  1528. r.destHeight = m;
  1529. for (var w = this.getDrawAreaList(), A = 0; A < w.length; A++)
  1530. if (!this.ignoreRender(d, w[A], r.destX, r.destY)) {
  1531. a.drawImage(p, b, e, f, g, h, k, l, m, n);
  1532. break
  1533. }
  1534. } else a.drawImage(p, b, e, f, g, h, k, l, m, n)
  1535. }
  1536. };
  1537. b.prototype.ignoreRender = function(a, d, b, c) {
  1538. var e = a._worldBounds;
  1539. b *= a._worldTransform.a;
  1540. c *= a._worldTransform.d;
  1541. return e.x + e.width + b <= d.x || e.x + b >= d.x + d.width || e.y + e.height + c <= d.y || e.y + c >= d.y + d.height ? !0 : !1
  1542. };
  1543. b.prototype.getDrawAreaList = function() {
  1544. var a;
  1545. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)], c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this)), a = this._defaultDrawAreaList) : a = this._drawAreaList;
  1546. return a
  1547. };
  1548. b.prototype.onResize = function() {
  1549. c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
  1550. this._defaultDrawAreaList = null
  1551. };
  1552. return b
  1553. }(c.HashObject);
  1554. c.RenderFilter = e;
  1555. e.prototype.__class__ = "egret.RenderFilter"
  1556. })(egret || (egret = {}));
  1557. (function(c) {
  1558. var e = function() {
  1559. function e() {}
  1560. e.mapClass = function(b, a, d) {
  1561. void 0 === d && (d = "");
  1562. b = this.getKey(b) + "#" + d;
  1563. this.mapClassDic[b] = a
  1564. };
  1565. e.getKey = function(b) {
  1566. return "string" == typeof b ? b : c.getQualifiedClassName(b)
  1567. };
  1568. e.mapValue = function(b, a, d) {
  1569. void 0 === d && (d = "");
  1570. b = this.getKey(b) + "#" + d;
  1571. this.mapValueDic[b] = a
  1572. };
  1573. e.hasMapRule = function(b, a) {
  1574. void 0 === a && (a = "");
  1575. var d = this.getKey(b) + "#" + a;
  1576. return this.mapValueDic[d] || this.mapClassDic[d] ? !0 : !1
  1577. };
  1578. e.getInstance = function(b, a) {
  1579. void 0 === a && (a = "");
  1580. var d = this.getKey(b) + "#" + a;
  1581. if (this.mapValueDic[d]) return this.mapValueDic[d];
  1582. var c = this.mapClassDic[d];
  1583. if (c) return c = new c, this.mapValueDic[d] = c, delete this.mapClassDic[d], c;
  1584. throw Error("调用了未配置的注入规则:" + d + "。 请先在项目初始化里配置指定的注入规则,再调用对应单例。");
  1585. };
  1586. e.mapClassDic = {};
  1587. e.mapValueDic = {};
  1588. return e
  1589. }();
  1590. c.Injector = e;
  1591. e.prototype.__class__ = "egret.Injector"
  1592. })(egret || (egret = {}));
  1593. (function(c) {
  1594. var e = function() {
  1595. function c() {}
  1596. c.NORMAL = "normal";
  1597. c.ADD = "add";
  1598. return c
  1599. }();
  1600. c.BlendMode = e;
  1601. e.prototype.__class__ = "egret.BlendMode"
  1602. })(egret || (egret = {}));
  1603. __extends = this.__extends || function(c, e) {
  1604. function f() {
  1605. this.constructor = c
  1606. }
  1607. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  1608. f.prototype = e.prototype;
  1609. c.prototype = new f
  1610. };
  1611. (function(c) {
  1612. var e = function(e) {
  1613. function b() {
  1614. e.call(this);
  1615. this.__hack_local_matrix = null;
  1616. this._sizeDirty = this._normalDirty = !0;
  1617. this._parent = this._texture_to_render = null;
  1618. this._y = this._x = 0;
  1619. this._scaleY = this._scaleX = 1;
  1620. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1621. this._visible = !0;
  1622. this._rotation = 0;
  1623. this._alpha = 1;
  1624. this._skewY = this._skewX = 0;
  1625. this._touchEnabled = !1;
  1626. this._scrollRect = this.blendMode = null;
  1627. this._hasHeightSet = this._hasWidthSet = !1;
  1628. this._worldBounds = this.mask = null;
  1629. this.worldAlpha = 1;
  1630. this._rectH = this._rectW = 0;
  1631. this._stage = null;
  1632. this._cacheDirty = this._cacheAsBitmap = !1;
  1633. this._colorTransform = null;
  1634. this._worldTransform = new c.Matrix;
  1635. this._worldBounds = new c.Rectangle(0, 0, 0, 0);
  1636. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1637. }
  1638. __extends(b, e);
  1639. b.prototype._setDirty = function() {
  1640. this._normalDirty = !0
  1641. };
  1642. b.prototype.getDirty = function() {
  1643. return this._normalDirty || this._sizeDirty
  1644. };
  1645. b.prototype._setParentSizeDirty = function() {
  1646. var a = this._parent;
  1647. !a || a._hasWidthSet || a._hasHeightSet || a._setSizeDirty()
  1648. };
  1649. b.prototype._setSizeDirty = function() {
  1650. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1651. };
  1652. b.prototype._clearDirty = function() {
  1653. this._normalDirty = !1
  1654. };
  1655. b.prototype._clearSizeDirty = function() {
  1656. this._sizeDirty = !1
  1657. };
  1658. Object.defineProperty(b.prototype, "parent", {
  1659. get: function() {
  1660. return this._parent
  1661. },
  1662. enumerable: !0,
  1663. configurable: !0
  1664. });
  1665. b.prototype._parentChanged = function(a) {
  1666. this._parent = a
  1667. };
  1668. Object.defineProperty(b.prototype, "x", {
  1669. get: function() {
  1670. return this._x
  1671. },
  1672. set: function(a) {
  1673. this._setX(a)
  1674. },
  1675. enumerable: !0,
  1676. configurable: !0
  1677. });
  1678. b.prototype._setX = function(a) {
  1679. c.NumberUtils.isNumber(a) && this._x != a && (this._x = a, this._setDirty(), this._setParentSizeDirty())
  1680. };
  1681. Object.defineProperty(b.prototype, "y", {
  1682. get: function() {
  1683. return this._y
  1684. },
  1685. set: function(a) {
  1686. this._setY(a)
  1687. },
  1688. enumerable: !0,
  1689. configurable: !0
  1690. });
  1691. b.prototype._setY = function(a) {
  1692. c.NumberUtils.isNumber(a) && this._y != a && (this._y = a, this._setDirty(), this._setParentSizeDirty())
  1693. };
  1694. Object.defineProperty(b.prototype, "scaleX", {
  1695. get: function() {
  1696. return this._scaleX
  1697. },
  1698. set: function(a) {
  1699. c.NumberUtils.isNumber(a) && this._scaleX != a && (this._scaleX = a, this._setDirty(), this._setParentSizeDirty())
  1700. },
  1701. enumerable: !0,
  1702. configurable: !0
  1703. });
  1704. Object.defineProperty(b.prototype, "scaleY", {
  1705. get: function() {
  1706. return this._scaleY
  1707. },
  1708. set: function(a) {
  1709. c.NumberUtils.isNumber(a) && this._scaleY != a && (this._scaleY = a, this._setDirty(), this._setParentSizeDirty())
  1710. },
  1711. enumerable: !0,
  1712. configurable: !0
  1713. });
  1714. Object.defineProperty(b.prototype, "anchorOffsetX", {
  1715. get: function() {
  1716. return this._anchorOffsetX
  1717. },
  1718. set: function(a) {
  1719. c.NumberUtils.isNumber(a) && this._anchorOffsetX != a && (this._anchorOffsetX = a, this._setDirty(), this._setParentSizeDirty())
  1720. },
  1721. enumerable: !0,
  1722. configurable: !0
  1723. });
  1724. Object.defineProperty(b.prototype, "anchorOffsetY", {
  1725. get: function() {
  1726. return this._anchorOffsetY
  1727. },
  1728. set: function(a) {
  1729. c.NumberUtils.isNumber(a) && this._anchorOffsetY != a && (this._anchorOffsetY = a, this._setDirty(), this._setParentSizeDirty())
  1730. },
  1731. enumerable: !0,
  1732. configurable: !0
  1733. });
  1734. Object.defineProperty(b.prototype, "anchorX", {
  1735. get: function() {
  1736. return this._anchorX
  1737. },
  1738. set: function(a) {
  1739. this._setAnchorX(a)
  1740. },
  1741. enumerable: !0,
  1742. configurable: !0
  1743. });
  1744. b.prototype._setAnchorX = function(a) {
  1745. c.NumberUtils.isNumber(a) && this._anchorX != a && (this._anchorX = a, this._setDirty(), this._setParentSizeDirty())
  1746. };
  1747. Object.defineProperty(b.prototype, "anchorY", {
  1748. get: function() {
  1749. return this._anchorY
  1750. },
  1751. set: function(a) {
  1752. this._setAnchorY(a)
  1753. },
  1754. enumerable: !0,
  1755. configurable: !0
  1756. });
  1757. b.prototype._setAnchorY = function(a) {
  1758. c.NumberUtils.isNumber(a) && this._anchorY != a && (this._anchorY = a, this._setDirty(), this._setParentSizeDirty())
  1759. };
  1760. Object.defineProperty(b.prototype, "visible", {
  1761. get: function() {
  1762. return this._visible
  1763. },
  1764. set: function(a) {
  1765. this._setVisible(a)
  1766. },
  1767. enumerable: !0,
  1768. configurable: !0
  1769. });
  1770. b.prototype._setVisible = function(a) {
  1771. this._visible != a && (this._visible = a, this._setSizeDirty())
  1772. };
  1773. Object.defineProperty(b.prototype, "rotation", {
  1774. get: function() {
  1775. return this._rotation
  1776. },
  1777. set: function(a) {
  1778. c.NumberUtils.isNumber(a) && this._rotation != a && (this._rotation = a, this._setSizeDirty())
  1779. },
  1780. enumerable: !0,
  1781. configurable: !0
  1782. });
  1783. Object.defineProperty(b.prototype, "alpha", {
  1784. get: function() {
  1785. return this._alpha
  1786. },
  1787. set: function(a) {
  1788. c.NumberUtils.isNumber(a) && this._alpha != a && (this._alpha = a, this._setDirty(), this._setCacheDirty())
  1789. },
  1790. enumerable: !0,
  1791. configurable: !0
  1792. });
  1793. Object.defineProperty(b.prototype, "skewX", {
  1794. get: function() {
  1795. return this._skewX
  1796. },
  1797. set: function(a) {
  1798. c.NumberUtils.isNumber(a) && this._skewX != a && (this._skewX = a, this._setSizeDirty())
  1799. },
  1800. enumerable: !0,
  1801. configurable: !0
  1802. });
  1803. Object.defineProperty(b.prototype, "skewY", {
  1804. get: function() {
  1805. return this._skewY
  1806. },
  1807. set: function(a) {
  1808. c.NumberUtils.isNumber(a) && this._skewY != a && (this._skewY = a, this._setSizeDirty())
  1809. },
  1810. enumerable: !0,
  1811. configurable: !0
  1812. });
  1813. Object.defineProperty(b.prototype, "touchEnabled", {
  1814. get: function() {
  1815. return this._touchEnabled
  1816. },
  1817. set: function(a) {
  1818. this._setTouchEnabled(a)
  1819. },
  1820. enumerable: !0,
  1821. configurable: !0
  1822. });
  1823. b.prototype._setTouchEnabled = function(a) {
  1824. this._touchEnabled = a
  1825. };
  1826. Object.defineProperty(b.prototype, "scrollRect", {
  1827. get: function() {
  1828. return this._scrollRect
  1829. },
  1830. set: function(a) {
  1831. this._setScrollRect(a)
  1832. },
  1833. enumerable: !0,
  1834. configurable: !0
  1835. });
  1836. b.prototype._setScrollRect = function(a) {
  1837. this._scrollRect = a;
  1838. this._setSizeDirty()
  1839. };
  1840. Object.defineProperty(b.prototype, "measuredWidth", {
  1841. get: function() {
  1842. return this._measureBounds().width
  1843. },
  1844. enumerable: !0,
  1845. configurable: !0
  1846. });
  1847. Object.defineProperty(b.prototype, "measuredHeight", {
  1848. get: function() {
  1849. return this._measureBounds().height
  1850. },
  1851. enumerable: !0,
  1852. configurable: !0
  1853. });
  1854. Object.defineProperty(b.prototype, "explicitWidth", {
  1855. get: function() {
  1856. return this._explicitWidth
  1857. },
  1858. enumerable: !0,
  1859. configurable: !0
  1860. });
  1861. Object.defineProperty(b.prototype, "explicitHeight", {
  1862. get: function() {
  1863. return this._explicitHeight
  1864. },
  1865. enumerable: !0,
  1866. configurable: !0
  1867. });
  1868. Object.defineProperty(b.prototype, "width", {
  1869. get: function() {
  1870. return this._getSize(c.Rectangle.identity).width
  1871. },
  1872. set: function(a) {
  1873. this._setWidth(a)
  1874. },
  1875. enumerable: !0,
  1876. configurable: !0
  1877. });
  1878. Object.defineProperty(b.prototype, "height", {
  1879. get: function() {
  1880. return this._getSize(c.Rectangle.identity).height
  1881. },
  1882. set: function(a) {
  1883. this._setHeight(a)
  1884. },
  1885. enumerable: !0,
  1886. configurable: !0
  1887. });
  1888. b.prototype._setWidth = function(a) {
  1889. this._setSizeDirty();
  1890. this._setCacheDirty();
  1891. this._explicitWidth = a;
  1892. this._hasWidthSet = c.NumberUtils.isNumber(a)
  1893. };
  1894. b.prototype._setHeight = function(a) {
  1895. this._setSizeDirty();
  1896. this._setCacheDirty();
  1897. this._explicitHeight = a;
  1898. this._hasHeightSet = c.NumberUtils.isNumber(a)
  1899. };
  1900. b.prototype._draw = function(a) {
  1901. if (this._visible && !this.drawCacheTexture(a)) {
  1902. this._colorTransform && a.setGlobalColorTransform(this._colorTransform.matrix);
  1903. a.setAlpha(this.worldAlpha, this.blendMode);
  1904. a.setTransform(this._worldTransform);
  1905. var d = this.mask || this._scrollRect;
  1906. d && a.pushMask(d);
  1907. this._render(a);
  1908. d && a.popMask();
  1909. this._colorTransform && a.setGlobalColorTransform(null)
  1910. }
  1911. this.destroyCacheBounds()
  1912. };
  1913. b.prototype.drawCacheTexture = function(a) {
  1914. if (!1 == this._cacheAsBitmap) return !1;
  1915. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight)) this._cacheDirty = !this._makeBitmapCache();
  1916. if (null == this._texture_to_render) return !1;
  1917. var d = this._texture_to_render,
  1918. b = d._offsetX,
  1919. e = d._offsetY,
  1920. f = d._textureWidth,
  1921. d = d._textureHeight;
  1922. this._updateTransform();
  1923. a.setAlpha(this.worldAlpha, this.blendMode);
  1924. a.setTransform(this._worldTransform);
  1925. var g = c.MainContext.instance.rendererContext.texture_scale_factor;
  1926. c.RenderFilter.getInstance().drawImage(a, this, 0, 0, f * g, d * g, b, e, f, d);
  1927. return !0
  1928. };
  1929. b.prototype._updateTransform = function() {
  1930. this._calculateWorldTransform()
  1931. };
  1932. b.prototype._calculateWorldTransform = function() {
  1933. var a = this._worldTransform,
  1934. d = this._parent;
  1935. a.identityMatrix(d._worldTransform);
  1936. this._getMatrix(a);
  1937. var b = this._scrollRect;
  1938. b && a.append(1, 0, 0, 1, -b.x, -b.y);
  1939. this.worldAlpha = d.worldAlpha * this._alpha
  1940. };
  1941. b.prototype._render = function(a) {};
  1942. b.prototype.getBounds = function(a, d) {
  1943. void 0 === d && (d = !0);
  1944. var b = this._measureBounds(),
  1945. e = this._hasWidthSet ? this._explicitWidth : b.width,
  1946. f = this._hasHeightSet ? this._explicitHeight : b.height;
  1947. this._rectW = b.width;
  1948. this._rectH = b.height;
  1949. this._clearSizeDirty();
  1950. var g = b.x,
  1951. b = b.y,
  1952. h = 0,
  1953. k = 0;
  1954. d && (0 != this._anchorX || 0 != this._anchorY ? (h = e * this._anchorX, k = f * this._anchorY) : (h = this._anchorOffsetX, k = this._anchorOffsetY));
  1955. this._cacheBounds.initialize(g - h, b - k, e, f);
  1956. e = this._cacheBounds;
  1957. a || (a = new c.Rectangle);
  1958. return a.initialize(e.x, e.y, e.width, e.height)
  1959. };
  1960. b.prototype.destroyCacheBounds = function() {
  1961. this._cacheBounds.x = 0;
  1962. this._cacheBounds.y = 0;
  1963. this._cacheBounds.width = 0;
  1964. this._cacheBounds.height = 0
  1965. };
  1966. b.prototype._getConcatenatedMatrix = function() {
  1967. for (var a = b.identityMatrixForGetConcatenated.identity(), d = this; null != d;) {
  1968. if (0 != d._anchorX || 0 != d._anchorY) {
  1969. var s = d._getSize(c.Rectangle.identity);
  1970. a.prependTransform(d._x, d._y, d._scaleX, d._scaleY, d._rotation, d._skewX, d._skewY, s.width * d._anchorX, s.height * d._anchorY)
  1971. } else a.prependTransform(d._x, d._y, d._scaleX, d._scaleY, d._rotation, d._skewX, d._skewY, d._anchorOffsetX, d._anchorOffsetY);
  1972. d._scrollRect && a.prepend(1, 0, 0, 1, -d._scrollRect.x, -d._scrollRect.y);
  1973. d = d._parent
  1974. }
  1975. return a
  1976. };
  1977. b.prototype.localToGlobal = function(a, d, b) {
  1978. void 0 === a && (a = 0);
  1979. void 0 === d && (d = 0);
  1980. var e = this._getConcatenatedMatrix();
  1981. e.append(1, 0, 0, 1, a, d);
  1982. b || (b = new c.Point);
  1983. b.x = e.tx;
  1984. b.y = e.ty;
  1985. return b
  1986. };
  1987. b.prototype.globalToLocal = function(a, d, b) {
  1988. void 0 === a && (a = 0);
  1989. void 0 === d && (d = 0);
  1990. var e = this._getConcatenatedMatrix();
  1991. e.invert();
  1992. e.append(1, 0, 0, 1, a, d);
  1993. b || (b = new c.Point);
  1994. b.x = e.tx;
  1995. b.y = e.ty;
  1996. return b
  1997. };
  1998. b.prototype.hitTest = function(a, d, b) {
  1999. void 0 === b && (b = !1);
  2000. if (!this._visible || !b && !this._touchEnabled) return null;
  2001. b = this._getSize(c.Rectangle.identity);
  2002. return 0 <= a && a < b.width && 0 <= d && d < b.height ? this.mask || this._scrollRect ? this._scrollRect && a > this._scrollRect.x && d > this._scrollRect.y && a < this._scrollRect.x + this._scrollRect.width && d < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= a && a < this.mask.x + this.mask.width && this.mask.y <= d && d < this.mask.y + this.mask.height ? this : null : this : null
  2003. };
  2004. b.prototype.hitTestPoint = function(a, d, b) {
  2005. a = this.globalToLocal(a, d);
  2006. return b ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), b = this._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(a.x - this._hitTestPointTexture._offsetX, a.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !! this.hitTest(a.x, a.y, !0)
  2007. };
  2008. b.prototype._getMatrix = function(a) {
  2009. a || (a = c.Matrix.identity.identity());
  2010. var d, b;
  2011. b = this._getOffsetPoint();
  2012. d = b.x;
  2013. b = b.y;
  2014. var e = this.__hack_local_matrix;
  2015. e ? (a.append(e.a, e.b, e.c, e.d, e.tx, e.ty), a.append(1, 0, 0, 1, -d, -b)) : a.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, d, b);
  2016. return a
  2017. };
  2018. b.prototype._getSize = function(a) {
  2019. return this._hasHeightSet && this._hasWidthSet ? a.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(a)
  2020. };
  2021. b.prototype._measureSize = function(a) {
  2022. this._sizeDirty ? (a = this._measureBounds(), this._rectW = a.width, this._rectH = a.height, this._clearSizeDirty()) : (a.width = this._rectW, a.height = this._rectH);
  2023. a.x = 0;
  2024. a.y = 0;
  2025. return a
  2026. };
  2027. b.prototype._measureBounds = function() {
  2028. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  2029. };
  2030. b.prototype._getOffsetPoint = function() {
  2031. var a = this._anchorOffsetX,
  2032. d = this._anchorOffsetY;
  2033. if (0 != this._anchorX || 0 != this._anchorY) d = this._getSize(c.Rectangle.identity), a = this._anchorX * d.width, d = this._anchorY * d.height;
  2034. var b = c.Point.identity;
  2035. b.x = a;
  2036. b.y = d;
  2037. return b
  2038. };
  2039. b.prototype._onAddToStage = function() {
  2040. this._stage = c.MainContext.instance.stage;
  2041. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2042. };
  2043. b.prototype._onRemoveFromStage = function() {
  2044. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2045. };
  2046. Object.defineProperty(b.prototype, "stage", {
  2047. get: function() {
  2048. return this._stage
  2049. },
  2050. enumerable: !0,
  2051. configurable: !0
  2052. });
  2053. b.prototype.addEventListener = function(a, d, s, x, q) {
  2054. void 0 === x && (x = !1);
  2055. void 0 === q && (q = 0);
  2056. e.prototype.addEventListener.call(this, a, d, s, x, q);
  2057. ((x = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._insertEventBin(x ? b._enterFrameCallBackList : b._renderCallBackList, d, s, q, this)
  2058. };
  2059. b.prototype.removeEventListener = function(a, d, s, x) {
  2060. void 0 === x && (x = !1);
  2061. e.prototype.removeEventListener.call(this, a, d, s, x);
  2062. ((x = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._removeEventBin(x ? b._enterFrameCallBackList : b._renderCallBackList, d, s, this)
  2063. };
  2064. b.prototype.dispatchEvent = function(a) {
  2065. if (!a._bubbles) return e.prototype.dispatchEvent.call(this, a);
  2066. for (var d = [], b = this; b;) d.push(b), b = b._parent;
  2067. a._reset();
  2068. this._dispatchPropagationEvent(a, d);
  2069. return !a._isDefaultPrevented
  2070. };
  2071. b.prototype._dispatchPropagationEvent = function(a, d, b) {
  2072. b = d.length;
  2073. for (var c = 1, e = b - 1; 0 <= e; e--) {
  2074. var f = d[e];
  2075. a._currentTarget = f;
  2076. a._target = this;
  2077. a._eventPhase = c;
  2078. f._notifyListener(a);
  2079. if (a._isPropagationStopped || a._isPropagationImmediateStopped) return
  2080. }
  2081. f = d[0];
  2082. a._currentTarget = f;
  2083. a._target = this;
  2084. a._eventPhase = 2;
  2085. f._notifyListener(a);
  2086. if (!a._isPropagationStopped && !a._isPropagationImmediateStopped)
  2087. for (c = 3, e = 1; e < b && (f = d[e], a._currentTarget = f, a._target = this, a._eventPhase = c, f._notifyListener(a), !a._isPropagationStopped && !a._isPropagationImmediateStopped); e++);
  2088. };
  2089. b.prototype.willTrigger = function(a) {
  2090. for (var d = this; d;) {
  2091. if (d.hasEventListener(a)) return !0;
  2092. d = d._parent
  2093. }
  2094. return !1
  2095. };
  2096. Object.defineProperty(b.prototype, "cacheAsBitmap", {
  2097. get: function() {
  2098. return this._cacheAsBitmap
  2099. },
  2100. set: function(a) {
  2101. (this._cacheAsBitmap = a) ? c.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2102. },
  2103. enumerable: !0,
  2104. configurable: !0
  2105. });
  2106. b.prototype._makeBitmapCache = function() {
  2107. this.renderTexture || (this.renderTexture = new c.RenderTexture);
  2108. var a = this.renderTexture.drawToTexture(this);
  2109. this._texture_to_render = a ? this.renderTexture : null;
  2110. return a
  2111. };
  2112. b.prototype._setCacheDirty = function(a) {
  2113. void 0 === a && (a = !0);
  2114. this._cacheDirty = a
  2115. };
  2116. b.getTransformBounds = function(a, d) {
  2117. var b = a.x,
  2118. c = a.y,
  2119. e = a.width,
  2120. f = a.height;
  2121. (b || c) && d.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2122. var h = e * d.a,
  2123. e = e * d.b,
  2124. k = f * d.c,
  2125. f = f * d.d,
  2126. l = d.tx,
  2127. m = d.ty,
  2128. n = l,
  2129. p = l,
  2130. r = m,
  2131. w = m;
  2132. (b = h + l) < n ? n = b : b > p && (p = b);
  2133. (b = h + k + l) < n ? n = b : b > p && (p = b);
  2134. (b = k + l) < n ? n = b : b > p && (p = b);
  2135. (c = e + m) < r ? r = c : c > w && (w = c);
  2136. (c = e + f + m) < r ? r = c : c > w && (w = c);
  2137. (c = f + m) < r ? r = c : c > w && (w = c);
  2138. return a.initialize(n, r, p - n, w - r)
  2139. };
  2140. Object.defineProperty(b.prototype, "colorTransform", {
  2141. get: function() {
  2142. return this._colorTransform
  2143. },
  2144. set: function(a) {
  2145. this._colorTransform = a
  2146. },
  2147. enumerable: !0,
  2148. configurable: !0
  2149. });
  2150. b.identityMatrixForGetConcatenated = new c.Matrix;
  2151. b._enterFrameCallBackList = [];
  2152. b._renderCallBackList = [];
  2153. return b
  2154. }(c.EventDispatcher);
  2155. c.DisplayObject = e;
  2156. e.prototype.__class__ = "egret.DisplayObject";
  2157. e = function() {
  2158. function c() {
  2159. this.matrix = null
  2160. }
  2161. c.prototype.updateColor = function(b, a, d, c, e, f, g, h) {};
  2162. return c
  2163. }();
  2164. c.ColorTransform = e;
  2165. e.prototype.__class__ = "egret.ColorTransform"
  2166. })(egret || (egret = {}));
  2167. __extends = this.__extends || function(c, e) {
  2168. function f() {
  2169. this.constructor = c
  2170. }
  2171. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  2172. f.prototype = e.prototype;
  2173. c.prototype = new f
  2174. };
  2175. (function(c) {
  2176. var e = function(e) {
  2177. function b() {
  2178. e.call(this);
  2179. this._touchChildren = !0;
  2180. this._children = []
  2181. }
  2182. __extends(b, e);
  2183. Object.defineProperty(b.prototype, "touchChildren", {
  2184. get: function() {
  2185. return this._touchChildren
  2186. },
  2187. set: function(a) {
  2188. this._touchChildren = a
  2189. },
  2190. enumerable: !0,
  2191. configurable: !0
  2192. });
  2193. Object.defineProperty(b.prototype, "numChildren", {
  2194. get: function() {
  2195. return this._children.length
  2196. },
  2197. enumerable: !0,
  2198. configurable: !0
  2199. });
  2200. b.prototype.setChildIndex = function(a, d) {
  2201. this.doSetChildIndex(a, d)
  2202. };
  2203. b.prototype.doSetChildIndex = function(a, d) {
  2204. var b = this._children.indexOf(a);
  2205. 0 > b && c.Logger.fatal("child不在当前容器内");
  2206. this._children.splice(b, 1);
  2207. 0 > d || this._children.length <= d ? this._children.push(a) : this._children.splice(d, 0, a)
  2208. };
  2209. b.prototype.addChild = function(a) {
  2210. var d = this._children.length;
  2211. a._parent == this && d--;
  2212. return this._doAddChild(a, d)
  2213. };
  2214. b.prototype.addChildAt = function(a, d) {
  2215. return this._doAddChild(a, d)
  2216. };
  2217. b.prototype._doAddChild = function(a, d, s) {
  2218. void 0 === s && (s = !0);
  2219. if (a == this) return a;
  2220. if (0 > d || d > this._children.length) return c.Logger.fatal("提供的索引超出范围"),
  2221. a;
  2222. var e = a._parent;
  2223. if (e == this) return this.doSetChildIndex(a, d), a;
  2224. e && (d = e._children.indexOf(a), 0 <= d && e._doRemoveChild(d));
  2225. this._children.splice(d, 0, a);
  2226. a._parentChanged(this);
  2227. s && a.dispatchEventWith(c.Event.ADDED, !0);
  2228. if (this._stage)
  2229. for (a._onAddToStage(), d = b.__EVENT__ADD_TO_STAGE_LIST; 0 < d.length;) d.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  2230. a._setDirty();
  2231. this._setSizeDirty();
  2232. return a
  2233. };
  2234. b.prototype.removeChild = function(a) {
  2235. a = this._children.indexOf(a);
  2236. if (0 <= a) return this._doRemoveChild(a);
  2237. c.Logger.fatal("child未被addChild到该parent");
  2238. return null
  2239. };
  2240. b.prototype.removeChildAt = function(a) {
  2241. if (0 <= a && a < this._children.length) return this._doRemoveChild(a);
  2242. c.Logger.fatal("提供的索引超出范围");
  2243. return null
  2244. };
  2245. b.prototype._doRemoveChild = function(a, d) {
  2246. void 0 === d && (d = !0);
  2247. var s = this._children,
  2248. e = s[a];
  2249. d && e.dispatchEventWith(c.Event.REMOVED, !0);
  2250. if (this._stage) {
  2251. e._onRemoveFromStage();
  2252. for (var f = b.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) {
  2253. var g = f.shift();
  2254. g.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
  2255. g._stage = null
  2256. }
  2257. }
  2258. e._parentChanged(null);
  2259. s.splice(a, 1);
  2260. this._setSizeDirty();
  2261. return e
  2262. };
  2263. b.prototype.getChildAt = function(a) {
  2264. if (0 <= a && a < this._children.length) return this._children[a];
  2265. c.Logger.fatal("提供的索引超出范围");
  2266. return null
  2267. };
  2268. b.prototype.contains = function(a) {
  2269. for (; a;) {
  2270. if (a == this) return !0;
  2271. a = a._parent
  2272. }
  2273. return !1
  2274. };
  2275. b.prototype.swapChildrenAt = function(a, d) {
  2276. 0 <= a && a < this._children.length && 0 <= d && d < this._children.length ? this._swapChildrenAt(a, d) : c.Logger.fatal("提供的索引超出范围")
  2277. };
  2278. b.prototype.swapChildren = function(a, d) {
  2279. var b = this._children.indexOf(a),
  2280. e = this._children.indexOf(d); - 1 == b || -1 == e ? c.Logger.fatal("child未被addChild到该parent") : this._swapChildrenAt(b, e)
  2281. };
  2282. b.prototype._swapChildrenAt = function(a, d) {
  2283. if (a != d) {
  2284. var b = this._children,
  2285. c = b[a];
  2286. b[a] = b[d];
  2287. b[d] = c
  2288. }
  2289. };
  2290. b.prototype.getChildIndex = function(a) {
  2291. return this._children.indexOf(a)
  2292. };
  2293. b.prototype.removeChildren = function() {
  2294. for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
  2295. };
  2296. b.prototype._updateTransform = function() {
  2297. if (this._visible) {
  2298. e.prototype._updateTransform.call(this);
  2299. for (var a = 0, d = this._children.length; a < d; a++) this._children[a]._updateTransform()
  2300. }
  2301. };
  2302. b.prototype._render = function(a) {
  2303. for (var d = 0, b = this._children.length; d < b; d++) this._children[d]._draw(a)
  2304. };
  2305. b.prototype._measureBounds = function() {
  2306. for (var a = 0, d = 0, b = 0, e = 0, f = this._children.length, g = 0; g < f; g++) {
  2307. var h = this._children[g];
  2308. if (h._visible) {
  2309. var k = h.getBounds(c.Rectangle.identity, !1),
  2310. l = k.x,
  2311. m = k.y,
  2312. n = k.width,
  2313. k = k.height,
  2314. h = h._getMatrix(),
  2315. h = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(l, m, n, k), h),
  2316. l = h.x,
  2317. m = h.y,
  2318. n = h.width + h.x,
  2319. h = h.height + h.y;
  2320. if (l < a || 0 == g) a = l;
  2321. if (n > d || 0 == g) d = n;
  2322. if (m < b || 0 == g) b = m;
  2323. if (h > e || 0 == g) e = h
  2324. }
  2325. }
  2326. return c.Rectangle.identity.initialize(a, b, d - a, e - b)
  2327. };
  2328. b.prototype.hitTest = function(a, d, b) {
  2329. void 0 === b && (b = !1);
  2330. var x;
  2331. if (!this._visible) return null;
  2332. if (this._scrollRect) {
  2333. if (a < this._scrollRect.x || d < this._scrollRect.y || a > this._scrollRect.x + this._scrollRect.width || d > this._scrollRect.y + this._scrollRect.height) return null
  2334. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > d || d > this.mask.y + this.mask.height)) return null;
  2335. for (var q = this._children, g = this._touchChildren, h = q.length - 1; 0 <= h; h--) {
  2336. var k = q[h],
  2337. l = k._getMatrix(),
  2338. m = k._scrollRect;
  2339. m && l.append(1, 0, 0, 1, -m.x, -m.y);
  2340. l.invert();
  2341. l = c.Matrix.transformCoords(l, a, d);
  2342. if (k = k.hitTest(l.x, l.y, !0)) {
  2343. if (!g) return this;
  2344. if (k._touchEnabled && g) return k;
  2345. x = this
  2346. }
  2347. }
  2348. return x ? x : this._texture_to_render || this.graphics ? e.prototype.hitTest.call(this, a, d, b) : null
  2349. };
  2350. b.prototype._onAddToStage = function() {
  2351. e.prototype._onAddToStage.call(this);
  2352. for (var a = this._children.length, d = 0; d < a; d++) this._children[d]._onAddToStage()
  2353. };
  2354. b.prototype._onRemoveFromStage = function() {
  2355. e.prototype._onRemoveFromStage.call(this);
  2356. for (var a = this._children.length, d = 0; d < a; d++) this._children[d]._onRemoveFromStage()
  2357. };
  2358. b.prototype.getChildByName = function(a) {
  2359. for (var d = this._children, b = d.length, c, e = 0; e < b; e++)
  2360. if (c = d[e], c.name == a) return c;
  2361. return null
  2362. };
  2363. b.__EVENT__ADD_TO_STAGE_LIST = [];
  2364. b.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2365. return b
  2366. }(c.DisplayObject);
  2367. c.DisplayObjectContainer = e;
  2368. e.prototype.__class__ = "egret.DisplayObjectContainer"
  2369. })(egret || (egret = {}));
  2370. __extends = this.__extends || function(c, e) {
  2371. function f() {
  2372. this.constructor = c
  2373. }
  2374. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  2375. f.prototype = e.prototype;
  2376. c.prototype = new f
  2377. };
  2378. (function(c) {
  2379. var e = function(e) {
  2380. function b(a, d) {
  2381. void 0 === a && (a = 480);
  2382. void 0 === d && (d = 800);
  2383. e.call(this);
  2384. this.touchEnabled = !0;
  2385. this._stage = this;
  2386. this._stageWidth = a;
  2387. this._stageHeight = d
  2388. }
  2389. __extends(b, e);
  2390. b.prototype.invalidate = function() {
  2391. b._invalidateRenderFlag = !0
  2392. };
  2393. Object.defineProperty(b.prototype, "scaleMode", {
  2394. get: function() {
  2395. return this._scaleMode
  2396. },
  2397. set: function(a) {
  2398. this._scaleMode != a && (this._scaleMode = a, this.setResolutionPolicy())
  2399. },
  2400. enumerable: !0,
  2401. configurable: !0
  2402. });
  2403. b.prototype.changeSize = function() {
  2404. this.setResolutionPolicy();
  2405. this.dispatchEventWith(c.Event.RESIZE)
  2406. };
  2407. b.prototype.setResolutionPolicy = function() {
  2408. var a = {};
  2409. a[c.StageScaleMode.NO_SCALE] = new c.NoScale;
  2410. a[c.StageScaleMode.SHOW_ALL] = new c.ShowAll;
  2411. a[c.StageScaleMode.NO_BORDER] = new c.FixedWidth;
  2412. a[c.StageScaleMode.EXACT_FIT] = new c.FullScreen;
  2413. a = a[this._scaleMode];
  2414. if (!a) throw Error("使用了尚未实现的ScaleMode");
  2415. var d = new c.EqualToFrame,
  2416. a = new c.ResolutionPolicy(d, a);
  2417. c.StageDelegate.getInstance()._setResolutionPolicy(a);
  2418. this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
  2419. this._stageHeight = c.StageDelegate.getInstance()._stageHeight
  2420. };
  2421. Object.defineProperty(b.prototype, "stageWidth", {
  2422. get: function() {
  2423. return this._stageWidth
  2424. },
  2425. enumerable: !0,
  2426. configurable: !0
  2427. });
  2428. Object.defineProperty(b.prototype, "stageHeight", {
  2429. get: function() {
  2430. return this._stageHeight
  2431. },
  2432. enumerable: !0,
  2433. configurable: !0
  2434. });
  2435. b.prototype.hitTest = function(a, d, b) {
  2436. if (!this._touchEnabled) return null;
  2437. var e;
  2438. if (!this._touchChildren) return this;
  2439. b = this._children;
  2440. for (var f = b.length - 1; 0 <= f; f--) {
  2441. e = b[f];
  2442. var g = e._getMatrix(),
  2443. h = e._scrollRect;
  2444. h && g.append(1, 0, 0, 1, -h.x, -h.y);
  2445. g.invert();
  2446. g = c.Matrix.transformCoords(g, a, d);
  2447. if ((e = e.hitTest(g.x, g.y, !0)) && e._touchEnabled) return e
  2448. }
  2449. return this
  2450. };
  2451. b.prototype.getBounds = function(a) {
  2452. a || (a = new c.Rectangle);
  2453. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2454. };
  2455. b.prototype._updateTransform = function() {
  2456. for (var a = 0, d = this._children.length; a < d; a++) this._children[a]._updateTransform()
  2457. };
  2458. Object.defineProperty(b.prototype, "focus", {
  2459. get: function() {
  2460. return null
  2461. },
  2462. enumerable: !0,
  2463. configurable: !0
  2464. });
  2465. b._invalidateRenderFlag = !1;
  2466. return b
  2467. }(c.DisplayObjectContainer);
  2468. c.Stage = e;
  2469. e.prototype.__class__ = "egret.Stage"
  2470. })(egret || (egret = {}));
  2471. (function(c) {
  2472. var e = function() {
  2473. function c() {}
  2474. c.NO_BORDER = "noBorder";
  2475. c.NO_SCALE = "noScale";
  2476. c.SHOW_ALL = "showAll";
  2477. c.EXACT_FIT = "exactFit";
  2478. return c
  2479. }();
  2480. c.StageScaleMode = e;
  2481. e.prototype.__class__ = "egret.StageScaleMode"
  2482. })(egret || (egret = {}));
  2483. __extends = this.__extends || function(c, e) {
  2484. function f() {
  2485. this.constructor = c
  2486. }
  2487. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  2488. f.prototype = e.prototype;
  2489. c.prototype = new f
  2490. };
  2491. (function(c) {
  2492. var e = function(e) {
  2493. function b(a) {
  2494. void 0 === a && (a = null);
  2495. e.call(this);
  2496. this._lastTouchPosition = new c.Point(0, 0);
  2497. this._lastTouchTime = 0;
  2498. this._lastTouchEvent = null;
  2499. this._velocitys = [];
  2500. this._content = null;
  2501. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2502. this._scrollTop = this._scrollLeft = 0;
  2503. this._vCanScroll = this._hCanScroll = !1;
  2504. this.touchEnabled = !0;
  2505. a && this.setContent(a)
  2506. }
  2507. __extends(b, e);
  2508. b.prototype.setContent = function(a) {
  2509. this._content !== a && (this.removeContent(), a && (this._content = a, e.prototype.addChild.call(this, a), this._addEvents()))
  2510. };
  2511. b.prototype.removeContent = function() {
  2512. this._content && (this._removeEvents(), e.prototype.removeChildAt.call(this, 0));
  2513. this._content = null
  2514. };
  2515. Object.defineProperty(b.prototype, "verticalScrollPolicy", {
  2516. get: function() {
  2517. return this._verticalScrollPolicy
  2518. },
  2519. set: function(a) {
  2520. a != this._verticalScrollPolicy && (this._verticalScrollPolicy = a)
  2521. },
  2522. enumerable: !0,
  2523. configurable: !0
  2524. });
  2525. Object.defineProperty(b.prototype, "horizontalScrollPolicy", {
  2526. get: function() {
  2527. return this._horizontalScrollPolicy
  2528. },
  2529. set: function(a) {
  2530. a != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = a)
  2531. },
  2532. enumerable: !0,
  2533. configurable: !0
  2534. });
  2535. Object.defineProperty(b.prototype, "scrollLeft", {
  2536. get: function() {
  2537. return this._scrollLeft
  2538. },
  2539. set: function(a) {
  2540. a != this._scrollLeft && (this._scrollLeft = a, this._validatePosition(!1, !0), this._updateContentPosition())
  2541. },
  2542. enumerable: !0,
  2543. configurable: !0
  2544. });
  2545. Object.defineProperty(b.prototype, "scrollTop", {
  2546. get: function() {
  2547. return this._scrollTop
  2548. },
  2549. set: function(a) {
  2550. a != this._scrollTop && (this._scrollTop = a, this._validatePosition(!0, !1), this._updateContentPosition())
  2551. },
  2552. enumerable: !0,
  2553. configurable: !0
  2554. });
  2555. b.prototype.setScrollPosition = function(a, d, b) {
  2556. void 0 === b && (b = !1);
  2557. if (!b || 0 != a || 0 != d)
  2558. if (b || this._scrollTop != a || this._scrollLeft != d) {
  2559. if (b) {
  2560. b = this._isOnTheEdge(!0);
  2561. var c = this._isOnTheEdge(!1);
  2562. this._scrollTop += b ? a / 2 : a;
  2563. this._scrollLeft += c ? d / 2 : d
  2564. } else this._scrollTop = a, this._scrollLeft = d;
  2565. this._validatePosition(!0, !0);
  2566. this._updateContentPosition()
  2567. }
  2568. };
  2569. b.prototype._isOnTheEdge = function(a) {
  2570. void 0 === a && (a = !0);
  2571. var d = this._scrollTop,
  2572. b = this._scrollLeft;
  2573. return a ? 0 > d || d > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2574. };
  2575. b.prototype._validatePosition = function(a, d) {
  2576. void 0 === a && (a = !1);
  2577. void 0 === d && (d = !1);
  2578. if (a) {
  2579. var b = this.height,
  2580. c = this._getContentHeight();
  2581. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2582. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : c / 2)
  2583. }
  2584. d && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : c / 2))
  2585. };
  2586. b.prototype._setWidth = function(a) {
  2587. this._explicitWidth != a && (e.prototype._setWidth.call(this, a), this._updateContentPosition())
  2588. };
  2589. b.prototype._setHeight = function(a) {
  2590. this._explicitHeight != a && (e.prototype._setHeight.call(this, a), this._updateContentPosition())
  2591. };
  2592. b.prototype._updateContentPosition = function() {
  2593. var a = this.getBounds(c.Rectangle.identity);
  2594. this.scrollRect = new c.Rectangle(this._scrollLeft, this._scrollTop, a.width, a.height);
  2595. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  2596. };
  2597. b.prototype._checkScrollPolicy = function() {
  2598. var a = this.__checkScrollPolicy(this._horizontalScrollPolicy, this._getContentWidth(), this.width);
  2599. this._hCanScroll = a;
  2600. var d = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2601. this._vCanScroll = d;
  2602. return a || d
  2603. };
  2604. b.prototype.__checkScrollPolicy = function(a, d, b) {
  2605. return "on" == a ? !0 : "off" == a ? !1 : d > b
  2606. };
  2607. b.prototype._addEvents = function() {
  2608. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2609. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2610. this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2611. };
  2612. b.prototype._removeEvents = function() {
  2613. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2614. this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2615. this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2616. };
  2617. b.prototype._onTouchBegin = function(a) {
  2618. !a._isDefaultPrevented && this._checkScrollPolicy() && (c.Tween.removeTweens(this), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this), this.stage.addEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(a), a.preventDefault())
  2619. };
  2620. b.prototype._onTouchBeginCapture = function(a) {
  2621. var d = this._checkScrollPolicy();
  2622. if (d) {
  2623. for (var s = a.target; s != this;) {
  2624. if (s instanceof b && (d = s._checkScrollPolicy())) return;
  2625. s = s.parent
  2626. }
  2627. a.stopPropagation();
  2628. this.delayTouchBeginEvent = this.cloneTouchEvent(a);
  2629. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2630. this.touchBeginTimer.start();
  2631. this._onTouchBegin(a)
  2632. }
  2633. };
  2634. b.prototype._onTouchEndCapture = function(a) {
  2635. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2636. };
  2637. b.prototype._onTouchBeginTimer = function() {
  2638. this.touchBeginTimer.stop();
  2639. var a = this.delayTouchBeginEvent;
  2640. this.delayTouchBeginEvent = null;
  2641. this.dispatchPropagationEvent(a)
  2642. };
  2643. b.prototype.dispatchPropagationEvent = function(a) {
  2644. for (var d = [], b = a._target; b;) d.push(b),
  2645. b = b.parent;
  2646. for (var c = this._content, e = 1;; e += 2) {
  2647. b = d[e];
  2648. if (!b || b === c) break;
  2649. d.unshift(b)
  2650. }
  2651. this._dispatchPropagationEvent(a, d)
  2652. };
  2653. b.prototype._dispatchPropagationEvent = function(a, d, b) {
  2654. for (var c = d.length, e = 0; e < c; e++) {
  2655. var f = d[e];
  2656. a._currentTarget = f;
  2657. a._target = this;
  2658. a._eventPhase = e < b ? 1 : e == b ? 2 : 3;
  2659. f._notifyListener(a);
  2660. if (a._isPropagationStopped || a._isPropagationImmediateStopped) break
  2661. }
  2662. };
  2663. b.prototype._onTouchMove = function(a) {
  2664. if (this._lastTouchPosition.x != a.stageX || this._lastTouchPosition.y != a.stageY) {
  2665. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2666. this.touchChildren = !1;
  2667. var d = this._getPointChange(a);
  2668. this.setScrollPosition(d.y, d.x, !0);
  2669. this._calcVelocitys(a);
  2670. this._logTouchEvent(a)
  2671. }
  2672. };
  2673. b.prototype._onTouchEnd = function(a) {
  2674. this.touchChildren = !0;
  2675. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2676. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2677. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  2678. this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
  2679. this._moveAfterTouchEnd()
  2680. };
  2681. b.prototype._onEnterFrame = function(a) {
  2682. a = c.getTimer();
  2683. 100 < a - this._lastTouchTime && 300 > a - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2684. };
  2685. b.prototype._logTouchEvent = function(a) {
  2686. this._lastTouchPosition.x = a.stageX;
  2687. this._lastTouchPosition.y = a.stageY;
  2688. this._lastTouchEvent = this.cloneTouchEvent(a);
  2689. this._lastTouchTime = c.getTimer()
  2690. };
  2691. b.prototype._getPointChange = function(a) {
  2692. return {
  2693. x: !1 === this._hCanScroll ? 0 : this._lastTouchPosition.x - a.stageX,
  2694. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - a.stageY
  2695. }
  2696. };
  2697. b.prototype._calcVelocitys = function(a) {
  2698. var d = c.getTimer();
  2699. if (0 == this._lastTouchTime) this._lastTouchTime = d;
  2700. else {
  2701. var b = this._getPointChange(a),
  2702. d = d - this._lastTouchTime;
  2703. b.x /= d;
  2704. b.y /= d;
  2705. this._velocitys.push(b);
  2706. 5 < this._velocitys.length && this._velocitys.shift();
  2707. this._lastTouchPosition.x = a.stageX;
  2708. this._lastTouchPosition.y = a.stageY
  2709. }
  2710. };
  2711. b.prototype._getContentWidth = function() {
  2712. return this._content.explicitWidth || this._content.width
  2713. };
  2714. b.prototype._getContentHeight = function() {
  2715. return this._content.explicitHeight || this._content.height
  2716. };
  2717. b.prototype.getMaxScrollLeft = function() {
  2718. var a = this._getContentWidth() - this.width;
  2719. return Math.max(0, a)
  2720. };
  2721. b.prototype.getMaxScrollTop = function() {
  2722. var a = this._getContentHeight() - this.height;
  2723. return Math.max(0, a)
  2724. };
  2725. b.prototype._moveAfterTouchEnd = function() {
  2726. if (0 != this._velocitys.length) {
  2727. for (var a = 0, d = 0, c = 0, e = 0; e < this._velocitys.length; e++) var f = this._velocitys[e],
  2728. g = b.weight[e], a = a + f.x * g,
  2729. d = d + f.y * g, c = c + g;
  2730. this._velocitys.length = 0;
  2731. a /= c;
  2732. d /= c;
  2733. f = Math.abs(a);
  2734. c = Math.abs(d);
  2735. g = this.getMaxScrollLeft();
  2736. e = this.getMaxScrollTop();
  2737. a = 0.02 < f ? this.getAnimationDatas(a, this._scrollLeft, g) : {
  2738. position: this._scrollLeft,
  2739. duration: 1
  2740. };
  2741. d = 0.02 < c ? this.getAnimationDatas(d, this._scrollTop, e) : {
  2742. position: this._scrollTop,
  2743. duration: 1
  2744. };
  2745. this.setScrollLeft(a.position, a.duration);
  2746. this.setScrollTop(d.position, d.duration)
  2747. }
  2748. };
  2749. b.prototype.setScrollTop = function(a, d) {
  2750. void 0 === d && (d = 0);
  2751. var b = Math.min(this.getMaxScrollTop(), Math.max(a, 0));
  2752. if (0 == d) return this.scrollTop = b, null;
  2753. var e = c.Tween.get(this).to({
  2754. scrollTop: a
  2755. }, d, c.Ease.quartOut);
  2756. b != a && e.to({
  2757. scrollTop: b
  2758. }, 300, c.Ease.quintOut)
  2759. };
  2760. b.prototype.setScrollLeft = function(a, d) {
  2761. void 0 === d && (d = 0);
  2762. var b = Math.min(this.getMaxScrollLeft(), Math.max(a, 0));
  2763. if (0 == d) return this.scrollLeft = b, null;
  2764. var e = c.Tween.get(this).to({
  2765. scrollLeft: a
  2766. }, d, c.Ease.quartOut);
  2767. b != a && e.to({
  2768. scrollLeft: b
  2769. }, 300, c.Ease.quintOut)
  2770. };
  2771. b.prototype.getAnimationDatas = function(a, d, b) {
  2772. var c = Math.abs(a),
  2773. e = 0,
  2774. f = d + 500 * a;
  2775. if (0 > f || f > b)
  2776. for (f = d; Infinity != Math.abs(a) && 0.02 < Math.abs(a);) f += a, a = 0 > f || f > b ? 0.998 * a * 0.95 : 0.998 * a, e++;
  2777. else e = 500 * -Math.log(0.02 / c);
  2778. return {
  2779. position: Math.min(b + 50, Math.max(f, -50)),
  2780. duration: e
  2781. }
  2782. };
  2783. b.prototype.cloneTouchEvent = function(a) {
  2784. var d = new c.TouchEvent(a._type, a._bubbles, a.cancelable);
  2785. d.touchPointID = a.touchPointID;
  2786. d._stageX = a._stageX;
  2787. d._stageY = a._stageY;
  2788. d.ctrlKey = a.ctrlKey;
  2789. d.altKey = a.altKey;
  2790. d.shiftKey = a.shiftKey;
  2791. d.touchDown = a.touchDown;
  2792. d._isDefaultPrevented = !1;
  2793. d._target = a._target;
  2794. return d
  2795. };
  2796. b.prototype.throwNotSupportedError = function() {
  2797. throw Error("此方法在ScrollView内不可用!");
  2798. };
  2799. b.prototype.addChild = function(a) {
  2800. this.throwNotSupportedError();
  2801. return null
  2802. };
  2803. b.prototype.addChildAt = function(a, d) {
  2804. this.throwNotSupportedError();
  2805. return null
  2806. };
  2807. b.prototype.removeChild = function(a) {
  2808. this.throwNotSupportedError();
  2809. return null
  2810. };
  2811. b.prototype.removeChildAt = function(a) {
  2812. this.throwNotSupportedError();
  2813. return null
  2814. };
  2815. b.prototype.setChildIndex = function(a, d) {
  2816. this.throwNotSupportedError()
  2817. };
  2818. b.prototype.swapChildren = function(a, d) {
  2819. this.throwNotSupportedError()
  2820. };
  2821. b.prototype.swapChildrenAt = function(a, d) {
  2822. this.throwNotSupportedError()
  2823. };
  2824. b.prototype.hitTest = function(a, d, b) {
  2825. void 0 === b && (b = !1);
  2826. var x = e.prototype.hitTest.call(this, a, d, b);
  2827. return x ? x : c.DisplayObject.prototype.hitTest.call(this, a, d, b)
  2828. };
  2829. b.weight = [1, 1.33, 1.66, 2, 2.33];
  2830. return b
  2831. }(c.DisplayObjectContainer);
  2832. c.ScrollView = e;
  2833. e.prototype.__class__ = "egret.ScrollView"
  2834. })(egret || (egret = {}));
  2835. (function(c) {
  2836. var e = function() {
  2837. function c() {}
  2838. c.REPEAT = "repeat";
  2839. c.SCALE = "scale";
  2840. return c
  2841. }();
  2842. c.BitmapFillMode = e;
  2843. e.prototype.__class__ = "egret.BitmapFillMode"
  2844. })(egret || (egret = {}));
  2845. __extends = this.__extends || function(c, e) {
  2846. function f() {
  2847. this.constructor = c
  2848. }
  2849. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  2850. f.prototype = e.prototype;
  2851. c.prototype = new f
  2852. };
  2853. (function(c) {
  2854. var e = function(e) {
  2855. function b(a) {
  2856. e.call(this);
  2857. this.debug = !1;
  2858. this.debugColor = 16711680;
  2859. this.scale9Grid = null;
  2860. this.fillMode = "scale";
  2861. a && (this._texture = a, this._setSizeDirty())
  2862. }
  2863. __extends(b, e);
  2864. Object.defineProperty(b.prototype, "texture", {
  2865. get: function() {
  2866. return this._texture
  2867. },
  2868. set: function(a) {
  2869. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2870. },
  2871. enumerable: !0,
  2872. configurable: !0
  2873. });
  2874. b.prototype._render = function(a) {
  2875. var d = this._texture;
  2876. d ? (this._texture_to_render = d, b._drawBitmap(a, this._hasWidthSet ? this._explicitWidth : d._textureWidth, this._hasHeightSet ? this._explicitHeight : d._textureHeight, this)) : this._texture_to_render = null
  2877. };
  2878. b._drawBitmap = function(a, d, c, e) {
  2879. var f = e._texture_to_render;
  2880. if (f) {
  2881. var g = f._textureWidth,
  2882. h = f._textureHeight;
  2883. if ("scale" == e.fillMode) {
  2884. var k = e.scale9Grid || f.scale9Grid;
  2885. if (k && g - k.width < d && h - k.height < c) b.drawScale9GridImage(a, e, k, d, c);
  2886. else {
  2887. var k = f._offsetX,
  2888. l = f._offsetY,
  2889. m = f._bitmapWidth || g,
  2890. n = f._bitmapHeight || h;
  2891. d /= g;
  2892. k = Math.round(k * d);
  2893. d = Math.round(m * d);
  2894. c /= h;
  2895. l = Math.round(l * c);
  2896. c = Math.round(n * c);
  2897. b.renderFilter.drawImage(a, e, f._bitmapX, f._bitmapY, m, n, k, l, d, c)
  2898. }
  2899. } else b.drawRepeatImage(a, e, d, c, e.fillMode)
  2900. }
  2901. };
  2902. b.drawRepeatImage = function(a, d, b, e, f) {
  2903. var g = d._texture_to_render;
  2904. if (g) {
  2905. var h = g._textureWidth,
  2906. k = g._textureHeight,
  2907. l = g._bitmapX,
  2908. m = g._bitmapY,
  2909. h = g._bitmapWidth || h,
  2910. k = g._bitmapHeight || k,
  2911. n = g._offsetX,
  2912. g = g._offsetY;
  2913. c.RenderFilter.getInstance().drawImage(a, d, l, m, h, k, n, g, b, e, f)
  2914. }
  2915. };
  2916. b.drawScale9GridImage = function(a, d, b, e, f) {
  2917. var g = d._texture_to_render;
  2918. if (g && b) {
  2919. var h = c.RenderFilter.getInstance(),
  2920. k = g._textureWidth,
  2921. l = g._textureHeight,
  2922. m = g._bitmapX,
  2923. n = g._bitmapY,
  2924. p = g._bitmapWidth || k,
  2925. r = g._bitmapHeight || l,
  2926. w = g._offsetX,
  2927. A = g._offsetY,
  2928. g = c.MainContext.instance.rendererContext.texture_scale_factor;
  2929. b = c.Rectangle.identity.initialize(b.x - Math.round(w), b.y - Math.round(w), b.width, b.height);
  2930. w = Math.round(w);
  2931. A = Math.round(A);
  2932. e -= k - p;
  2933. f -= l - r;
  2934. b.y == b.bottom && (b.bottom < r ? b.bottom++ : b.y--);
  2935. b.x == b.right && (b.right < p ? b.right++ : b.x--);
  2936. var k = m + b.x,
  2937. l = m + b.right,
  2938. u = p - b.right,
  2939. y = n + b.y,
  2940. v = n + b.bottom,
  2941. z = r - b.bottom,
  2942. t = w + b.x,
  2943. E = A + b.y,
  2944. r = f - (r - b.bottom),
  2945. p = e - (p - b.right);
  2946. h.drawImage(a, d, m / g, n / g, b.x, b.y, w, A, b.x, b.y);
  2947. h.drawImage(a, d, k / g, n / g, b.width, b.y, t, A, p - b.x, b.y);
  2948. h.drawImage(a, d, l / g, n / g, u, b.y, w + p, A, e - p, b.y);
  2949. h.drawImage(a, d, m / g, y / g, b.x, b.height, w, E, b.x, r - b.y);
  2950. h.drawImage(a, d, k / g, y / g, b.width, b.height, t, E, p - b.x, r - b.y);
  2951. h.drawImage(a, d, l / g, y / g, u, b.height, w + p, E, e - p, r - b.y);
  2952. h.drawImage(a, d, m / g, v / g, b.x, z, w, A + r, b.x, f - r);
  2953. h.drawImage(a, d, k / g, v / g, b.width, z, t, A + r, p - b.x, f - r);
  2954. h.drawImage(a, d, l / g, v / g, u, z, w + p, A + r, e - p, f - r)
  2955. }
  2956. };
  2957. b.prototype._measureBounds = function() {
  2958. var a = this._texture;
  2959. return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : e.prototype._measureBounds.call(this)
  2960. };
  2961. b.debug = !1;
  2962. b.renderFilter = c.RenderFilter.getInstance();
  2963. return b
  2964. }(c.DisplayObject);
  2965. c.Bitmap = e;
  2966. e.prototype.__class__ = "egret.Bitmap"
  2967. })(egret || (egret = {}));
  2968. __extends = this.__extends || function(c, e) {
  2969. function f() {
  2970. this.constructor = c
  2971. }
  2972. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  2973. f.prototype = e.prototype;
  2974. c.prototype = new f
  2975. };
  2976. (function(c) {
  2977. var e = function(e) {
  2978. function b() {
  2979. e.call(this);
  2980. this._text = "";
  2981. this._textChanged = !1;
  2982. this._spriteSheet = null;
  2983. this._spriteSheetChanged = !1;
  2984. this._bitmapPool = []
  2985. }
  2986. __extends(b, e);
  2987. Object.defineProperty(b.prototype, "text", {
  2988. get: function() {
  2989. return this._text
  2990. },
  2991. set: function(a) {
  2992. this._textChanged = !0;
  2993. this._text = a;
  2994. this._setSizeDirty()
  2995. },
  2996. enumerable: !0,
  2997. configurable: !0
  2998. });
  2999. Object.defineProperty(b.prototype, "spriteSheet", {
  3000. get: function() {
  3001. return this._spriteSheet
  3002. },
  3003. set: function(a) {
  3004. this._spriteSheet != a && (this._spriteSheet = a, this._spriteSheetChanged = !0, this._setSizeDirty())
  3005. },
  3006. enumerable: !0,
  3007. configurable: !0
  3008. });
  3009. b.prototype._updateTransform = function() {
  3010. this.visible && ((this._textChanged || this._spriteSheetChanged) && this._renderText(), e.prototype._updateTransform.call(this))
  3011. };
  3012. b.prototype._renderText = function(a) {
  3013. var d = a = 0;
  3014. (this._textChanged || this._spriteSheetChanged) && this.removeChildren();
  3015. for (var b = 0, e = this.text.length; b < e; b++) {
  3016. var f = this.text.charAt(b),
  3017. g = this.spriteSheet.getTexture(f);
  3018. if (null == g) console.log("当前没有位图文字:" + f);
  3019. else {
  3020. var f = g._offsetX,
  3021. h = g._offsetY,
  3022. k = g._textureWidth;
  3023. if (this._textChanged || this._spriteSheetChanged) {
  3024. var l = this._bitmapPool[b];
  3025. l || (l = new c.Bitmap, this._bitmapPool.push(l));
  3026. l.texture = g;
  3027. this.addChild(l);
  3028. l.x = a
  3029. }
  3030. a += k + f;
  3031. h + g._textureHeight > d && (d = h + g._textureHeight)
  3032. }
  3033. }
  3034. this._spriteSheetChanged = this._textChanged = !1;
  3035. return c.Rectangle.identity.initialize(0, 0, a, d)
  3036. };
  3037. b.prototype._measureBounds = function() {
  3038. return this._renderText(!0)
  3039. };
  3040. return b
  3041. }(c.DisplayObjectContainer);
  3042. c.BitmapText = e;
  3043. e.prototype.__class__ = "egret.BitmapText"
  3044. })(egret || (egret = {}));
  3045. (function(c) {
  3046. var e = function() {
  3047. function c() {
  3048. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3049. this.commandQueue = []
  3050. }
  3051. c.prototype.beginFill = function(b, a) {};
  3052. c.prototype._setStyle = function(b) {};
  3053. c.prototype.drawRect = function(b, a, d, c) {
  3054. this.checkRect(b, a, d, c)
  3055. };
  3056. c.prototype.drawCircle = function(b, a, d) {
  3057. this.checkRect(b - d, a - d, 2 * d, 2 * d)
  3058. };
  3059. c.prototype.drawRoundRect = function(b, a, d, c, e, f) {
  3060. this.checkRect(b, a, d, c)
  3061. };
  3062. c.prototype.drawEllipse = function(b, a, d, c) {
  3063. this.checkRect(b - d, a - c, 2 * d, 2 * c)
  3064. };
  3065. c.prototype.lineStyle = function(b, a, d, c, e, f, g, h) {};
  3066. c.prototype.lineTo = function(b, a) {
  3067. this.checkPoint(b, a)
  3068. };
  3069. c.prototype.curveTo = function(b, a, d, c) {
  3070. this.checkPoint(b, a);
  3071. this.checkPoint(d, c)
  3072. };
  3073. c.prototype.moveTo = function(b, a) {
  3074. this.checkPoint(b, a)
  3075. };
  3076. c.prototype.clear = function() {
  3077. this._maxY = this._maxX = this._minY = this._minX = 0
  3078. };
  3079. c.prototype.endFill = function() {};
  3080. c.prototype._draw = function(b) {};
  3081. c.prototype.checkRect = function(b, a, d, c) {
  3082. this._minX = Math.min(this._minX, b);
  3083. this._minY = Math.min(this._minY, a);
  3084. this._maxX = Math.max(this._maxX, b + d);
  3085. this._maxY = Math.max(this._maxY, a + c)
  3086. };
  3087. c.prototype.checkPoint = function(b, a) {
  3088. this._minX = Math.min(this._minX, b);
  3089. this._minY = Math.min(this._minY, a);
  3090. this._maxX = Math.max(this._maxX, b);
  3091. this._maxY = Math.max(this._maxY, a);
  3092. this._lastX = b;
  3093. this._lastY = a
  3094. };
  3095. return c
  3096. }();
  3097. c.Graphics = e;
  3098. e.prototype.__class__ = "egret.Graphics";
  3099. (function() {
  3100. return function(c, b, a) {
  3101. this.method = c;
  3102. this.thisObject = b;
  3103. this.args = a
  3104. }
  3105. })().prototype.__class__ = "egret.Command"
  3106. })(egret || (egret = {}));
  3107. __extends = this.__extends || function(c, e) {
  3108. function f() {
  3109. this.constructor = c
  3110. }
  3111. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3112. f.prototype = e.prototype;
  3113. c.prototype = new f
  3114. };
  3115. (function(c) {
  3116. var e = function(e) {
  3117. function b() {
  3118. e.call(this)
  3119. }
  3120. __extends(b, e);
  3121. Object.defineProperty(b.prototype, "graphics", {
  3122. get: function() {
  3123. this._graphics || (this._graphics = new c.Graphics);
  3124. return this._graphics
  3125. },
  3126. enumerable: !0,
  3127. configurable: !0
  3128. });
  3129. b.prototype._render = function(a) {
  3130. this._graphics && this._graphics._draw(a)
  3131. };
  3132. return b
  3133. }(c.DisplayObject);
  3134. c.Shape = e;
  3135. e.prototype.__class__ = "egret.Shape"
  3136. })(egret || (egret = {}));
  3137. __extends = this.__extends || function(c, e) {
  3138. function f() {
  3139. this.constructor = c
  3140. }
  3141. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3142. f.prototype = e.prototype;
  3143. c.prototype = new f
  3144. };
  3145. (function(c) {
  3146. var e = function(e) {
  3147. function b() {
  3148. e.call(this)
  3149. }
  3150. __extends(b, e);
  3151. Object.defineProperty(b.prototype, "graphics", {
  3152. get: function() {
  3153. this._graphics || (this._graphics = new c.Graphics);
  3154. return this._graphics
  3155. },
  3156. enumerable: !0,
  3157. configurable: !0
  3158. });
  3159. b.prototype._render = function(a) {
  3160. this._graphics && this._graphics._draw(a);
  3161. e.prototype._render.call(this, a)
  3162. };
  3163. return b
  3164. }(c.DisplayObjectContainer);
  3165. c.Sprite = e;
  3166. e.prototype.__class__ = "egret.Sprite"
  3167. })(egret || (egret = {}));
  3168. __extends = this.__extends || function(c, e) {
  3169. function f() {
  3170. this.constructor = c
  3171. }
  3172. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3173. f.prototype = e.prototype;
  3174. c.prototype = new f
  3175. };
  3176. (function(c) {
  3177. var e = function(e) {
  3178. function b() {
  3179. e.call(this);
  3180. this._inputEnabled = !1;
  3181. this._text = this._type = "";
  3182. this._displayAsPassword = !1;
  3183. this._fontFamily = b.default_fontFamily;
  3184. this._size = 30;
  3185. this._textColorString = "#FFFFFF";
  3186. this._textColor = 16777215;
  3187. this._strokeColorString = "#000000";
  3188. this._stroke = this._strokeColor = 0;
  3189. this._textAlign = "left";
  3190. this._verticalAlign = "top";
  3191. this._maxChars = 0;
  3192. this._scrollV = -1;
  3193. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3194. this._isFlow = this._multiline = !1;
  3195. this._textArr = [];
  3196. this._isArrayChanged = !1;
  3197. this._textMaxHeight = this._textMaxWidth = 0;
  3198. this._linesArr = []
  3199. }
  3200. __extends(b, e);
  3201. b.prototype.isInput = function() {
  3202. return this._type == c.TextFieldType.INPUT
  3203. };
  3204. b.prototype._setTouchEnabled = function(a) {
  3205. e.prototype._setTouchEnabled.call(this, a);
  3206. this.isInput() && (this._inputEnabled = !0)
  3207. };
  3208. Object.defineProperty(b.prototype, "type", {
  3209. get: function() {
  3210. return this._type
  3211. },
  3212. set: function(a) {
  3213. this._setType(a)
  3214. },
  3215. enumerable: !0,
  3216. configurable: !0
  3217. });
  3218. b.prototype._setType = function(a) {
  3219. this._type != a && (this._type = a, this._type == c.TextFieldType.INPUT ? (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3220. };
  3221. Object.defineProperty(b.prototype, "text", {
  3222. get: function() {
  3223. return this._getText()
  3224. },
  3225. set: function(a) {
  3226. this._setText(a)
  3227. },
  3228. enumerable: !0,
  3229. configurable: !0
  3230. });
  3231. b.prototype._getText = function() {
  3232. return this._type == c.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3233. };
  3234. b.prototype._setSizeDirty = function() {
  3235. e.prototype._setSizeDirty.call(this);
  3236. this._isArrayChanged = !0
  3237. };
  3238. b.prototype._setTextDirty = function() {
  3239. this._setSizeDirty()
  3240. };
  3241. b.prototype._setBaseText = function(a) {
  3242. null == a && (a = "");
  3243. this._isFlow = !1;
  3244. if (this._text != a || this._displayAsPassword) this._setTextDirty(), this._text = a, a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3245. text: a
  3246. }])
  3247. };
  3248. b.prototype._setText = function(a) {
  3249. null == a && (a = "");
  3250. this._setBaseText(a);
  3251. this._inputUtils && this._inputUtils._setText(this._text)
  3252. };
  3253. Object.defineProperty(b.prototype, "displayAsPassword", {
  3254. get: function() {
  3255. return this._displayAsPassword
  3256. },
  3257. set: function(a) {
  3258. this._setDisplayAsPassword(a)
  3259. },
  3260. enumerable: !0,
  3261. configurable: !0
  3262. });
  3263. b.prototype._setDisplayAsPassword = function(a) {
  3264. this._displayAsPassword != a && (this._displayAsPassword = a, this._setText(this._text))
  3265. };
  3266. Object.defineProperty(b.prototype, "fontFamily", {
  3267. get: function() {
  3268. return this._fontFamily
  3269. },
  3270. set: function(a) {
  3271. this._setFontFamily(a)
  3272. },
  3273. enumerable: !0,
  3274. configurable: !0
  3275. });
  3276. b.prototype._setFontFamily = function(a) {
  3277. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  3278. };
  3279. Object.defineProperty(b.prototype, "size", {
  3280. get: function() {
  3281. return this._size
  3282. },
  3283. set: function(a) {
  3284. this._setSize(a)
  3285. },
  3286. enumerable: !0,
  3287. configurable: !0
  3288. });
  3289. b.prototype._setSize = function(a) {
  3290. this._size != a && (this._setTextDirty(), this._size = a)
  3291. };
  3292. Object.defineProperty(b.prototype, "italic", {
  3293. get: function() {
  3294. return this._italic
  3295. },
  3296. set: function(a) {
  3297. this._setItalic(a)
  3298. },
  3299. enumerable: !0,
  3300. configurable: !0
  3301. });
  3302. b.prototype._setItalic = function(a) {
  3303. this._italic != a && (this._setTextDirty(), this._italic = a)
  3304. };
  3305. Object.defineProperty(b.prototype, "bold", {
  3306. get: function() {
  3307. return this._bold
  3308. },
  3309. set: function(a) {
  3310. this._setBold(a)
  3311. },
  3312. enumerable: !0,
  3313. configurable: !0
  3314. });
  3315. b.prototype._setBold = function(a) {
  3316. this._bold != a && (this._setTextDirty(), this._bold = a)
  3317. };
  3318. Object.defineProperty(b.prototype, "textColor", {
  3319. get: function() {
  3320. return this._textColor
  3321. },
  3322. set: function(a) {
  3323. this._setTextColor(a)
  3324. },
  3325. enumerable: !0,
  3326. configurable: !0
  3327. });
  3328. b.prototype._setTextColor = function(a) {
  3329. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = c.toColorString(a))
  3330. };
  3331. Object.defineProperty(b.prototype, "strokeColor", {
  3332. get: function() {
  3333. return this._strokeColor
  3334. },
  3335. set: function(a) {
  3336. this._setStrokeColor(a)
  3337. },
  3338. enumerable: !0,
  3339. configurable: !0
  3340. });
  3341. b.prototype._setStrokeColor = function(a) {
  3342. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = c.toColorString(a))
  3343. };
  3344. Object.defineProperty(b.prototype, "stroke", {
  3345. get: function() {
  3346. return this._stroke
  3347. },
  3348. set: function(a) {
  3349. this._setStroke(a)
  3350. },
  3351. enumerable: !0,
  3352. configurable: !0
  3353. });
  3354. b.prototype._setStroke = function(a) {
  3355. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  3356. };
  3357. Object.defineProperty(b.prototype, "textAlign", {
  3358. get: function() {
  3359. return this._textAlign
  3360. },
  3361. set: function(a) {
  3362. this._setTextAlign(a)
  3363. },
  3364. enumerable: !0,
  3365. configurable: !0
  3366. });
  3367. b.prototype._setTextAlign = function(a) {
  3368. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  3369. };
  3370. Object.defineProperty(b.prototype, "verticalAlign", {
  3371. get: function() {
  3372. return this._verticalAlign
  3373. },
  3374. set: function(a) {
  3375. this._setVerticalAlign(a)
  3376. },
  3377. enumerable: !0,
  3378. configurable: !0
  3379. });
  3380. b.prototype._setVerticalAlign = function(a) {
  3381. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  3382. };
  3383. Object.defineProperty(b.prototype, "maxChars", {
  3384. get: function() {
  3385. return this._maxChars
  3386. },
  3387. set: function(a) {
  3388. this._setMaxChars(a)
  3389. },
  3390. enumerable: !0,
  3391. configurable: !0
  3392. });
  3393. b.prototype._setMaxChars = function(a) {
  3394. this._maxChars != a && (this._maxChars = a)
  3395. };
  3396. Object.defineProperty(b.prototype, "scrollV", {
  3397. set: function(a) {
  3398. this._scrollV = a;
  3399. this._setDirty()
  3400. },
  3401. enumerable: !0,
  3402. configurable: !0
  3403. });
  3404. Object.defineProperty(b.prototype, "maxScrollV", {
  3405. get: function() {
  3406. return this._maxScrollV
  3407. },
  3408. enumerable: !0,
  3409. configurable: !0
  3410. });
  3411. Object.defineProperty(b.prototype, "selectionBeginIndex", {
  3412. get: function() {
  3413. return 0
  3414. },
  3415. enumerable: !0,
  3416. configurable: !0
  3417. });
  3418. Object.defineProperty(b.prototype, "selectionEndIndex", {
  3419. get: function() {
  3420. return 0
  3421. },
  3422. enumerable: !0,
  3423. configurable: !0
  3424. });
  3425. Object.defineProperty(b.prototype, "caretIndex", {
  3426. get: function() {
  3427. return 0
  3428. },
  3429. enumerable: !0,
  3430. configurable: !0
  3431. });
  3432. b.prototype._setSelection = function(a, d) {};
  3433. Object.defineProperty(b.prototype, "lineSpacing", {
  3434. get: function() {
  3435. return this._lineSpacing
  3436. },
  3437. set: function(a) {
  3438. this._setLineSpacing(a)
  3439. },
  3440. enumerable: !0,
  3441. configurable: !0
  3442. });
  3443. b.prototype._setLineSpacing = function(a) {
  3444. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  3445. };
  3446. b.prototype._getLineHeight = function() {
  3447. return this._lineSpacing + this._size
  3448. };
  3449. Object.defineProperty(b.prototype, "numLines", {
  3450. get: function() {
  3451. return this._numLines
  3452. },
  3453. enumerable: !0,
  3454. configurable: !0
  3455. });
  3456. Object.defineProperty(b.prototype, "multiline", {
  3457. get: function() {
  3458. return this._multiline
  3459. },
  3460. set: function(a) {
  3461. this._setMultiline(a)
  3462. },
  3463. enumerable: !0,
  3464. configurable: !0
  3465. });
  3466. b.prototype._setMultiline = function(a) {
  3467. this._multiline = a;
  3468. this._setDirty()
  3469. };
  3470. b.prototype.setFocus = function() {
  3471. c.Logger.warning("TextField.setFocus 没有实现")
  3472. };
  3473. b.prototype._onRemoveFromStage = function() {
  3474. e.prototype._onRemoveFromStage.call(this);
  3475. this._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3476. };
  3477. b.prototype._onAddToStage = function() {
  3478. e.prototype._onAddToStage.call(this);
  3479. this._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
  3480. };
  3481. b.prototype._updateBaseTransform = function() {
  3482. e.prototype._updateTransform.call(this)
  3483. };
  3484. b.prototype._updateTransform = function() {
  3485. this._type == c.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3486. };
  3487. b.prototype._render = function(a) {
  3488. this.drawText(a);
  3489. this._clearDirty()
  3490. };
  3491. b.prototype._measureBounds = function() {
  3492. return this.measureText()
  3493. };
  3494. Object.defineProperty(b.prototype, "textFlow", {
  3495. get: function() {
  3496. return this._textArr
  3497. },
  3498. set: function(a) {
  3499. this._isFlow = !0;
  3500. var d = "";
  3501. null == a && (a = []);
  3502. for (var b = 0; b < a.length; b++) d += a[b].text;
  3503. this._displayAsPassword ? this._setBaseText(d) : (this._text = d, this.setMiddleStyle(a))
  3504. },
  3505. enumerable: !0,
  3506. configurable: !0
  3507. });
  3508. b.prototype.changeToPassText = function(a) {
  3509. if (this._displayAsPassword) {
  3510. for (var d = "", b = 0, c = a.length; b < c; b++) switch (a.charAt(b)) {
  3511. case "\n":
  3512. d += "\n";
  3513. break;
  3514. case "\r":
  3515. break;
  3516. default:
  3517. d += "*"
  3518. }
  3519. return d
  3520. }
  3521. return a
  3522. };
  3523. b.prototype.setMiddleStyle = function(a) {
  3524. this._isArrayChanged = !0;
  3525. this._textArr = a;
  3526. this._setSizeDirty()
  3527. };
  3528. Object.defineProperty(b.prototype, "textWidth", {
  3529. get: function() {
  3530. return this._textMaxWidth
  3531. },
  3532. enumerable: !0,
  3533. configurable: !0
  3534. });
  3535. Object.defineProperty(b.prototype, "textHeight", {
  3536. get: function() {
  3537. return this._textMaxHeight
  3538. },
  3539. enumerable: !0,
  3540. configurable: !0
  3541. });
  3542. b.prototype.appendText = function(a) {
  3543. this.appendElement({
  3544. text: a
  3545. })
  3546. };
  3547. b.prototype.appendElement = function(a) {
  3548. this._textArr.push(a);
  3549. this.setMiddleStyle(this._textArr)
  3550. };
  3551. b.prototype._getLinesArr = function() {
  3552. if (!this._isArrayChanged) return this._linesArr;
  3553. this._isArrayChanged = !1;
  3554. var a = this._textArr,
  3555. d = c.MainContext.instance.rendererContext;
  3556. this._linesArr = [];
  3557. this._textMaxWidth = this._textMaxHeight = 0;
  3558. if (this._hasWidthSet && 0 == this._explicitWidth) return console.warn("文本宽度被设置为0"), this._numLines = 0, [{
  3559. width: 0,
  3560. height: 0,
  3561. elements: []
  3562. }];
  3563. var b = this._linesArr,
  3564. e = 0,
  3565. f = 0,
  3566. g = 0,
  3567. h;
  3568. this._isFlow || d.setupFont(this);
  3569. for (var k = 0; k < a.length; k++) {
  3570. var l = a[k];
  3571. l.style = l.style || {};
  3572. for (var m = l.text.toString().split(/(?:\r\n|\r|\n)/), n = 0; n < m.length; n++) {
  3573. null == b[g] && (h = {
  3574. width: 0,
  3575. height: 0,
  3576. elements: []
  3577. }, b[g] = h, f = e = 0);
  3578. f = this._type == c.TextFieldType.INPUT ? this._size : Math.max(f, l.style.size || this._size);
  3579. if ("" != m[n]) {
  3580. this._isFlow && d.setupFont(this, l.style);
  3581. var p = d.measureText(m[n]);
  3582. if (this._hasWidthSet)
  3583. if (e + p <= this._explicitWidth) h.elements.push({
  3584. width: p,
  3585. text: m[n],
  3586. style: l.style
  3587. }), e += p;
  3588. else {
  3589. for (var r = 0, w = 0, A = m[n]; r < A.length; r++) {
  3590. p = d.measureText(A.charAt(r));
  3591. if (e + p > this._explicitWidth) break;
  3592. w += p;
  3593. e += p
  3594. }
  3595. 0 < r && (h.elements.push({
  3596. width: w,
  3597. text: A.substring(0, r),
  3598. style: l.style
  3599. }), m[n] = A.substring(r));
  3600. n--
  3601. } else e += p, h.elements.push({
  3602. width: p,
  3603. text: m[n],
  3604. style: l.style
  3605. })
  3606. }
  3607. if (n < m.length - 1) {
  3608. h.width = e;
  3609. h.height = f;
  3610. this._textMaxWidth = Math.max(this._textMaxWidth, e);
  3611. this._textMaxHeight += f;
  3612. if (this._type == c.TextFieldType.INPUT && !this._multiline) return this._numLines = b.length, b;
  3613. g++
  3614. }
  3615. }
  3616. k == a.length - 1 && h && (h.width = e, h.height = f, this._textMaxWidth = Math.max(this._textMaxWidth, e), this._textMaxHeight += f)
  3617. }
  3618. this._numLines = b.length;
  3619. return b
  3620. };
  3621. b.prototype.measureText = function() {
  3622. return this._getLinesArr() ? c.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) * this._lineSpacing) : c.Rectangle.identity.initialize(0, 0, 0, 0)
  3623. };
  3624. b.prototype.drawText = function(a) {
  3625. var d = this._getLinesArr();
  3626. if (d) {
  3627. this._isFlow || a.setupFont(this);
  3628. var b = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3629. e = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  3630. f = 0,
  3631. g = 0;
  3632. if (this._hasHeightSet)
  3633. if (e < this._explicitHeight) {
  3634. var h = 0;
  3635. this._verticalAlign == c.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (h = 1);
  3636. f += h * (this._explicitHeight - e)
  3637. } else e > this._explicitHeight && (g = Math.max(this._scrollV - 1, 0), g = Math.min(this._numLines - 1, g));
  3638. f = Math.round(f);
  3639. e = 0;
  3640. this._textAlign == c.HorizontalAlign.CENTER ? e = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (e = 1);
  3641. for (h = 0; g < this._numLines; g++) {
  3642. var k = d[g],
  3643. l = k.height,
  3644. f = f + l / 2;
  3645. if (0 != g && this._hasHeightSet && f > this._explicitHeight) break;
  3646. for (var h = Math.round((b - k.width) * e), m = 0; m < k.elements.length; m++) {
  3647. var n = k.elements[m],
  3648. p = n.style.size || this._size;
  3649. this._type == c.TextFieldType.INPUT ? a.drawText(this, n.text, h, f + (l - p) / 2, n.width) : (this._isFlow && a.setupFont(this, n.style), a.drawText(this, n.text, h, f + (l - p) / 2, n.width, n.style));
  3650. h += n.width
  3651. }
  3652. f += l / 2 + this._lineSpacing
  3653. }
  3654. }
  3655. };
  3656. b.default_fontFamily = "Arial";
  3657. return b
  3658. }(c.DisplayObject);
  3659. c.TextField = e;
  3660. e.prototype.__class__ = "egret.TextField"
  3661. })(egret || (egret = {}));
  3662. (function(c) {
  3663. var e = function() {
  3664. function c() {
  3665. this.resutlArr = []
  3666. }
  3667. c.prototype.parser = function(b) {
  3668. this.stackArray = [];
  3669. this.resutlArr = [];
  3670. for (var a = 0, d = b.length; a < d;) {
  3671. var c = b.indexOf("<", a);
  3672. 0 > c ? (this.addToResultArr(b.substring(a)), a = d) : (this.addToResultArr(b.substring(a, c)), a = b.indexOf(">", c), "/" == b.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(b.substring(c + 1, a)), a += 1)
  3673. }
  3674. return this.resutlArr
  3675. };
  3676. c.prototype.addToResultArr = function(b) {
  3677. if ("" != b) {
  3678. var a = [];
  3679. a.push(["&lt;", "<"]);
  3680. a.push(["&gt;", ">"]);
  3681. a.push(["&amp;", "&"]);
  3682. a.push(["&quot;", '"']);
  3683. a.push(["&apos;;", "'"]);
  3684. for (var d = 0; d < a.length; d++) b.replace(new RegExp(a[d][0], "g"), a[d][1]);
  3685. 0 < this.stackArray.length ? this.resutlArr.push({
  3686. text: b,
  3687. style: this.stackArray[this.stackArray.length - 1]
  3688. }) : this.resutlArr.push({
  3689. text: b
  3690. })
  3691. }
  3692. };
  3693. c.prototype.changeStringToObject = function(b) {
  3694. var a = {};
  3695. b = b.replace(/( )+/g, " ").split(" ");
  3696. for (var d = 0; d < b.length; d++) this.addProperty(a, b[d]);
  3697. return a
  3698. };
  3699. c.prototype.addProperty = function(b, a) {
  3700. var d = a.replace(/( )*=( )*/g, "=").split("=");
  3701. d[1] && (d[1] = d[1].replace(/(\"|\')/g, ""));
  3702. switch (d[0].toLowerCase()) {
  3703. case "color":
  3704. b.textColor = parseInt(d[1]);
  3705. break;
  3706. case "b":
  3707. b.bold = "true" == (d[1] || "true");
  3708. break;
  3709. case "i":
  3710. b.italic = "true" == (d[1] || "true");
  3711. break;
  3712. case "size":
  3713. b.size = parseInt(d[1]);
  3714. break;
  3715. case "fontFamily":
  3716. b.fontFamily = d[1]
  3717. }
  3718. };
  3719. c.prototype.addToArray = function(b) {
  3720. b = this.changeStringToObject(b);
  3721. if (0 != this.stackArray.length) {
  3722. var a = this.stackArray[this.stackArray.length - 1],
  3723. d;
  3724. for (d in a) null == b[d] && (b[d] = a[d])
  3725. }
  3726. this.stackArray.push(b)
  3727. };
  3728. return c
  3729. }();
  3730. c.HtmlTextParser = e;
  3731. e.prototype.__class__ = "egret.HtmlTextParser"
  3732. })(egret || (egret = {}));
  3733. (function(c) {
  3734. var e = function() {
  3735. function c() {}
  3736. c.DYNAMIC = "dynamic";
  3737. c.INPUT = "input";
  3738. return c
  3739. }();
  3740. c.TextFieldType = e;
  3741. e.prototype.__class__ = "egret.TextFieldType"
  3742. })(egret || (egret = {}));
  3743. __extends = this.__extends || function(c, e) {
  3744. function f() {
  3745. this.constructor = c
  3746. }
  3747. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3748. f.prototype = e.prototype;
  3749. c.prototype = new f
  3750. };
  3751. (function(c) {
  3752. var e = function(e) {
  3753. function b(a) {
  3754. e.call(this);
  3755. var d = a.bitmapData;
  3756. this.bitmapData = d;
  3757. this._textureMap = {};
  3758. this._sourceWidth = d.width;
  3759. this._sourceHeight = d.height;
  3760. this._bitmapX = a._bitmapX - a._offsetX;
  3761. this._bitmapY = a._bitmapY - a._offsetY
  3762. }
  3763. __extends(b, e);
  3764. b.prototype.getTexture = function(a) {
  3765. return this._textureMap[a]
  3766. };
  3767. b.prototype.createTexture = function(a, d, b, e, f, g, h, k, l) {
  3768. void 0 === g && (g = 0);
  3769. void 0 === h && (h = 0);
  3770. "undefined" === typeof k && (k = g + e);
  3771. "undefined" === typeof l && (l = h + f);
  3772. var m = new c.Texture,
  3773. n = c.MainContext.instance.rendererContext.texture_scale_factor;
  3774. m._bitmapData = this.bitmapData;
  3775. m._bitmapX = this._bitmapX + d;
  3776. m._bitmapY = this._bitmapY + b;
  3777. m._bitmapWidth = e * n;
  3778. m._bitmapHeight = f * n;
  3779. m._offsetX = g;
  3780. m._offsetY = h;
  3781. m._textureWidth = k * n;
  3782. m._textureHeight = l * n;
  3783. m._sourceWidth = this._sourceWidth;
  3784. m._sourceHeight = this._sourceHeight;
  3785. return this._textureMap[a] = m
  3786. };
  3787. return b
  3788. }(c.HashObject);
  3789. c.SpriteSheet = e;
  3790. e.prototype.__class__ = "egret.SpriteSheet"
  3791. })(egret || (egret = {}));
  3792. __extends = this.__extends || function(c, e) {
  3793. function f() {
  3794. this.constructor = c
  3795. }
  3796. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3797. f.prototype = e.prototype;
  3798. c.prototype = new f
  3799. };
  3800. (function(c) {
  3801. var e = function(e) {
  3802. function b() {
  3803. e.call(this);
  3804. this._isFocus = !1;
  3805. this._isFirst = this._isFirst = !0
  3806. }
  3807. __extends(b, e);
  3808. b.prototype.init = function(a) {
  3809. this._text = a;
  3810. this.stageText = c.StageText.create();
  3811. a = this._text.localToGlobal();
  3812. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  3813. };
  3814. b.prototype._addStageText = function() {
  3815. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3816. this.stageText._add();
  3817. this.stageText._addListeners();
  3818. this.stageText.addEventListener("blur", this.onBlurHandler, this);
  3819. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3820. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3821. this._text.addEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3822. c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3823. };
  3824. b.prototype._removeStageText = function() {
  3825. this.stageText._remove();
  3826. this.stageText._removeListeners();
  3827. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3828. this.stageText.removeEventListener("blur", this.onBlurHandler, this);
  3829. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3830. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3831. this._text.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3832. c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3833. };
  3834. b.prototype._getText = function() {
  3835. return this.stageText._getText()
  3836. };
  3837. b.prototype._setText = function(a) {
  3838. this.stageText._setText(a)
  3839. };
  3840. b.prototype.onFocusHandler = function(a) {
  3841. this.hideText()
  3842. };
  3843. b.prototype.onBlurHandler = function(a) {
  3844. this.showText()
  3845. };
  3846. b.prototype.onMouseDownHandler = function(a) {
  3847. a.stopPropagation();
  3848. this._text._visible && this.stageText._show()
  3849. };
  3850. b.prototype.onStageDownHandler = function(a) {
  3851. this.stageText._hide();
  3852. this.showText()
  3853. };
  3854. b.prototype.showText = function() {
  3855. this._isFocus && (this._isFocus = !1, this.resetText())
  3856. };
  3857. b.prototype.hideText = function() {
  3858. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  3859. };
  3860. b.prototype.updateTextHandler = function(a) {
  3861. this.resetText();
  3862. this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
  3863. };
  3864. b.prototype.resetText = function() {
  3865. this._text._setBaseText(this.stageText._getText())
  3866. };
  3867. b.prototype._updateTransform = function() {
  3868. var a = this._text._worldTransform.a,
  3869. d = this._text._worldTransform.b,
  3870. b = this._text._worldTransform.c,
  3871. e = this._text._worldTransform.d,
  3872. f = this._text._worldTransform.tx,
  3873. g = this._text._worldTransform.ty;
  3874. this._text._updateBaseTransform();
  3875. var h = this._text._worldTransform;
  3876. if (this._isFirst || a != h.a || d != h.b || b != h.c || e != h.d || f != h.tx || g != h.ty) {
  3877. this._isFirst = !1;
  3878. a = this._text.localToGlobal();
  3879. this.stageText.changePosition(a.x, a.y);
  3880. var k = this;
  3881. c.callLater(function() {
  3882. k.stageText._setScale(k._text._worldTransform.a, k._text._worldTransform.d)
  3883. }, this)
  3884. }
  3885. };
  3886. b.prototype._updateProperties = function() {
  3887. var a = this._text._stage;
  3888. if (null == a) this.stageText._setVisible(!1);
  3889. else {
  3890. for (var d = this._text, b = d._visible; b;) {
  3891. d = d.parent;
  3892. if (d == a) break;
  3893. b = d._visible
  3894. }
  3895. this.stageText._setVisible(b)
  3896. }
  3897. this.stageText._setMultiline(this._text._multiline);
  3898. this.stageText._setMaxChars(this._text._maxChars);
  3899. this.stageText._setSize(this._text._size);
  3900. this.stageText._setTextColor(this._text._textColorString);
  3901. this.stageText._setTextFontFamily(this._text._fontFamily);
  3902. this.stageText._setBold(this._text._bold);
  3903. this.stageText._setItalic(this._text._italic);
  3904. this.stageText._setTextAlign(this._text._textAlign);
  3905. this.stageText._setWidth(this._text._getSize(c.Rectangle.identity).width);
  3906. this.stageText._setHeight(this._text._getSize(c.Rectangle.identity).height);
  3907. this.stageText._setTextType(this._text._displayAsPassword ? "password" : "text");
  3908. this.stageText._setText(this._text._text);
  3909. this.stageText._resetStageText();
  3910. this._updateTransform()
  3911. };
  3912. return b
  3913. }(c.HashObject);
  3914. c.InputController = e;
  3915. e.prototype.__class__ = "egret.InputController"
  3916. })(egret || (egret = {}));
  3917. __extends = this.__extends || function(c, e) {
  3918. function f() {
  3919. this.constructor = c
  3920. }
  3921. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3922. f.prototype = e.prototype;
  3923. c.prototype = new f
  3924. };
  3925. (function(c) {
  3926. var e = function(c) {
  3927. function b(a, d) {
  3928. c.call(this, a);
  3929. this.charList = this.parseConfig(d)
  3930. }
  3931. __extends(b, c);
  3932. b.prototype.getTexture = function(a) {
  3933. var d = this._textureMap[a];
  3934. if (!d) {
  3935. d = this.charList[a];
  3936. if (!d) return null;
  3937. d = this.createTexture(a, d.x, d.y, d.width, d.height, d.offsetX, d.offsetY);
  3938. this._textureMap[a] = d
  3939. }
  3940. return d
  3941. };
  3942. b.prototype.parseConfig = function(a) {
  3943. a = a.split("\r\n").join("\n");
  3944. a = a.split("\n");
  3945. for (var d = this.getConfigByKey(a[3], "count"), b = {}, c = 4; c < 4 + d; c++) {
  3946. var e = a[c],
  3947. f = String.fromCharCode(this.getConfigByKey(e, "id")),
  3948. h = {};
  3949. b[f] = h;
  3950. h.x = this.getConfigByKey(e, "x");
  3951. h.y = this.getConfigByKey(e, "y");
  3952. h.width = this.getConfigByKey(e, "width");
  3953. h.height = this.getConfigByKey(e, "height");
  3954. h.offsetX = this.getConfigByKey(e, "xoffset");
  3955. h.offsetY = this.getConfigByKey(e, "yoffset")
  3956. }
  3957. return b
  3958. };
  3959. b.prototype.getConfigByKey = function(a, d) {
  3960. for (var b = a.split(" "), c = 0, e = b.length; c < e; c++) {
  3961. var f = b[c];
  3962. if (d == f.substring(0, d.length)) return b = f.substring(d.length + 1), parseInt(b)
  3963. }
  3964. return 0
  3965. };
  3966. return b
  3967. }(c.SpriteSheet);
  3968. c.BitmapTextSpriteSheet = e;
  3969. e.prototype.__class__ = "egret.BitmapTextSpriteSheet"
  3970. })(egret || (egret = {}));
  3971. __extends = this.__extends || function(c, e) {
  3972. function f() {
  3973. this.constructor = c
  3974. }
  3975. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  3976. f.prototype = e.prototype;
  3977. c.prototype = new f
  3978. };
  3979. (function(c) {
  3980. var e = function(b) {
  3981. function a(d, a) {
  3982. b.call(this);
  3983. this.frameRate = 60;
  3984. d instanceof f ? (c.Logger.warning("MovieClip#constructor接口参数已经变更,请尽快调整用法为 new MovieClip(data,texture)"), this.delegate = d) : this.delegate = new f(d, a);
  3985. this.delegate.setMovieClip(this)
  3986. }
  3987. __extends(a, b);
  3988. a.prototype.gotoAndPlay = function(d) {
  3989. this.delegate.gotoAndPlay(d)
  3990. };
  3991. a.prototype.gotoAndStop = function(d) {
  3992. this.delegate.gotoAndStop(d)
  3993. };
  3994. a.prototype.stop = function() {
  3995. this.delegate.stop()
  3996. };
  3997. a.prototype.dispose = function() {
  3998. this.delegate.dispose()
  3999. };
  4000. a.prototype.release = function() {
  4001. c.Logger.warning("MovieClip#release方法即将废弃");
  4002. this.dispose()
  4003. };
  4004. a.prototype.getCurrentFrameIndex = function() {
  4005. c.Logger.warning("MovieClip#getCurrentFrameIndex方法即将废弃");
  4006. return this.delegate._currentFrameIndex
  4007. };
  4008. a.prototype.getTotalFrame = function() {
  4009. c.Logger.warning("MovieClip#getTotalFrame方法即将废弃");
  4010. return this.delegate._totalFrame
  4011. };
  4012. a.prototype.setInterval = function(d) {
  4013. c.Logger.warning("MovieClip#setInterval方法即将废弃,请使用MovieClip#frameRate代替");
  4014. this.frameRate = 60 / d
  4015. };
  4016. a.prototype.getIsPlaying = function() {
  4017. c.Logger.warning("MovieClip#getIsPlaying方法即将废弃");
  4018. return this.delegate.isPlaying
  4019. };
  4020. return a
  4021. }(c.DisplayObjectContainer);
  4022. c.MovieClip = e;
  4023. e.prototype.__class__ = "egret.MovieClip";
  4024. var f = function() {
  4025. function b(a, d) {
  4026. this.data = a;
  4027. this._currentFrameIndex = this._passTime = this._totalFrame = 0;
  4028. this._isPlaying = !1;
  4029. this._frameData = a;
  4030. this._spriteSheet = new c.SpriteSheet(d)
  4031. }
  4032. b.prototype.setMovieClip = function(a) {
  4033. this.movieClip = a;
  4034. this.bitmap = new c.Bitmap;
  4035. this.movieClip.addChild(this.bitmap)
  4036. };
  4037. b.prototype.gotoAndPlay = function(a) {
  4038. this.checkHasFrame(a);
  4039. this._isPlaying = !0;
  4040. this._currentFrameIndex = 0;
  4041. this._currentFrameName = a;
  4042. this._totalFrame = this._frameData.frames[a].totalFrame;
  4043. this.playNextFrame();
  4044. this._passTime = 0;
  4045. c.Ticker.getInstance().register(this.update, this)
  4046. };
  4047. b.prototype.gotoAndStop = function(a) {
  4048. this.checkHasFrame(a);
  4049. this.stop();
  4050. this._currentFrameIndex = this._passTime = 0;
  4051. this._currentFrameName = a;
  4052. this._totalFrame = this._frameData.frames[a].totalFrame;
  4053. this.playNextFrame()
  4054. };
  4055. b.prototype.stop = function() {
  4056. this._isPlaying = !1;
  4057. c.Ticker.getInstance().unregister(this.update, this)
  4058. };
  4059. b.prototype.dispose = function() {};
  4060. b.prototype.checkHasFrame = function(a) {
  4061. void 0 == this._frameData.frames[a] && c.Logger.fatal("MovieClip没有对应的frame:", a)
  4062. };
  4063. b.prototype.update = function(a) {
  4064. for (var d = 1E3 / this.movieClip.frameRate, d = Math.floor((this._passTime % d + a) / d); 1 <= d;) 1 == d ? this.playNextFrame() : this.playNextFrame(!1), d--;
  4065. this._passTime += a
  4066. };
  4067. b.prototype.playNextFrame = function(a) {
  4068. void 0 === a && (a = !0);
  4069. var d = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4070. if (a) {
  4071. a = this.getTexture(d.res);
  4072. var b = this.bitmap;
  4073. b.x = d.x;
  4074. b.y = d.y;
  4075. b.texture = a
  4076. }
  4077. null != d.action && this.movieClip.dispatchEventWith(d.action);
  4078. this._currentFrameIndex++;
  4079. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0, d.action != c.Event.COMPLETE && this.movieClip.dispatchEventWith(c.Event.COMPLETE))
  4080. };
  4081. b.prototype.getTexture = function(a) {
  4082. var d = this._frameData.res[a],
  4083. b = this._spriteSheet.getTexture(a);
  4084. b || (b = this._spriteSheet.createTexture(a, d.x, d.y, d.w, d.h));
  4085. return b
  4086. };
  4087. return b
  4088. }();
  4089. c.DefaultMovieClipDelegate = f;
  4090. f.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4091. })(egret || (egret = {}));
  4092. __extends = this.__extends || function(c, e) {
  4093. function f() {
  4094. this.constructor = c
  4095. }
  4096. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4097. f.prototype = e.prototype;
  4098. c.prototype = new f
  4099. };
  4100. (function(c) {
  4101. var e = function(c) {
  4102. function b() {
  4103. c.call(this);
  4104. this._scaleY = this._scaleX = 1;
  4105. this._size = 30;
  4106. this._color = "#FFFFFF";
  4107. this._fontFamily = "Arial";
  4108. this._italic = this._bold = !1;
  4109. this._textAlign = "left";
  4110. this._multiline = this._visible = !1;
  4111. this._maxChars = 0
  4112. }
  4113. __extends(b, c);
  4114. b.prototype._getText = function() {
  4115. return null
  4116. };
  4117. b.prototype._setText = function(a) {};
  4118. b.prototype._setTextType = function(a) {};
  4119. b.prototype._getTextType = function() {
  4120. return null
  4121. };
  4122. b.prototype._open = function(a, d, b, c) {};
  4123. b.prototype._show = function() {};
  4124. b.prototype._add = function() {};
  4125. b.prototype._remove = function() {};
  4126. b.prototype._hide = function() {};
  4127. b.prototype._addListeners = function() {};
  4128. b.prototype._removeListeners = function() {};
  4129. b.prototype._setScale = function(a, d) {
  4130. this._scaleX = a;
  4131. this._scaleY = d
  4132. };
  4133. b.prototype.changePosition = function(a, d) {};
  4134. b.prototype._setSize = function(a) {
  4135. this._size = a
  4136. };
  4137. b.prototype._setTextColor = function(a) {
  4138. this._color = a
  4139. };
  4140. b.prototype._setTextFontFamily = function(a) {
  4141. this._fontFamily = a
  4142. };
  4143. b.prototype._setBold = function(a) {
  4144. this._bold = a
  4145. };
  4146. b.prototype._setItalic = function(a) {
  4147. this._italic = a
  4148. };
  4149. b.prototype._setTextAlign = function(a) {
  4150. this._textAlign = a
  4151. };
  4152. b.prototype._setVisible = function(a) {
  4153. this._visible = a
  4154. };
  4155. b.prototype._setWidth = function(a) {};
  4156. b.prototype._setHeight = function(a) {};
  4157. b.prototype._setMultiline = function(a) {
  4158. this._multiline = a
  4159. };
  4160. b.prototype._setMaxChars = function(a) {
  4161. this._maxChars = a
  4162. };
  4163. b.prototype._resetStageText = function() {};
  4164. b.create = function() {
  4165. return null
  4166. };
  4167. return b
  4168. }(c.EventDispatcher);
  4169. c.StageText = e;
  4170. e.prototype.__class__ = "egret.StageText"
  4171. })(egret || (egret = {}));
  4172. (function(c) {
  4173. var e = function() {
  4174. function c() {}
  4175. c.GET = "get";
  4176. c.POST = "post";
  4177. return c
  4178. }();
  4179. c.URLRequestMethod = e;
  4180. e.prototype.__class__ = "egret.URLRequestMethod"
  4181. })(egret || (egret = {}));
  4182. (function(c) {
  4183. var e = function() {
  4184. function c() {}
  4185. c.BINARY = "binary";
  4186. c.TEXT = "text";
  4187. c.VARIABLES = "variables";
  4188. c.TEXTURE = "texture";
  4189. c.SOUND = "sound";
  4190. return c
  4191. }();
  4192. c.URLLoaderDataFormat = e;
  4193. e.prototype.__class__ = "egret.URLLoaderDataFormat"
  4194. })(egret || (egret = {}));
  4195. __extends = this.__extends || function(c, e) {
  4196. function f() {
  4197. this.constructor = c
  4198. }
  4199. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4200. f.prototype = e.prototype;
  4201. c.prototype = new f
  4202. };
  4203. (function(c) {
  4204. var e = function(c) {
  4205. function b(a) {
  4206. void 0 === a && (a = null);
  4207. c.call(this);
  4208. null !== a && this.decode(a)
  4209. }
  4210. __extends(b, c);
  4211. b.prototype.decode = function(a) {
  4212. this.variables || (this.variables = {});
  4213. a = a.split("+").join(" ");
  4214. for (var d, b = /[?&]?([^=]+)=([^&]*)/g; d = b.exec(a);) this.variables[decodeURIComponent(d[1])] = decodeURIComponent(d[2])
  4215. };
  4216. b.prototype.toString = function() {
  4217. if (!this.variables) return "";
  4218. var a = this.variables,
  4219. d = "",
  4220. b = !0,
  4221. c;
  4222. for (c in a) b ? b = !1 : d += "&", d += c + "=" + a[c];
  4223. return d
  4224. };
  4225. return b
  4226. }(c.HashObject);
  4227. c.URLVariables = e;
  4228. e.prototype.__class__ = "egret.URLVariables"
  4229. })(egret || (egret = {}));
  4230. (function(c) {
  4231. var e = function() {
  4232. return function(c, b) {
  4233. this.name = c;
  4234. this.value = b
  4235. }
  4236. }();
  4237. c.URLRequestHeader = e;
  4238. e.prototype.__class__ = "egret.URLRequestHeader"
  4239. })(egret || (egret = {}));
  4240. __extends = this.__extends || function(c, e) {
  4241. function f() {
  4242. this.constructor = c
  4243. }
  4244. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4245. f.prototype = e.prototype;
  4246. c.prototype = new f
  4247. };
  4248. (function(c) {
  4249. var e = function(e) {
  4250. function b(a) {
  4251. void 0 === a && (a = null);
  4252. e.call(this);
  4253. this.method = c.URLRequestMethod.GET;
  4254. this.url = a
  4255. }
  4256. __extends(b, e);
  4257. return b
  4258. }(c.HashObject);
  4259. c.URLRequest = e;
  4260. e.prototype.__class__ = "egret.URLRequest"
  4261. })(egret || (egret = {}));
  4262. __extends = this.__extends || function(c, e) {
  4263. function f() {
  4264. this.constructor = c
  4265. }
  4266. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4267. f.prototype = e.prototype;
  4268. c.prototype = new f
  4269. };
  4270. (function(c) {
  4271. var e = function(e) {
  4272. function b(a) {
  4273. void 0 === a && (a = null);
  4274. e.call(this);
  4275. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  4276. this._status = -1;
  4277. a && this.load(a)
  4278. }
  4279. __extends(b, e);
  4280. b.prototype.load = function(a) {
  4281. this._request = a;
  4282. this.data = null;
  4283. c.MainContext.instance.netContext.proceed(this)
  4284. };
  4285. return b
  4286. }(c.EventDispatcher);
  4287. c.URLLoader = e;
  4288. e.prototype.__class__ = "egret.URLLoader"
  4289. })(egret || (egret = {}));
  4290. __extends = this.__extends || function(c, e) {
  4291. function f() {
  4292. this.constructor = c
  4293. }
  4294. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4295. f.prototype = e.prototype;
  4296. c.prototype = new f
  4297. };
  4298. (function(c) {
  4299. var e = function(e) {
  4300. function b() {
  4301. e.call(this);
  4302. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4303. }
  4304. __extends(b, e);
  4305. Object.defineProperty(b.prototype, "textureWidth", {
  4306. get: function() {
  4307. return this._textureWidth
  4308. },
  4309. enumerable: !0,
  4310. configurable: !0
  4311. });
  4312. Object.defineProperty(b.prototype, "textureHeight", {
  4313. get: function() {
  4314. return this._textureHeight
  4315. },
  4316. enumerable: !0,
  4317. configurable: !0
  4318. });
  4319. Object.defineProperty(b.prototype, "bitmapData", {
  4320. get: function() {
  4321. return this._bitmapData
  4322. },
  4323. enumerable: !0,
  4324. configurable: !0
  4325. });
  4326. b.prototype._setBitmapData = function(a) {
  4327. var d = c.MainContext.instance.rendererContext.texture_scale_factor;
  4328. this._bitmapData = a;
  4329. this._sourceWidth = a.width;
  4330. this._sourceHeight = a.height;
  4331. this._textureWidth = this._sourceWidth * d;
  4332. this._textureHeight = this._sourceHeight * d;
  4333. this._bitmapWidth = this._textureWidth;
  4334. this._bitmapHeight = this._textureHeight;
  4335. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4336. };
  4337. b.prototype.getPixel32 = function(a, d) {
  4338. return this._bitmapData.getContext("2d").getImageData(a, d, 1, 1).data
  4339. };
  4340. return b
  4341. }(c.HashObject);
  4342. c.Texture = e;
  4343. e.prototype.__class__ = "egret.Texture"
  4344. })(egret || (egret = {}));
  4345. __extends = this.__extends || function(c, e) {
  4346. function f() {
  4347. this.constructor = c
  4348. }
  4349. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4350. f.prototype = e.prototype;
  4351. c.prototype = new f
  4352. };
  4353. (function(c) {
  4354. var e = function(e) {
  4355. function b() {
  4356. e.call(this);
  4357. this._bitmapData = document.createElement("canvas");
  4358. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  4359. }
  4360. __extends(b, e);
  4361. b.prototype.drawToTexture = function(a) {
  4362. var d = this._bitmapData,
  4363. e = a.getBounds(c.Rectangle.identity);
  4364. if (0 == e.width || 0 == e.height) return c.Logger.warning("egret.RenderTexture#drawToTexture:显示对象测量结果宽高为0,请检查"), !1;
  4365. e.width = Math.floor(e.width);
  4366. e.height = Math.floor(e.height);
  4367. d.width = e.width;
  4368. d.height = e.height;
  4369. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e.width, this.renderContext._cacheCanvas.height = e.height);
  4370. b.identityRectangle.width = e.width;
  4371. b.identityRectangle.height = e.height;
  4372. a._worldTransform.identity();
  4373. a.worldAlpha = 1;
  4374. if (a instanceof c.DisplayObjectContainer) {
  4375. var d = a._anchorOffsetX,
  4376. f = a._anchorOffsetY;
  4377. if (0 != a._anchorX || 0 != a._anchorY) d = a._anchorX * e.width, f = a._anchorY * e.height;
  4378. this._offsetX = e.x + d;
  4379. this._offsetY = e.y + f;
  4380. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4381. e = a._children;
  4382. d = 0;
  4383. for (f = e.length; d < f; d++) e[d]._updateTransform()
  4384. }
  4385. e = c.RenderFilter.getInstance();
  4386. d = e._drawAreaList.concat();
  4387. e._drawAreaList.length = 0;
  4388. this.renderContext.clearScreen();
  4389. this.renderContext.onRenderStart();
  4390. this.webGLTexture = null;
  4391. (f = a.mask || a._scrollRect) && this.renderContext.pushMask(f);
  4392. a._render(this.renderContext);
  4393. f && this.renderContext.popMask();
  4394. e.addDrawArea(b.identityRectangle);
  4395. this.renderContext.onRenderFinish();
  4396. e._drawAreaList = d;
  4397. this._textureWidth = this._bitmapData.width;
  4398. this._textureHeight = this._bitmapData.height;
  4399. this._sourceWidth = this._textureWidth;
  4400. this._sourceHeight = this._textureHeight;
  4401. return !0
  4402. };
  4403. b.identityRectangle = new c.Rectangle;
  4404. return b
  4405. }(c.Texture);
  4406. c.RenderTexture = e;
  4407. e.prototype.__class__ = "egret.RenderTexture"
  4408. })(egret || (egret = {}));
  4409. __extends = this.__extends || function(c, e) {
  4410. function f() {
  4411. this.constructor = c
  4412. }
  4413. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4414. f.prototype = e.prototype;
  4415. c.prototype = new f
  4416. };
  4417. (function(c) {
  4418. var e = function(e) {
  4419. function b() {
  4420. e.call(this);
  4421. this.renderCost = 0;
  4422. this.texture_scale_factor = 1;
  4423. this.profiler = c.Profiler.getInstance()
  4424. }
  4425. __extends(b, e);
  4426. b.prototype.clearScreen = function() {};
  4427. b.prototype.clearRect = function(a, d, b, c) {};
  4428. b.prototype.drawImage = function(a, d, b, c, e, f, h, k, l, m) {
  4429. this.profiler.onDrawImage()
  4430. };
  4431. b.prototype.setTransform = function(a) {};
  4432. b.prototype.setAlpha = function(a, d) {};
  4433. b.prototype.setupFont = function(a, d) {};
  4434. b.prototype.measureText = function(a) {
  4435. return 0
  4436. };
  4437. b.prototype.drawText = function(a, d, b, c, e, f) {
  4438. this.profiler.onDrawImage()
  4439. };
  4440. b.prototype.strokeRect = function(a, d, b, c, e) {};
  4441. b.prototype.pushMask = function(a) {};
  4442. b.prototype.popMask = function() {};
  4443. b.prototype.onRenderStart = function() {};
  4444. b.prototype.onRenderFinish = function() {};
  4445. b.prototype.setGlobalColorTransform = function(a) {};
  4446. b.createRendererContext = function(a) {
  4447. return null
  4448. };
  4449. b.imageSmoothingEnabled = !0;
  4450. return b
  4451. }(c.HashObject);
  4452. c.RendererContext = e;
  4453. e.prototype.__class__ = "egret.RendererContext"
  4454. })(egret || (egret = {}));
  4455. (function(c) {
  4456. var e = function() {
  4457. function c() {}
  4458. c.MOUSE = "mouse";
  4459. c.TOUCH = "touch";
  4460. c.mode = "touch";
  4461. return c
  4462. }();
  4463. c.InteractionMode = e;
  4464. e.prototype.__class__ = "egret.InteractionMode"
  4465. })(egret || (egret = {}));
  4466. __extends = this.__extends || function(c, e) {
  4467. function f() {
  4468. this.constructor = c
  4469. }
  4470. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4471. f.prototype = e.prototype;
  4472. c.prototype = new f
  4473. };
  4474. (function(c) {
  4475. var e = function(e) {
  4476. function b() {
  4477. e.call(this);
  4478. this._currentTouchTarget = {};
  4479. this.maxTouches = 2;
  4480. this.touchDownTarget = {};
  4481. this.touchingIdentifiers = [];
  4482. this.lastTouchY = this.lastTouchX = -1
  4483. }
  4484. __extends(b, e);
  4485. b.prototype.run = function() {};
  4486. b.prototype.getTouchData = function(a, d, b) {
  4487. var c = this._currentTouchTarget[a];
  4488. null == c && (c = {}, this._currentTouchTarget[a] = c);
  4489. c.stageX = d;
  4490. c.stageY = b;
  4491. c.identifier = a;
  4492. return c
  4493. };
  4494. b.prototype.dispatchEvent = function(a, d) {
  4495. c.TouchEvent.dispatchTouchEvent(d.target, a, d.identifier, d.stageX, d.stageY, !1, !1, !1, !0 == this.touchDownTarget[d.identifier])
  4496. };
  4497. b.prototype.onTouchBegan = function(a, d, b) {
  4498. if (this.touchingIdentifiers.length != this.maxTouches) {
  4499. var e = c.MainContext.instance.stage.hitTest(a, d);
  4500. e && (a = this.getTouchData(b, a, d), this.touchDownTarget[b] = !0, a.target = e, a.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
  4501. this.touchingIdentifiers.push(b)
  4502. }
  4503. };
  4504. b.prototype.onTouchMove = function(a, d, b) {
  4505. if (-1 != this.touchingIdentifiers.indexOf(b) && (a != this.lastTouchX || d != this.lastTouchY)) {
  4506. this.lastTouchX = a;
  4507. this.lastTouchY = d;
  4508. var e = c.MainContext.instance.stage.hitTest(a, d);
  4509. e && (a = this.getTouchData(b, a, d), a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
  4510. }
  4511. };
  4512. b.prototype.onTouchEnd = function(a, d, b) {
  4513. var e = this.touchingIdentifiers.indexOf(b); - 1 != e && (this.touchingIdentifiers.splice(e, 1), e = c.MainContext.instance.stage.hitTest(a, d)) && (a = this.getTouchData(b, a, d), delete this.touchDownTarget[b], b = a.beginTarget, a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), b == e ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  4514. };
  4515. return b
  4516. }(c.HashObject);
  4517. c.TouchContext = e;
  4518. e.prototype.__class__ = "egret.TouchContext"
  4519. })(egret || (egret = {}));
  4520. __extends = this.__extends || function(c, e) {
  4521. function f() {
  4522. this.constructor = c
  4523. }
  4524. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4525. f.prototype = e.prototype;
  4526. c.prototype = new f
  4527. };
  4528. (function(c) {
  4529. var e = function(e) {
  4530. function b() {
  4531. e.call(this)
  4532. }
  4533. __extends(b, e);
  4534. b.prototype.proceed = function(a) {};
  4535. b._getUrl = function(a) {
  4536. var d = a.url; - 1 == d.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (d = d + "?" + a.data.toString());
  4537. return d
  4538. };
  4539. b.prototype.getChangeList = function() {
  4540. return []
  4541. };
  4542. return b
  4543. }(c.HashObject);
  4544. c.NetContext = e;
  4545. e.prototype.__class__ = "egret.NetContext"
  4546. })(egret || (egret = {}));
  4547. __extends = this.__extends || function(c, e) {
  4548. function f() {
  4549. this.constructor = c
  4550. }
  4551. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4552. f.prototype = e.prototype;
  4553. c.prototype = new f
  4554. };
  4555. (function(c) {
  4556. var e = function(c) {
  4557. function b() {
  4558. c.call(this);
  4559. this.frameRate = 60
  4560. }
  4561. __extends(b, c);
  4562. b.prototype.executeMainLoop = function(a, d) {};
  4563. return b
  4564. }(c.HashObject);
  4565. c.DeviceContext = e;
  4566. e.prototype.__class__ = "egret.DeviceContext"
  4567. })(egret || (egret = {}));
  4568. (function(c) {
  4569. var e = function() {
  4570. function c() {}
  4571. c.call = function(b, a) {};
  4572. c.addCallback = function(b, a) {};
  4573. return c
  4574. }();
  4575. c.ExternalInterface = e;
  4576. e.prototype.__class__ = "egret.ExternalInterface"
  4577. })(egret || (egret = {}));
  4578. __extends = this.__extends || function(c, e) {
  4579. function f() {
  4580. this.constructor = c
  4581. }
  4582. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4583. f.prototype = e.prototype;
  4584. c.prototype = new f
  4585. };
  4586. (function(c) {
  4587. var e = function(e) {
  4588. function b() {
  4589. e.call(this);
  4590. this.ua = navigator.userAgent.toLowerCase();
  4591. this.trans = this._getTrans()
  4592. }
  4593. __extends(b, e);
  4594. b.getInstance = function() {
  4595. null == b.instance && (b.instance = new b);
  4596. return b.instance
  4597. };
  4598. Object.defineProperty(b.prototype, "isMobile", {
  4599. get: function() {
  4600. c.Logger.warning("Browser.isMobile接口参数已经变更,请尽快调整用法为 egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  4601. return c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE
  4602. },
  4603. enumerable: !0,
  4604. configurable: !0
  4605. });
  4606. b.prototype._getHeader = function(a) {
  4607. if ("transform" in a) return "";
  4608. for (var d = ["webkit", "ms", "Moz", "O"], b = 0; b < d.length; b++)
  4609. if (d[b] + "Transform" in a) return d[b];
  4610. return ""
  4611. };
  4612. b.prototype._getTrans = function() {
  4613. var a = document.createElement("div").style,
  4614. a = this._getHeader(a);
  4615. return "" == a ? "transform" : a + "Transform"
  4616. };
  4617. b.prototype.$new = function(a) {
  4618. return this.$(document.createElement(a))
  4619. };
  4620. b.prototype.$ = function(a) {
  4621. var d = document;
  4622. if (a = a instanceof HTMLElement ? a : d.querySelector(a)) a.find = a.find || this.$, a.hasClass = a.hasClass || function(d) {
  4623. return this.className.match(new RegExp("(\\s|^)" + d + "(\\s|$)"))
  4624. }, a.addClass = a.addClass || function(d) {
  4625. this.hasClass(d) || (this.className && (this.className += " "), this.className += d);
  4626. return this
  4627. }, a.removeClass = a.removeClass || function(d) {
  4628. this.hasClass(d) && (this.className = this.className.replace(d, ""));
  4629. return this
  4630. }, a.remove = a.remove || function() {}, a.appendTo = a.appendTo || function(d) {
  4631. d.appendChild(this);
  4632. return this
  4633. }, a.prependTo = a.prependTo || function(d) {
  4634. d.childNodes[0] ? d.insertBefore(this, d.childNodes[0]) : d.appendChild(this);
  4635. return this
  4636. }, a.transforms = a.transforms || function() {
  4637. this.style[b.getInstance().trans] = b.getInstance().translate(this.position) + b.getInstance().rotate(this.rotation) + b.getInstance().scale(this.scale) + b.getInstance().skew(this.skew);
  4638. return this
  4639. }, a.position = a.position || {
  4640. x: 0,
  4641. y: 0
  4642. }, a.rotation = a.rotation || 0, a.scale = a.scale || {
  4643. x: 1,
  4644. y: 1
  4645. }, a.skew = a.skew || {
  4646. x: 0,
  4647. y: 0
  4648. }, a.translates = function(d, a) {
  4649. this.position.x = d;
  4650. this.position.y = a - c.MainContext.instance.stage.stageHeight;
  4651. this.transforms();
  4652. return this
  4653. }, a.rotate = function(d) {
  4654. this.rotation = d;
  4655. this.transforms();
  4656. return this
  4657. }, a.resize = function(d, a) {
  4658. this.scale.x = d;
  4659. this.scale.y = a;
  4660. this.transforms();
  4661. return this
  4662. }, a.setSkew = function(d, a) {
  4663. this.skew.x = d;
  4664. this.skew.y = a;
  4665. this.transforms();
  4666. return this
  4667. };
  4668. return a
  4669. };
  4670. b.prototype.translate = function(a) {
  4671. return "translate(" + a.x + "px, " + a.y + "px) "
  4672. };
  4673. b.prototype.rotate = function(a) {
  4674. return "rotate(" + a + "deg) "
  4675. };
  4676. b.prototype.scale = function(a) {
  4677. return "scale(" + a.x + ", " + a.y + ") "
  4678. };
  4679. b.prototype.skew = function(a) {
  4680. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4681. };
  4682. return b
  4683. }(c.HashObject);
  4684. c.Browser = e;
  4685. e.prototype.__class__ = "egret.Browser"
  4686. })(egret || (egret = {}));
  4687. (function(c) {
  4688. (function(c) {
  4689. c.getItem = function(c) {
  4690. return null
  4691. };
  4692. c.setItem = function(c, b) {
  4693. return !1
  4694. };
  4695. c.removeItem = function(c) {};
  4696. c.clear = function() {}
  4697. })(c.localStorage || (c.localStorage = {}))
  4698. })(egret || (egret = {}));
  4699. (function(c) {
  4700. var e = function() {
  4701. function e() {}
  4702. e.parse = function(b) {
  4703. b = c.SAXParser.getInstance().parserXML(b);
  4704. if (!b || !b.childNodes) return null;
  4705. for (var a = b.childNodes.length, d = !1, s = 0; s < a; s++) {
  4706. var x = b.childNodes[s];
  4707. if (1 == x.nodeType) {
  4708. d = !0;
  4709. break
  4710. }
  4711. }
  4712. return d ? e.parseNode(x) : null
  4713. };
  4714. e.parseNode = function(b) {
  4715. if (!b || 1 != b.nodeType) return null;
  4716. var a = {};
  4717. a.localName = b.localName;
  4718. a.name = b.nodeName;
  4719. b.namespaceURI && (a.namespace = b.namespaceURI);
  4720. b.prefix && (a.prefix = b.prefix);
  4721. for (var d = b.attributes, c = d.length, x = 0; x < c; x++) {
  4722. var q = d[x],
  4723. g = q.name;
  4724. 0 != g.indexOf("xmlns:") && (a["$" + g] = q.value)
  4725. }
  4726. d = b.childNodes;
  4727. c = d.length;
  4728. for (x = 0; x < c; x++)
  4729. if (q = e.parseNode(d[x])) a.children || (a.children = []), q.parent = a, a.children.push(q);
  4730. !a.children && (b = b.textContent.trim()) && (a.text = b);
  4731. return a
  4732. };
  4733. e.findChildren = function(b, a, d) {
  4734. d ? d.length = 0 : d = [];
  4735. e.findByPath(b, a, d);
  4736. return d
  4737. };
  4738. e.findByPath = function(b, a, d) {
  4739. var c = a.indexOf("."),
  4740. x; - 1 == c ? (x = a, c = !0) : (x = a.substring(0, c), a = a.substring(c + 1), c = !1);
  4741. if (b = b.children)
  4742. for (var q = b.length, g = 0; g < q; g++) {
  4743. var h = b[g];
  4744. h.localName == x && (c ? d.push(h) : e.findByPath(h, a, d))
  4745. }
  4746. };
  4747. e.getAttributes = function(b, a) {
  4748. a ? a.length = 0 : a = [];
  4749. for (var d in b) "$" == d.charAt(0) && a.push(d.substring(1));
  4750. return a
  4751. };
  4752. return e
  4753. }();
  4754. c.XML = e;
  4755. e.prototype.__class__ = "egret.XML"
  4756. })(egret || (egret = {}));
  4757. (function(c) {
  4758. var e = function() {
  4759. function b() {}
  4760. b.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  4761. b.BIG_ENDIAN = "BIG_ENDIAN";
  4762. return b
  4763. }();
  4764. c.Endian = e;
  4765. e.prototype.__class__ = "egret.Endian";
  4766. var f = function() {
  4767. function b() {
  4768. this.length = this.position = 0;
  4769. this._mode = "";
  4770. this.maxlength = 0;
  4771. this._endian = e.LITTLE_ENDIAN;
  4772. this.isLittleEndian = !1;
  4773. this._mode = "Typed array";
  4774. this.maxlength = 4;
  4775. this.arraybytes = new ArrayBuffer(this.maxlength);
  4776. this.unalignedarraybytestemp = new ArrayBuffer(16);
  4777. this.endian = b.DEFAULT_ENDIAN
  4778. }
  4779. Object.defineProperty(b.prototype, "endian", {
  4780. get: function() {
  4781. return this._endian
  4782. },
  4783. set: function(a) {
  4784. this._endian = a;
  4785. this.isLittleEndian = a == e.LITTLE_ENDIAN
  4786. },
  4787. enumerable: !0,
  4788. configurable: !0
  4789. });
  4790. b.prototype.ensureWriteableSpace = function(a) {
  4791. this.ensureSpace(a + this.position)
  4792. };
  4793. b.prototype.setArrayBuffer = function(a) {
  4794. this.ensureSpace(a.byteLength);
  4795. this.length = a.byteLength;
  4796. a = new Int8Array(a);
  4797. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  4798. this.position = 0
  4799. };
  4800. Object.defineProperty(b.prototype, "bytesAvailable", {
  4801. get: function() {
  4802. return this.length - this.position
  4803. },
  4804. enumerable: !0,
  4805. configurable: !0
  4806. });
  4807. b.prototype.ensureSpace = function(a) {
  4808. if (a > this.maxlength) {
  4809. a = a + 255 & -256;
  4810. var d = new ArrayBuffer(a),
  4811. b = new Uint8Array(this.arraybytes, 0, this.length);
  4812. (new Uint8Array(d, 0, this.length)).set(b);
  4813. this.arraybytes = d;
  4814. this.maxlength = a
  4815. }
  4816. };
  4817. b.prototype.writeByte = function(a) {
  4818. this.ensureWriteableSpace(1);
  4819. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  4820. this.position > this.length && (this.length = this.position)
  4821. };
  4822. b.prototype.readByte = function() {
  4823. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  4824. return (new Int8Array(this.arraybytes))[this.position++]
  4825. };
  4826. b.prototype.readBytes = function(a, d, b) {
  4827. void 0 === d && (d = 0);
  4828. void 0 === b && (b = 0);
  4829. null == b && (b = a.length);
  4830. a.ensureWriteableSpace(d + b);
  4831. var c = new Int8Array(a.arraybytes),
  4832. e = new Int8Array(this.arraybytes);
  4833. c.set(e.subarray(this.position, this.position + b), d);
  4834. this.position += b;
  4835. b + d > a.length && (a.length += b + d - a.length)
  4836. };
  4837. b.prototype.writeUnsignedByte = function(a) {
  4838. this.ensureWriteableSpace(1);
  4839. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  4840. this.position > this.length && (this.length = this.position)
  4841. };
  4842. b.prototype.readUnsignedByte = function() {
  4843. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  4844. return (new Uint8Array(this.arraybytes))[this.position++]
  4845. };
  4846. b.prototype.writeUnsignedShort = function(a) {
  4847. this.ensureWriteableSpace(2);
  4848. if (0 == (this.position & 1)) {
  4849. var d = new Uint16Array(this.arraybytes);
  4850. d[this.position >> 1] = ~~a & 65535
  4851. } else d = new Uint16Array(this.unalignedarraybytestemp, 0, 1), d[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), d = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(d);
  4852. this.position += 2;
  4853. this.position > this.length && (this.length = this.position)
  4854. };
  4855. b.prototype.readUTFBytes = function(a) {
  4856. var d = "";
  4857. a = this.position + a;
  4858. for (var b = new DataView(this.arraybytes); this.position < a;) {
  4859. var c = b.getUint8(this.position++);
  4860. if (128 > c) {
  4861. if (0 == c) break;
  4862. d += String.fromCharCode(c)
  4863. } else if (224 > c) d += String.fromCharCode((c & 63) << 6 | b.getUint8(this.position++) & 127);
  4864. else if (240 > c) var e = b.getUint8(this.position++),
  4865. d = d + String.fromCharCode((c & 31) << 12 | (e & 127) << 6 | b.getUint8(this.position++) & 127);
  4866. else var e = b.getUint8(this.position++),
  4867. f = b.getUint8(this.position++), d = d + String.fromCharCode((c & 15) << 18 | (e & 127) << 12 | f << 6 & 127 | b.getUint8(this.position++) & 127)
  4868. }
  4869. return d
  4870. };
  4871. b.prototype.readInt = function() {
  4872. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  4873. this.position += 4;
  4874. return a
  4875. };
  4876. b.prototype.readShort = function() {
  4877. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  4878. this.position += 2;
  4879. return a
  4880. };
  4881. b.prototype.readDouble = function() {
  4882. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  4883. this.position += 8;
  4884. return a
  4885. };
  4886. b.prototype.readUnsignedShort = function() {
  4887. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4888. if (0 == (this.position & 1)) {
  4889. var a = new Uint16Array(this.arraybytes),
  4890. d = this.position >> 1;
  4891. this.position += 2;
  4892. return a[d]
  4893. }
  4894. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  4895. d = new Uint8Array(this.arraybytes, this.position, 2);
  4896. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(d);
  4897. this.position += 2;
  4898. return a[0]
  4899. };
  4900. b.prototype.writeUnsignedInt = function(a) {
  4901. this.ensureWriteableSpace(4);
  4902. if (0 == (this.position & 3)) {
  4903. var d = new Uint32Array(this.arraybytes);
  4904. d[this.position >> 2] = ~~a & 4294967295
  4905. } else d = new Uint32Array(this.unalignedarraybytestemp, 0, 1), d[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), d = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(d);
  4906. this.position += 4;
  4907. this.position > this.length && (this.length = this.position)
  4908. };
  4909. b.prototype.readUnsignedInt = function() {
  4910. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  4911. if (0 == (this.position & 3)) {
  4912. var a = new Uint32Array(this.arraybytes),
  4913. d = this.position >> 2;
  4914. this.position += 4;
  4915. return a[d]
  4916. }
  4917. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  4918. d = new Uint8Array(this.arraybytes, this.position, 4);
  4919. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(d);
  4920. this.position += 4;
  4921. return a[0]
  4922. };
  4923. b.prototype.writeFloat = function(a) {
  4924. this.ensureWriteableSpace(4);
  4925. if (0 == (this.position & 3)) {
  4926. var d = new Float32Array(this.arraybytes);
  4927. d[this.position >> 2] = a
  4928. } else d = new Float32Array(this.unalignedarraybytestemp, 0, 1), d[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), d = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(d);
  4929. this.position += 4;
  4930. this.position > this.length && (this.length = this.position)
  4931. };
  4932. b.prototype.readFloat = function() {
  4933. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  4934. if (0 == (this.position & 3)) {
  4935. var a = new Float32Array(this.arraybytes),
  4936. d = this.position >> 2;
  4937. this.position += 4;
  4938. return a[d]
  4939. }
  4940. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  4941. d = new Uint8Array(this.arraybytes, this.position, 4);
  4942. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(d);
  4943. this.position += 4;
  4944. return a[0]
  4945. };
  4946. b.DEFAULT_ENDIAN = e.BIG_ENDIAN;
  4947. return b
  4948. }();
  4949. c.ByteArray = f;
  4950. f.prototype.__class__ = "egret.ByteArray"
  4951. })(egret || (egret = {}));
  4952. __extends = this.__extends || function(c, e) {
  4953. function f() {
  4954. this.constructor = c
  4955. }
  4956. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  4957. f.prototype = e.prototype;
  4958. c.prototype = new f
  4959. };
  4960. (function(c) {
  4961. var e = function(e) {
  4962. function b(a, d, b) {
  4963. e.call(this);
  4964. this._target = null;
  4965. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4966. this._actions = this._steps = this.pluginData = null;
  4967. this.paused = !1;
  4968. this.duration = 0;
  4969. this._prevPos = -1;
  4970. this.position = null;
  4971. this._stepPosition = this._prevPosition = 0;
  4972. this.passive = !1;
  4973. this.initialize(a, d, b)
  4974. }
  4975. __extends(b, e);
  4976. b.get = function(a, d, c, e) {
  4977. void 0 === d && (d = null);
  4978. void 0 === c && (c = null);
  4979. void 0 === e && (e = !1);
  4980. e && b.removeTweens(a);
  4981. return new b(a, d, c)
  4982. };
  4983. b.removeTweens = function(a) {
  4984. if (a.tween_count) {
  4985. for (var d = b._tweens, c = d.length - 1; 0 <= c; c--) d[c]._target == a && (d[c].paused = !0, d.splice(c, 1));
  4986. a.tween_count = 0
  4987. }
  4988. };
  4989. b.pauseTweens = function(a) {
  4990. if (a.tween_count)
  4991. for (var d = c.Tween._tweens, b = d.length - 1; 0 <= b; b--) d[b]._target == a && (d[b].paused = !0)
  4992. };
  4993. b.resumeTweens = function(a) {
  4994. if (a.tween_count)
  4995. for (var d = c.Tween._tweens, b = d.length - 1; 0 <= b; b--) d[b]._target == a && (d[b].paused = !1)
  4996. };
  4997. b.tick = function(a, d) {
  4998. void 0 === d && (d = !1);
  4999. for (var c = b._tweens.concat(), e = c.length - 1; 0 <= e; e--) {
  5000. var f = c[e];
  5001. d && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : a)
  5002. }
  5003. };
  5004. b._register = function(a, d) {
  5005. var e = a._target,
  5006. f = b._tweens;
  5007. if (d) e && (e.tween_count = e.tween_count ? e.tween_count + 1 : 1), f.push(a), b._inited || (c.Ticker.getInstance().register(b.tick, null), b._inited = !0);
  5008. else
  5009. for (e && e.tween_count--, e = f.length; e--;)
  5010. if (f[e] == a) {
  5011. f.splice(e, 1);
  5012. break
  5013. }
  5014. };
  5015. b.removeAllTweens = function() {
  5016. for (var a = b._tweens, d = 0, c = a.length; d < c; d++) {
  5017. var e = a[d];
  5018. e.paused = !0;
  5019. e._target.tweenjs_count = 0
  5020. }
  5021. a.length = 0
  5022. };
  5023. b.prototype.initialize = function(a, d, c) {
  5024. this._target = a;
  5025. d && (this._useTicks = d.useTicks, this.ignoreGlobalPause = d.ignoreGlobalPause, this.loop = d.loop, d.onChange && this.addEventListener("change", d.onChange, d.onChangeObj), d.override && b.removeTweens(a));
  5026. this.pluginData = c || {};
  5027. this._curQueueProps = {};
  5028. this._initQueueProps = {};
  5029. this._steps = [];
  5030. this._actions = [];
  5031. d && d.paused ? this.paused = !0 : b._register(this, !0);
  5032. d && null != d.position && this.setPosition(d.position, b.NONE)
  5033. };
  5034. b.prototype.setPosition = function(a, d) {
  5035. void 0 === d && (d = 1);
  5036. 0 > a && (a = 0);
  5037. var b = a,
  5038. c = !1;
  5039. b >= this.duration && (this.loop ? b %= this.duration : (b = this.duration, c = !0));
  5040. if (b == this._prevPos) return c;
  5041. var e = this._prevPos;
  5042. this.position = this._prevPos = b;
  5043. this._prevPosition = a;
  5044. if (this._target)
  5045. if (c) this._updateTargetProps(null, 1);
  5046. else if (0 < this._steps.length) {
  5047. for (var f = 0, h = this._steps.length; f < h && !(this._steps[f].t > b); f++);
  5048. f = this._steps[f - 1];
  5049. this._updateTargetProps(f, (this._stepPosition = b - f.t) / f.d)
  5050. }
  5051. 0 != d && 0 < this._actions.length && (this._useTicks ? this._runActions(b, b) : 1 == d && b < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, b, !0)) : this._runActions(e, b));
  5052. c && this.setPaused(!0);
  5053. this.dispatchEventWith("change");
  5054. return c
  5055. };
  5056. b.prototype._runActions = function(a, d, b) {
  5057. void 0 === b && (b = !1);
  5058. var c = a,
  5059. e = d,
  5060. f = -1,
  5061. h = this._actions.length,
  5062. k = 1;
  5063. a > d && (c = d, e = a, f = h, h = k = -1);
  5064. for (;
  5065. (f += k) != h;) {
  5066. d = this._actions[f];
  5067. var l = d.t;
  5068. (l == e || l > c && l < e || b && l == a) && d.f.apply(d.o, d.p)
  5069. }
  5070. };
  5071. b.prototype._updateTargetProps = function(a, d) {
  5072. var c, e, f, g;
  5073. if (a || 1 != d) {
  5074. if (this.passive = !! a.v) return;
  5075. a.e && (d = a.e(d, 0, 1, 1));
  5076. c = a.p0;
  5077. e = a.p1
  5078. } else this.passive = !1, c = e = this._curQueueProps;
  5079. for (var h in this._initQueueProps) {
  5080. null == (f = c[h]) && (c[h] = f = this._initQueueProps[h]);
  5081. null == (g = e[h]) && (e[h] = g = f);
  5082. f = f == g || 0 == d || 1 == d || "number" != typeof f ? 1 == d ? g : f : f + (g - f) * d;
  5083. var k = !1;
  5084. if (g = b._plugins[h])
  5085. for (var l = 0, m = g.length; l < m; l++) {
  5086. var n = g[l].tween(this, h, f, c, e, d, !! a && c == e, !a);
  5087. n == b.IGNORE ? k = !0 : f = n
  5088. }
  5089. k || (this._target[h] = f)
  5090. }
  5091. };
  5092. b.prototype.setPaused = function(a) {
  5093. this.paused = a;
  5094. b._register(this, !a);
  5095. return this
  5096. };
  5097. b.prototype._cloneProps = function(a) {
  5098. var d = {}, b;
  5099. for (b in a) d[b] = a[b];
  5100. return d
  5101. };
  5102. b.prototype._addStep = function(a) {
  5103. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5104. return this
  5105. };
  5106. b.prototype._appendQueueProps = function(a) {
  5107. var d, c, e, f, g, h;
  5108. for (h in a)
  5109. if (void 0 === this._initQueueProps[h]) {
  5110. c = this._target[h];
  5111. if (d = b._plugins[h])
  5112. for (e = 0, f = d.length; e < f; e++) c = d[e].init(this, h, c);
  5113. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === c ? null : c
  5114. }
  5115. for (h in a) {
  5116. c = this._curQueueProps[h];
  5117. if (d = b._plugins[h])
  5118. for (g = g || {}, e = 0, f = d.length; e < f; e++) d[e].step && d[e].step(this, h, c, a[h], g);
  5119. this._curQueueProps[h] = a[h]
  5120. }
  5121. g && this._appendQueueProps(g);
  5122. return this._curQueueProps
  5123. };
  5124. b.prototype._addAction = function(a) {
  5125. a.t = this.duration;
  5126. this._actions.push(a);
  5127. return this
  5128. };
  5129. b.prototype._set = function(a, d) {
  5130. for (var b in a) d[b] = a[b]
  5131. };
  5132. b.prototype.wait = function(a, d) {
  5133. if (null == a || 0 >= a) return this;
  5134. var b = this._cloneProps(this._curQueueProps);
  5135. return this._addStep({
  5136. d: a,
  5137. p0: b,
  5138. p1: b,
  5139. v: d
  5140. })
  5141. };
  5142. b.prototype.to = function(a, d, b) {
  5143. void 0 === b && (b = void 0);
  5144. if (isNaN(d) || 0 > d) d = 0;
  5145. return this._addStep({
  5146. d: d || 0,
  5147. p0: this._cloneProps(this._curQueueProps),
  5148. e: b,
  5149. p1: this._cloneProps(this._appendQueueProps(a))
  5150. })
  5151. };
  5152. b.prototype.call = function(a, d, b) {
  5153. void 0 === d && (d = void 0);
  5154. void 0 === b && (b = void 0);
  5155. return this._addAction({
  5156. f: a,
  5157. p: b ? b : [],
  5158. o: d ? d : this._target
  5159. })
  5160. };
  5161. b.prototype.set = function(a, d) {
  5162. void 0 === d && (d = null);
  5163. return this._addAction({
  5164. f: this._set,
  5165. o: this,
  5166. p: [a, d ? d : this._target]
  5167. })
  5168. };
  5169. b.prototype.play = function(a) {
  5170. a || (a = this);
  5171. return this.call(a.setPaused, a, [!1])
  5172. };
  5173. b.prototype.pause = function(a) {
  5174. a || (a = this);
  5175. return this.call(a.setPaused, a, [!0])
  5176. };
  5177. b.prototype.tick = function(a) {
  5178. this.paused || this.setPosition(this._prevPosition + a)
  5179. };
  5180. b.NONE = 0;
  5181. b.LOOP = 1;
  5182. b.REVERSE = 2;
  5183. b._tweens = [];
  5184. b.IGNORE = {};
  5185. b._plugins = {};
  5186. b._inited = !1;
  5187. return b
  5188. }(c.EventDispatcher);
  5189. c.Tween = e;
  5190. e.prototype.__class__ = "egret.Tween"
  5191. })(egret || (egret = {}));
  5192. (function(c) {
  5193. var e = function() {
  5194. function e() {
  5195. c.Logger.fatal("Ease不能被实例化")
  5196. }
  5197. e.get = function(b) {
  5198. -1 > b && (b = -1);
  5199. 1 < b && (b = 1);
  5200. return function(a) {
  5201. return 0 == b ? a : 0 > b ? a * (a * -b + 1 + b) : a * ((2 - a) * b + (1 - b))
  5202. }
  5203. };
  5204. e.getPowIn = function(b) {
  5205. return function(a) {
  5206. return Math.pow(a, b)
  5207. }
  5208. };
  5209. e.getPowOut = function(b) {
  5210. return function(a) {
  5211. return 1 - Math.pow(1 - a, b)
  5212. }
  5213. };
  5214. e.getPowInOut = function(b) {
  5215. return function(a) {
  5216. return 1 > (a *= 2) ? 0.5 * Math.pow(a, b) : 1 - 0.5 * Math.abs(Math.pow(2 - a, b))
  5217. }
  5218. };
  5219. e.sineIn = function(b) {
  5220. return 1 - Math.cos(b * Math.PI / 2)
  5221. };
  5222. e.sineOut = function(b) {
  5223. return Math.sin(b * Math.PI / 2)
  5224. };
  5225. e.sineInOut = function(b) {
  5226. return -0.5 * (Math.cos(Math.PI * b) - 1)
  5227. };
  5228. e.getBackIn = function(b) {
  5229. return function(a) {
  5230. return a * a * ((b + 1) * a - b)
  5231. }
  5232. };
  5233. e.getBackOut = function(b) {
  5234. return function(a) {
  5235. return --a * a * ((b + 1) * a + b) + 1
  5236. }
  5237. };
  5238. e.getBackInOut = function(b) {
  5239. b *= 1.525;
  5240. return function(a) {
  5241. return 1 > (a *= 2) ? 0.5 * a * a * ((b + 1) * a - b) : 0.5 * ((a -= 2) * a * ((b + 1) * a + b) + 2)
  5242. }
  5243. };
  5244. e.circIn = function(b) {
  5245. return -(Math.sqrt(1 - b * b) - 1)
  5246. };
  5247. e.circOut = function(b) {
  5248. return Math.sqrt(1 - --b * b)
  5249. };
  5250. e.circInOut = function(b) {
  5251. return 1 > (b *= 2) ? -0.5 * (Math.sqrt(1 - b * b) - 1) : 0.5 * (Math.sqrt(1 - (b -= 2) * b) + 1)
  5252. };
  5253. e.bounceIn = function(b) {
  5254. return 1 - e.bounceOut(1 - b)
  5255. };
  5256. e.bounceOut = function(b) {
  5257. return b < 1 / 2.75 ? 7.5625 * b * b : b < 2 / 2.75 ? 7.5625 * (b -= 1.5 / 2.75) * b + 0.75 : b < 2.5 / 2.75 ? 7.5625 * (b -= 2.25 / 2.75) * b + 0.9375 : 7.5625 * (b -= 2.625 / 2.75) * b + 0.984375
  5258. };
  5259. e.bounceInOut = function(b) {
  5260. return 0.5 > b ? 0.5 * e.bounceIn(2 * b) : 0.5 * e.bounceOut(2 * b - 1) + 0.5
  5261. };
  5262. e.getElasticIn = function(b, a) {
  5263. var d = 2 * Math.PI;
  5264. return function(c) {
  5265. if (0 == c || 1 == c) return c;
  5266. var e = a / d * Math.asin(1 / b);
  5267. return -(b * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - e) * d / a))
  5268. }
  5269. };
  5270. e.getElasticOut = function(b, a) {
  5271. var d = 2 * Math.PI;
  5272. return function(c) {
  5273. if (0 == c || 1 == c) return c;
  5274. var e = a / d * Math.asin(1 / b);
  5275. return b * Math.pow(2, -10 * c) * Math.sin((c - e) * d / a) + 1
  5276. }
  5277. };
  5278. e.getElasticInOut = function(b, a) {
  5279. var d = 2 * Math.PI;
  5280. return function(c) {
  5281. var e = a / d * Math.asin(1 / b);
  5282. return 1 > (c *= 2) ? -0.5 * b * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - e) * d / a) : b * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - e) * d / a) * 0.5 + 1
  5283. }
  5284. };
  5285. e.quadIn = e.getPowIn(2);
  5286. e.quadOut = e.getPowOut(2);
  5287. e.quadInOut = e.getPowInOut(2);
  5288. e.cubicIn = e.getPowIn(3);
  5289. e.cubicOut = e.getPowOut(3);
  5290. e.cubicInOut = e.getPowInOut(3);
  5291. e.quartIn = e.getPowIn(4);
  5292. e.quartOut = e.getPowOut(4);
  5293. e.quartInOut = e.getPowInOut(4);
  5294. e.quintIn = e.getPowIn(5);
  5295. e.quintOut = e.getPowOut(5);
  5296. e.quintInOut = e.getPowInOut(5);
  5297. e.backIn = e.getBackIn(1.7);
  5298. e.backOut = e.getBackOut(1.7);
  5299. e.backInOut = e.getBackInOut(1.7);
  5300. e.elasticIn = e.getElasticIn(1, 0.3);
  5301. e.elasticOut = e.getElasticOut(1, 0.3);
  5302. e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
  5303. return e
  5304. }();
  5305. c.Ease = e;
  5306. e.prototype.__class__ = "egret.Ease"
  5307. })(egret || (egret = {}));
  5308. (function(c) {
  5309. var e = function() {
  5310. function c() {
  5311. this.type = c.EFFECT
  5312. }
  5313. c.prototype.play = function(b) {
  5314. void 0 === b && (b = !1);
  5315. var a = this.audio;
  5316. a && (isNaN(a.duration) || (a.currentTime = 0), a.loop = b, a.play())
  5317. };
  5318. c.prototype.pause = function() {
  5319. var b = this.audio;
  5320. b && b.pause()
  5321. };
  5322. c.prototype.load = function() {
  5323. var b = this.audio;
  5324. b && b.load()
  5325. };
  5326. c.prototype.addEventListener = function(b, a) {
  5327. this.audio && this.audio.addEventListener(b, a, !1)
  5328. };
  5329. c.prototype.removeEventListener = function(b, a) {
  5330. this.audio && this.audio.removeEventListener(b, a, !1)
  5331. };
  5332. c.prototype.setVolume = function(b) {
  5333. var a = this.audio;
  5334. a && (a.volume = b)
  5335. };
  5336. c.prototype.getVolume = function() {
  5337. return this.audio ? this.audio.volume : 0
  5338. };
  5339. c.prototype.preload = function(b) {
  5340. this.type = b
  5341. };
  5342. c.prototype._setAudio = function(b) {
  5343. this.audio = b
  5344. };
  5345. c.MUSIC = "music";
  5346. c.EFFECT = "effect";
  5347. return c
  5348. }();
  5349. c.Sound = e;
  5350. e.prototype.__class__ = "egret.Sound"
  5351. })(egret || (egret = {}));
  5352. (function(c) {
  5353. var e = function() {
  5354. function c() {}
  5355. c.isNumber = function(b) {
  5356. return "number" === typeof b && !isNaN(b)
  5357. };
  5358. c.sin = function(b) {
  5359. b = Math.round(b);
  5360. b %= 360;
  5361. 0 > b && (b += 360);
  5362. return 90 > b ? egret_sin_map[b] : 180 > b ? egret_cos_map[b - 90] : 270 > b ? -egret_sin_map[b - 180] : -egret_cos_map[b - 270]
  5363. };
  5364. c.cos = function(b) {
  5365. b = Math.round(b);
  5366. b %= 360;
  5367. 0 > b && (b += 360);
  5368. return 90 > b ? egret_cos_map[b] : 180 > b ? -egret_sin_map[b - 90] : 270 > b ? -egret_cos_map[b - 180] : egret_sin_map[b - 270]
  5369. };
  5370. return c
  5371. }();
  5372. c.NumberUtils = e;
  5373. e.prototype.__class__ = "egret.NumberUtils"
  5374. })(egret || (egret = {}));
  5375. for (var egret_sin_map = {}, egret_cos_map = {}, i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD), egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  5376. Function.prototype.bind || (Function.prototype.bind = function(c) {
  5377. if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5378. var e = Array.prototype.slice.call(arguments, 1),
  5379. f = this,
  5380. b = function() {}, a = function() {
  5381. return f.apply(this instanceof b && c ? this : c, e.concat(Array.prototype.slice.call(arguments)))
  5382. };
  5383. b.prototype = this.prototype;
  5384. a.prototype = new b;
  5385. return a
  5386. });
  5387. var __extends = this.__extends || function(c, e) {
  5388. function f() {
  5389. this.constructor = c
  5390. }
  5391. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5392. f.prototype = e.prototype;
  5393. c.prototype = new f
  5394. }, RES;
  5395. (function(c) {
  5396. var e = function(c) {
  5397. function b(a, d, b) {
  5398. void 0 === d && (d = !1);
  5399. void 0 === b && (b = !1);
  5400. c.call(this, a, d, b);
  5401. this.itemsTotal = this.itemsLoaded = 0
  5402. }
  5403. __extends(b, c);
  5404. b.dispatchResourceEvent = function(a, d, c, e, f, g) {
  5405. void 0 === c && (c = "");
  5406. void 0 === e && (e = null);
  5407. void 0 === f && (f = 0);
  5408. void 0 === g && (g = 0);
  5409. var h = egret.Event._getPropertyData(b);
  5410. h.groupName = c;
  5411. h.resItem = e;
  5412. h.itemsLoaded = f;
  5413. h.itemsTotal = g;
  5414. egret.Event._dispatchByTarget(b, a, d, h)
  5415. };
  5416. b.ITEM_LOAD_ERROR = "itemLoadError";
  5417. b.CONFIG_COMPLETE = "configComplete";
  5418. b.CONFIG_LOAD_ERROR = "configLoadError";
  5419. b.GROUP_PROGRESS = "groupProgress";
  5420. b.GROUP_COMPLETE = "groupComplete";
  5421. b.GROUP_LOAD_ERROR = "groupLoadError";
  5422. return b
  5423. }(egret.Event);
  5424. c.ResourceEvent = e;
  5425. e.prototype.__class__ = "RES.ResourceEvent"
  5426. })(RES || (RES = {}));
  5427. (function(c) {
  5428. var e = function() {
  5429. function c(b, a, d) {
  5430. this._loaded = !1;
  5431. this.name = b;
  5432. this.url = a;
  5433. this.type = d
  5434. }
  5435. Object.defineProperty(c.prototype, "loaded", {
  5436. get: function() {
  5437. return this.data ? this.data.loaded : this._loaded
  5438. },
  5439. set: function(b) {
  5440. this.data && (this.data.loaded = b);
  5441. this._loaded = b
  5442. },
  5443. enumerable: !0,
  5444. configurable: !0
  5445. });
  5446. c.prototype.toString = function() {
  5447. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5448. };
  5449. c.TYPE_XML = "xml";
  5450. c.TYPE_IMAGE = "image";
  5451. c.TYPE_BIN = "bin";
  5452. c.TYPE_TEXT = "text";
  5453. c.TYPE_JSON = "json";
  5454. c.TYPE_SHEET = "sheet";
  5455. c.TYPE_FONT = "font";
  5456. c.TYPE_SOUND = "sound";
  5457. return c
  5458. }();
  5459. c.ResourceItem = e;
  5460. e.prototype.__class__ = "RES.ResourceItem"
  5461. })(RES || (RES = {}));
  5462. (function(c) {
  5463. var e = function() {
  5464. function e() {
  5465. this.keyMap = {};
  5466. this.groupDic = {};
  5467. c.configInstance = this
  5468. }
  5469. e.prototype.getGroupByName = function(b) {
  5470. var a = [];
  5471. if (!this.groupDic[b]) return a;
  5472. b = this.groupDic[b];
  5473. for (var d = b.length, c = 0; c < d; c++) a.push(this.parseResourceItem(b[c]));
  5474. return a
  5475. };
  5476. e.prototype.getRawGroupByName = function(b) {
  5477. return this.groupDic[b] ? this.groupDic[b] : []
  5478. };
  5479. e.prototype.createGroup = function(b, a, d) {
  5480. void 0 === d && (d = !1);
  5481. if (!d && this.groupDic[b] || !a || 0 == a.length) return !1;
  5482. d = this.groupDic;
  5483. for (var c = [], e = a.length, f = 0; f < e; f++) {
  5484. var g = a[f],
  5485. h = d[g];
  5486. if (h)
  5487. for (var g = h.length, k = 0; k < g; k++) {
  5488. var l = h[k]; - 1 == c.indexOf(l) && c.push(l)
  5489. } else(l = this.keyMap[g]) && -1 == c.indexOf(l) && c.push(l)
  5490. }
  5491. if (0 == c.length) return !1;
  5492. this.groupDic[b] = c;
  5493. return !0
  5494. };
  5495. e.prototype.parseConfig = function(b, a) {
  5496. if (b) {
  5497. var d = b.resources;
  5498. if (d)
  5499. for (var c = d.length, e = 0; e < c; e++) {
  5500. var f = d[e],
  5501. g = f.url;
  5502. g && -1 == g.indexOf("://") && (f.url = a + g);
  5503. this.addItemToKeyMap(f)
  5504. }
  5505. if (d = b.groups)
  5506. for (c = d.length, e = 0; e < c; e++) {
  5507. for (var g = d[e], h = [], k = g.keys.split(","), l = k.length, m = 0; m < l; m++) f = k[m].trim(), (f = this.keyMap[f]) && -1 == h.indexOf(f) && h.push(f);
  5508. this.groupDic[g.name] = h
  5509. }
  5510. }
  5511. };
  5512. e.prototype.addSubkey = function(b, a) {
  5513. var d = this.keyMap[a];
  5514. d && !this.keyMap[b] && (this.keyMap[b] = d)
  5515. };
  5516. e.prototype.addItemToKeyMap = function(b) {
  5517. this.keyMap[b.name] || (this.keyMap[b.name] = b);
  5518. if (b.hasOwnProperty("subkeys")) {
  5519. var a = b.subkeys.split(",");
  5520. b.subkeys = a;
  5521. for (var d = a.length, c = 0; c < d; c++) {
  5522. var e = a[c];
  5523. null == this.keyMap[e] && (this.keyMap[e] = b)
  5524. }
  5525. }
  5526. };
  5527. e.prototype.getName = function(b) {
  5528. return (b = this.keyMap[b]) ? b.name : ""
  5529. };
  5530. e.prototype.getType = function(b) {
  5531. return (b = this.keyMap[b]) ? b.type : ""
  5532. };
  5533. e.prototype.getRawResourceItem = function(b) {
  5534. return this.keyMap[b]
  5535. };
  5536. e.prototype.getResourceItem = function(b) {
  5537. return (b = this.keyMap[b]) ? this.parseResourceItem(b) : null
  5538. };
  5539. e.prototype.parseResourceItem = function(b) {
  5540. var a = new c.ResourceItem(b.name, b.url, b.type);
  5541. a.data = b;
  5542. return a
  5543. };
  5544. return e
  5545. }();
  5546. c.ResourceConfig = e;
  5547. e.prototype.__class__ = "RES.ResourceConfig"
  5548. })(RES || (RES = {}));
  5549. __extends = this.__extends || function(c, e) {
  5550. function f() {
  5551. this.constructor = c
  5552. }
  5553. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5554. f.prototype = e.prototype;
  5555. c.prototype = new f
  5556. };
  5557. (function(c) {
  5558. var e = function(e) {
  5559. function b() {
  5560. e.call(this);
  5561. this.thread = 2;
  5562. this.loadingCount = 0;
  5563. this.groupTotalDic = {};
  5564. this.numLoadedDic = {};
  5565. this.itemListDic = {};
  5566. this.groupErrorDic = {};
  5567. this.retryTimesDic = {};
  5568. this.maxRetryTimes = 3;
  5569. this.failedList = [];
  5570. this.priorityQueue = {};
  5571. this.lazyLoadList = [];
  5572. this.analyzerDic = {};
  5573. this.queueIndex = 0
  5574. }
  5575. __extends(b, e);
  5576. b.prototype.isGroupInLoading = function(a) {
  5577. return void 0 !== this.itemListDic[a]
  5578. };
  5579. b.prototype.loadGroup = function(a, d, b) {
  5580. void 0 === b && (b = 0);
  5581. if (!this.itemListDic[d] && d)
  5582. if (a && 0 != a.length) {
  5583. this.priorityQueue[b] ? this.priorityQueue[b].push(d) : this.priorityQueue[b] = [d];
  5584. this.itemListDic[d] = a;
  5585. b = a.length;
  5586. for (var e = 0; e < b; e++) a[e].groupName = d;
  5587. this.groupTotalDic[d] = a.length;
  5588. this.numLoadedDic[d] = 0;
  5589. this.next()
  5590. } else egret.Logger.warning('RES加载了不存在或空的资源组:"' + d + '"'), a = new c.ResourceEvent(c.ResourceEvent.GROUP_LOAD_ERROR), a.groupName = d, this.dispatchEvent(a)
  5591. };
  5592. b.prototype.loadItem = function(a) {
  5593. this.lazyLoadList.push(a);
  5594. a.groupName = "";
  5595. this.next()
  5596. };
  5597. b.prototype.next = function() {
  5598. for (; this.loadingCount < this.thread;) {
  5599. var a = this.getOneResourceItem();
  5600. if (!a) break;
  5601. this.loadingCount++;
  5602. if (a.loaded) this.onItemComplete(a);
  5603. else {
  5604. var d = this.analyzerDic[a.type];
  5605. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  5606. d.loadFile(a, this.onItemComplete, this)
  5607. }
  5608. }
  5609. };
  5610. b.prototype.getOneResourceItem = function() {
  5611. if (0 < this.failedList.length) return this.failedList.shift();
  5612. var a = Number.NEGATIVE_INFINITY,
  5613. d;
  5614. for (d in this.priorityQueue) a = Math.max(a, d);
  5615. a = this.priorityQueue[a];
  5616. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  5617. d = a.length;
  5618. for (var b, c = 0; c < d; c++) {
  5619. this.queueIndex >= d && (this.queueIndex = 0);
  5620. b = this.itemListDic[a[this.queueIndex]];
  5621. if (0 < b.length) break;
  5622. this.queueIndex++
  5623. }
  5624. return 0 == b.length ? null : b.shift()
  5625. };
  5626. b.prototype.onItemComplete = function(a) {
  5627. this.loadingCount--;
  5628. var d = a.groupName;
  5629. if (!a.loaded) {
  5630. var b = this.retryTimesDic[a.name] || 1;
  5631. if (b > this.maxRetryTimes) delete this.retryTimesDic[a.name], c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  5632. else {
  5633. this.retryTimesDic[a.name] = b + 1;
  5634. this.failedList.push(a);
  5635. this.next();
  5636. return
  5637. }
  5638. }
  5639. if (d) {
  5640. this.numLoadedDic[d]++;
  5641. var b = this.numLoadedDic[d],
  5642. e = this.groupTotalDic[d];
  5643. a.loaded || (this.groupErrorDic[d] = !0);
  5644. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, d, a, b, e);
  5645. b == e && (a = this.groupErrorDic[d], this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], delete this.groupErrorDic[d], a ? c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_LOAD_ERROR, d) : c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d))
  5646. } else this.callBack.call(this.resInstance, a);
  5647. this.next()
  5648. };
  5649. b.prototype.removeGroupName = function(a) {
  5650. for (var d in this.priorityQueue) {
  5651. for (var b = this.priorityQueue[d], c = b.length, e = 0, f = !1, c = b.length, h = 0; h < c; h++) {
  5652. if (b[h] == a) {
  5653. b.splice(e, 1);
  5654. f = !0;
  5655. break
  5656. }
  5657. e++
  5658. }
  5659. if (f) {
  5660. 0 == b.length && delete this.priorityQueue[d];
  5661. break
  5662. }
  5663. }
  5664. };
  5665. return b
  5666. }(egret.EventDispatcher);
  5667. c.ResourceLoader = e;
  5668. e.prototype.__class__ = "RES.ResourceLoader"
  5669. })(RES || (RES = {}));
  5670. __extends = this.__extends || function(c, e) {
  5671. function f() {
  5672. this.constructor = c
  5673. }
  5674. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5675. f.prototype = e.prototype;
  5676. c.prototype = new f
  5677. };
  5678. (function(c) {
  5679. var e = function(e) {
  5680. function b() {
  5681. e.call(this);
  5682. this.resourceConfig = c.configInstance
  5683. }
  5684. __extends(b, e);
  5685. b.prototype.addSubkey = function(a, d) {
  5686. this.resourceConfig.addSubkey(a, d)
  5687. };
  5688. b.prototype.loadFile = function(a, d, b) {};
  5689. b.prototype.getRes = function(a) {};
  5690. b.prototype.destroyRes = function(a) {
  5691. return !1
  5692. };
  5693. b.getStringPrefix = function(a) {
  5694. if (!a) return "";
  5695. var d = a.indexOf(".");
  5696. return -1 != d ? a.substring(0, d) : ""
  5697. };
  5698. b.getStringTail = function(a) {
  5699. if (!a) return "";
  5700. var d = a.indexOf(".");
  5701. return -1 != d ? a.substring(d + 1) : ""
  5702. };
  5703. return b
  5704. }(egret.HashObject);
  5705. c.AnalyzerBase = e;
  5706. e.prototype.__class__ = "RES.AnalyzerBase"
  5707. })(RES || (RES = {}));
  5708. __extends = this.__extends || function(c, e) {
  5709. function f() {
  5710. this.constructor = c
  5711. }
  5712. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5713. f.prototype = e.prototype;
  5714. c.prototype = new f
  5715. };
  5716. (function(c) {
  5717. var e = function(c) {
  5718. function b() {
  5719. c.call(this);
  5720. this.fileDic = {};
  5721. this.resItemDic = [];
  5722. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  5723. this.recycler = new egret.Recycler
  5724. }
  5725. __extends(b, c);
  5726. b.prototype.loadFile = function(a, d, b) {
  5727. if (this.fileDic[a.name]) d.call(b, a);
  5728. else {
  5729. var c = this.getLoader();
  5730. this.resItemDic[c.hashCode] = {
  5731. item: a,
  5732. func: d,
  5733. thisObject: b
  5734. };
  5735. c.load(new egret.URLRequest(a.url))
  5736. }
  5737. };
  5738. b.prototype.getLoader = function() {
  5739. var a = this.recycler.pop();
  5740. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  5741. a.dataFormat = this._dataFormat;
  5742. return a
  5743. };
  5744. b.prototype.onLoadFinish = function(a) {
  5745. var d = a.target,
  5746. b = this.resItemDic[d.hashCode];
  5747. delete this.resItemDic[d.hashCode];
  5748. this.recycler.push(d);
  5749. var c = b.item,
  5750. e = b.func;
  5751. c.loaded = a.type == egret.Event.COMPLETE;
  5752. c.loaded && this.analyzeData(c, d.data);
  5753. e.call(b.thisObject, c)
  5754. };
  5755. b.prototype.analyzeData = function(a, d) {
  5756. var b = a.name;
  5757. !this.fileDic[b] && d && (this.fileDic[b] = d)
  5758. };
  5759. b.prototype.getRes = function(a) {
  5760. return this.fileDic[a]
  5761. };
  5762. b.prototype.hasRes = function(a) {
  5763. return null != this.getRes(a)
  5764. };
  5765. b.prototype.destroyRes = function(a) {
  5766. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  5767. };
  5768. return b
  5769. }(c.AnalyzerBase);
  5770. c.BinAnalyzer = e;
  5771. e.prototype.__class__ = "RES.BinAnalyzer"
  5772. })(RES || (RES = {}));
  5773. __extends = this.__extends || function(c, e) {
  5774. function f() {
  5775. this.constructor = c
  5776. }
  5777. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5778. f.prototype = e.prototype;
  5779. c.prototype = new f
  5780. };
  5781. (function(c) {
  5782. var e = function(c) {
  5783. function b() {
  5784. c.call(this);
  5785. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  5786. }
  5787. __extends(b, c);
  5788. b.prototype.analyzeData = function(a, d) {
  5789. var b = a.name;
  5790. !this.fileDic[b] && d && (this.fileDic[b] = d, (b = a.data) && b.scale9grid && (b = b.scale9grid.split(","), d.scale9Grid = new egret.Rectangle(parseInt(b[0]), parseInt(b[1]), parseInt(b[2]), parseInt(b[3]))))
  5791. };
  5792. return b
  5793. }(c.BinAnalyzer);
  5794. c.ImageAnalyzer = e;
  5795. e.prototype.__class__ = "RES.ImageAnalyzer"
  5796. })(RES || (RES = {}));
  5797. __extends = this.__extends || function(c, e) {
  5798. function f() {
  5799. this.constructor = c
  5800. }
  5801. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5802. f.prototype = e.prototype;
  5803. c.prototype = new f
  5804. };
  5805. (function(c) {
  5806. var e = function(c) {
  5807. function b() {
  5808. c.call(this);
  5809. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5810. }
  5811. __extends(b, c);
  5812. b.prototype.analyzeData = function(a, d) {
  5813. var b = a.name;
  5814. if (!this.fileDic[b] && d) try {
  5815. this.fileDic[b] = JSON.parse(d)
  5816. } catch (c) {
  5817. egret.Logger.warning("JSON文件格式不正确: " + a.url + "\ndata:" + d)
  5818. }
  5819. };
  5820. return b
  5821. }(c.BinAnalyzer);
  5822. c.JsonAnalyzer = e;
  5823. e.prototype.__class__ = "RES.JsonAnalyzer"
  5824. })(RES || (RES = {}));
  5825. __extends = this.__extends || function(c, e) {
  5826. function f() {
  5827. this.constructor = c
  5828. }
  5829. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5830. f.prototype = e.prototype;
  5831. c.prototype = new f
  5832. };
  5833. (function(c) {
  5834. var e = function(c) {
  5835. function b() {
  5836. c.call(this);
  5837. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5838. }
  5839. __extends(b, c);
  5840. return b
  5841. }(c.BinAnalyzer);
  5842. c.TextAnalyzer = e;
  5843. e.prototype.__class__ = "RES.TextAnalyzer"
  5844. })(RES || (RES = {}));
  5845. __extends = this.__extends || function(c, e) {
  5846. function f() {
  5847. this.constructor = c
  5848. }
  5849. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5850. f.prototype = e.prototype;
  5851. c.prototype = new f
  5852. };
  5853. (function(c) {
  5854. var e = function(e) {
  5855. function b() {
  5856. e.call(this);
  5857. this.sheetMap = {};
  5858. this.textureMap = {};
  5859. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5860. }
  5861. __extends(b, e);
  5862. b.prototype.getRes = function(a) {
  5863. var d = this.fileDic[a];
  5864. d || (d = this.textureMap[a]);
  5865. !d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = c.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  5866. return d
  5867. };
  5868. b.prototype.onLoadFinish = function(a) {
  5869. var d = a.target,
  5870. b = this.resItemDic[d.hashCode];
  5871. delete this.resItemDic[d.hashCode];
  5872. this.recycler.push(d);
  5873. var c = b.item,
  5874. e = b.func;
  5875. c.loaded = a.type == egret.Event.COMPLETE;
  5876. c.loaded && this.analyzeData(c, d.data);
  5877. "string" == typeof d.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(c, e, b.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : e.call(b.thisObject, c)
  5878. };
  5879. b.prototype.analyzeData = function(a, d) {
  5880. var b = a.name;
  5881. if (!this.fileDic[b] && d) {
  5882. var c;
  5883. if ("string" == typeof d) {
  5884. try {
  5885. c = JSON.parse(d)
  5886. } catch (e) {
  5887. egret.Logger.warning("JSON文件格式不正确: " + a.url)
  5888. }
  5889. c && (this.sheetMap[b] = c, a.loaded = !1, a.url = this.getRelativePath(a.url, c.file))
  5890. } else c = this.sheetMap[b], delete this.sheetMap[b], d && (c = this.parseSpriteSheet(d, c, a.data && a.data.subkeys ? "" : b), this.fileDic[b] = c)
  5891. }
  5892. };
  5893. b.prototype.getRelativePath = function(a, d) {
  5894. a = a.split("\\").join("/");
  5895. var b = a.lastIndexOf("/");
  5896. return a = -1 != b ? a.substring(0, b + 1) + d : d
  5897. };
  5898. b.prototype.parseSpriteSheet = function(a, d, b) {
  5899. d = d.frames;
  5900. if (!d) return null;
  5901. var c = new egret.SpriteSheet(a),
  5902. e = this.textureMap,
  5903. f;
  5904. for (f in d) {
  5905. var h = d[f];
  5906. a = c.createTexture(f, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH);
  5907. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  5908. null == e[f] && (e[f] = a, b && this.addSubkey(f, b))
  5909. }
  5910. return c
  5911. };
  5912. return b
  5913. }(c.BinAnalyzer);
  5914. c.SheetAnalyzer = e;
  5915. e.prototype.__class__ = "RES.SheetAnalyzer"
  5916. })(RES || (RES = {}));
  5917. __extends = this.__extends || function(c, e) {
  5918. function f() {
  5919. this.constructor = c
  5920. }
  5921. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5922. f.prototype = e.prototype;
  5923. c.prototype = new f
  5924. };
  5925. (function(c) {
  5926. var e = function(c) {
  5927. function b() {
  5928. c.call(this)
  5929. }
  5930. __extends(b, c);
  5931. b.prototype.analyzeData = function(a, d) {
  5932. var b = a.name;
  5933. if (!this.fileDic[b] && d) {
  5934. var c;
  5935. "string" == typeof d ? (c = d, this.sheetMap[b] = c, a.loaded = !1, a.url = this.getTexturePath(a.url, c)) : (c = this.sheetMap[b], delete this.sheetMap[b], d && (c = new egret.BitmapTextSpriteSheet(d, c), this.fileDic[b] = c))
  5936. }
  5937. };
  5938. b.prototype.getTexturePath = function(a, d) {
  5939. var b = "",
  5940. c = d.split("\n")[2],
  5941. e = c.indexOf('file="'); - 1 != e && (c = c.substring(e + 6), e = c.indexOf('"'), b = c.substring(0, e));
  5942. a = a.split("\\").join("/");
  5943. e = a.lastIndexOf("/");
  5944. return a = -1 != e ? a.substring(0, e + 1) + b : b
  5945. };
  5946. return b
  5947. }(c.SheetAnalyzer);
  5948. c.FontAnalyzer = e;
  5949. e.prototype.__class__ = "RES.FontAnalyzer"
  5950. })(RES || (RES = {}));
  5951. __extends = this.__extends || function(c, e) {
  5952. function f() {
  5953. this.constructor = c
  5954. }
  5955. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5956. f.prototype = e.prototype;
  5957. c.prototype = new f
  5958. };
  5959. (function(c) {
  5960. var e = function(c) {
  5961. function b() {
  5962. c.call(this);
  5963. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  5964. }
  5965. __extends(b, c);
  5966. b.prototype.analyzeData = function(a, d) {
  5967. var b = a.name;
  5968. !this.fileDic[b] && d && (this.fileDic[b] = d, (b = a.data) && b.soundType ? d.preload(b.soundType) : d.preload(egret.Sound.EFFECT))
  5969. };
  5970. return b
  5971. }(c.BinAnalyzer);
  5972. c.SoundAnalyzer = e;
  5973. e.prototype.__class__ = "RES.SoundAnalyzer"
  5974. })(RES || (RES = {}));
  5975. __extends = this.__extends || function(c, e) {
  5976. function f() {
  5977. this.constructor = c
  5978. }
  5979. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  5980. f.prototype = e.prototype;
  5981. c.prototype = new f
  5982. };
  5983. (function(c) {
  5984. var e = function(c) {
  5985. function b() {
  5986. c.call(this);
  5987. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5988. }
  5989. __extends(b, c);
  5990. b.prototype.analyzeData = function(a, d) {
  5991. var b = a.name;
  5992. if (!this.fileDic[b] && d) try {
  5993. var c = egret.XML.parse(d);
  5994. this.fileDic[b] = c
  5995. } catch (e) {}
  5996. };
  5997. return b
  5998. }(c.BinAnalyzer);
  5999. c.XMLAnalyzer = e;
  6000. e.prototype.__class__ = "RES.XMLAnalyzer"
  6001. })(RES || (RES = {}));
  6002. __extends = this.__extends || function(c, e) {
  6003. function f() {
  6004. this.constructor = c
  6005. }
  6006. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  6007. f.prototype = e.prototype;
  6008. c.prototype = new f
  6009. };
  6010. (function(c) {
  6011. c.loadConfig = function(b, a, d) {
  6012. void 0 === a && (a = "");
  6013. void 0 === d && (d = "json");
  6014. f.loadConfig(b, a, d)
  6015. };
  6016. c.loadGroup = function(b, a) {
  6017. void 0 === a && (a = 0);
  6018. f.loadGroup(b, a)
  6019. };
  6020. c.isGroupLoaded = function(b) {
  6021. return f.isGroupLoaded(b)
  6022. };
  6023. c.getGroupByName = function(b) {
  6024. return f.getGroupByName(b)
  6025. };
  6026. c.createGroup = function(b, a, d) {
  6027. void 0 === d && (d = !1);
  6028. return f.createGroup(b, a, d)
  6029. };
  6030. c.hasRes = function(b) {
  6031. return f.hasRes(b)
  6032. };
  6033. c.getRes = function(b) {
  6034. return f.getRes(b)
  6035. };
  6036. c.getResAsync = function(b, a, d) {
  6037. f.getResAsync(b, a, d)
  6038. };
  6039. c.getResByUrl = function(b, a, d, c) {
  6040. void 0 === c && (c = "");
  6041. f.getResByUrl(b, a, d, c)
  6042. };
  6043. c.destroyRes = function(b) {
  6044. return f.destroyRes(b)
  6045. };
  6046. c.setMaxLoadingThread = function(b) {
  6047. f.setMaxLoadingThread(b)
  6048. };
  6049. c.addEventListener = function(b, a, d, c, e) {
  6050. void 0 === c && (c = !1);
  6051. void 0 === e && (e = 0);
  6052. f.addEventListener(b, a, d, c, e)
  6053. };
  6054. c.removeEventListener = function(b, a, d, c) {
  6055. void 0 === c && (c = !1);
  6056. f.removeEventListener(b, a, d, c)
  6057. };
  6058. var e = function(b) {
  6059. function a() {
  6060. b.call(this);
  6061. this.analyzerDic = {};
  6062. this.configItemList = [];
  6063. this.configComplete = this.callLaterFlag = !1;
  6064. this.loadedGroups = [];
  6065. this.groupNameList = [];
  6066. this.asyncDic = {};
  6067. this.init()
  6068. }
  6069. __extends(a, b);
  6070. a.prototype.getAnalyzerByType = function(d) {
  6071. var a = this.analyzerDic[d];
  6072. a || (a = this.analyzerDic[d] = egret.Injector.getInstance(c.AnalyzerBase, d));
  6073. return a
  6074. };
  6075. a.prototype.init = function() {
  6076. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  6077. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  6078. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  6079. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  6080. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  6081. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  6082. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  6083. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  6084. this.resConfig = new c.ResourceConfig;
  6085. this.resLoader = new c.ResourceLoader;
  6086. this.resLoader.callBack = this.onResourceItemComp;
  6087. this.resLoader.resInstance = this;
  6088. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  6089. this.resLoader.addEventListener(c.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  6090. };
  6091. a.prototype.loadConfig = function(d, a, b) {
  6092. void 0 === b && (b = "json");
  6093. this.configItemList.push({
  6094. url: d,
  6095. resourceRoot: a,
  6096. type: b
  6097. });
  6098. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6099. };
  6100. a.prototype.startLoadConfig = function() {
  6101. this.callLaterFlag = !1;
  6102. var d = this.configItemList;
  6103. this.configItemList = [];
  6104. this.loadingConfigList = d;
  6105. for (var b = d.length, e = [], f = 0; f < b; f++) {
  6106. var g = d[f],
  6107. g = new c.ResourceItem(g.url, g.url, g.type);
  6108. e.push(g)
  6109. }
  6110. this.resLoader.loadGroup(e, a.GROUP_CONFIG, Number.MAX_VALUE)
  6111. };
  6112. a.prototype.isGroupLoaded = function(d) {
  6113. return -1 != this.loadedGroups.indexOf(d)
  6114. };
  6115. a.prototype.getGroupByName = function(d) {
  6116. return this.resConfig.getGroupByName(d)
  6117. };
  6118. a.prototype.loadGroup = function(d, a) {
  6119. void 0 === a && (a = 0);
  6120. if (-1 != this.loadedGroups.indexOf(d)) c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d);
  6121. else if (!this.resLoader.isGroupInLoading(d))
  6122. if (this.configComplete) {
  6123. var b = this.resConfig.getGroupByName(d);
  6124. this.resLoader.loadGroup(b, d, a)
  6125. } else this.groupNameList.push({
  6126. name: d,
  6127. priority: a
  6128. })
  6129. };
  6130. a.prototype.createGroup = function(d, a, b) {
  6131. void 0 === b && (b = !1);
  6132. if (b) {
  6133. var c = this.loadedGroups.indexOf(d); - 1 != c && this.loadedGroups.splice(c, 1)
  6134. }
  6135. return this.resConfig.createGroup(d, a, b)
  6136. };
  6137. a.prototype.onGroupComp = function(d) {
  6138. if (d.groupName == a.GROUP_CONFIG) {
  6139. d = this.loadingConfigList.length;
  6140. for (var b = 0; b < d; b++) {
  6141. var e = this.loadingConfigList[b],
  6142. f = this.getAnalyzerByType(e.type),
  6143. g = f.getRes(e.url);
  6144. f.destroyRes(e.url);
  6145. this.resConfig.parseConfig(g, e.resourceRoot)
  6146. }
  6147. this.configComplete = !0;
  6148. this.loadingConfigList = null;
  6149. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  6150. e = this.groupNameList;
  6151. d = e.length;
  6152. for (b = 0; b < d; b++) f = e[b], this.loadGroup(f.name, f.priority);
  6153. this.groupNameList = []
  6154. } else this.loadedGroups.push(d.groupName), this.dispatchEvent(d)
  6155. };
  6156. a.prototype.onGroupError = function(d) {
  6157. d.groupName == a.GROUP_CONFIG ? (this.loadingConfigList = null, c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(d)
  6158. };
  6159. a.prototype.hasRes = function(d) {
  6160. var a = this.resConfig.getType(d);
  6161. return "" == a && (d = c.AnalyzerBase.getStringPrefix(d), a = this.resConfig.getType(d), "" == a) ? !1 : !0
  6162. };
  6163. a.prototype.getRes = function(d) {
  6164. var a = this.resConfig.getType(d);
  6165. return "" == a && (a = c.AnalyzerBase.getStringPrefix(d), a = this.resConfig.getType(a), "" == a) ? null : this.getAnalyzerByType(a).getRes(d)
  6166. };
  6167. a.prototype.getResAsync = function(d, a, b) {
  6168. var e = this.resConfig.getType(d),
  6169. f = this.resConfig.getName(d);
  6170. if ("" == e && (f = c.AnalyzerBase.getStringPrefix(d), e = this.resConfig.getType(f), "" == e)) {
  6171. a.call(b, null);
  6172. return
  6173. }(e = this.getAnalyzerByType(e).getRes(d)) ? a.call(b, e) : (d = {
  6174. key: d,
  6175. compFunc: a,
  6176. thisObject: b
  6177. }, this.asyncDic[f] ? this.asyncDic[f].push(d) : (this.asyncDic[f] = [d], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6178. };
  6179. a.prototype.getResByUrl = function(d, a, b, e) {
  6180. void 0 === e && (e = "");
  6181. if (d) {
  6182. e || (e = this.getTypeByUrl(d));
  6183. var f = this.getAnalyzerByType(e).getRes(d);
  6184. f ? a.call(b, f) : (a = {
  6185. key: d,
  6186. compFunc: a,
  6187. thisObject: b
  6188. }, this.asyncDic[d] ? this.asyncDic[d].push(a) : (this.asyncDic[d] = [a], d = new c.ResourceItem(d, d, e), this.resLoader.loadItem(d)))
  6189. } else a.call(b, null)
  6190. };
  6191. a.prototype.getTypeByUrl = function(d) {
  6192. (d = d.substr(d.lastIndexOf(".") + 1)) && (d = d.toLowerCase());
  6193. switch (d) {
  6194. case c.ResourceItem.TYPE_XML:
  6195. case c.ResourceItem.TYPE_JSON:
  6196. case c.ResourceItem.TYPE_SHEET:
  6197. break;
  6198. case "png":
  6199. case "jpg":
  6200. case "gif":
  6201. d = c.ResourceItem.TYPE_IMAGE;
  6202. break;
  6203. case "fnt":
  6204. d = c.ResourceItem.TYPE_FONT;
  6205. break;
  6206. case "txt":
  6207. d = c.ResourceItem.TYPE_TEXT;
  6208. break;
  6209. case "mp3":
  6210. case "ogg":
  6211. case "mpeg":
  6212. case "wav":
  6213. case "m4a":
  6214. case "mp4":
  6215. case "aiff":
  6216. case "wma":
  6217. case "mid":
  6218. d = c.ResourceItem.TYPE_SOUND;
  6219. break;
  6220. default:
  6221. d = c.ResourceItem.TYPE_BIN
  6222. }
  6223. return d
  6224. };
  6225. a.prototype.onResourceItemComp = function(d) {
  6226. var a = this.asyncDic[d.name];
  6227. delete this.asyncDic[d.name];
  6228. d = this.getAnalyzerByType(d.type);
  6229. for (var b = a.length, c = 0; c < b; c++) {
  6230. var e = a[c],
  6231. f = d.getRes(e.key);
  6232. e.compFunc.call(e.thisObject, f, e.key)
  6233. }
  6234. };
  6235. a.prototype.destroyRes = function(d) {
  6236. var a = this.resConfig.getRawGroupByName(d);
  6237. if (a) {
  6238. var b = this.loadedGroups.indexOf(d); - 1 != b && this.loadedGroups.splice(b, 1);
  6239. d = a.length;
  6240. for (var c = 0; c < d; c++) {
  6241. b = a[c];
  6242. b.loaded = !1;
  6243. var e = this.getAnalyzerByType(b.type);
  6244. e.destroyRes(b.name)
  6245. }
  6246. return !0
  6247. }
  6248. a = this.resConfig.getType(d);
  6249. if ("" == a) return !1;
  6250. b = this.resConfig.getRawResourceItem(d);
  6251. b.loaded = !1;
  6252. e = this.getAnalyzerByType(a);
  6253. return e.destroyRes(d)
  6254. };
  6255. a.prototype.setMaxLoadingThread = function(d) {
  6256. 1 > d && (d = 1);
  6257. this.resLoader.thread = d
  6258. };
  6259. a.GROUP_CONFIG = "RES__CONFIG";
  6260. return a
  6261. }(egret.EventDispatcher);
  6262. e.prototype.__class__ = "RES.Resource";
  6263. var f = new e
  6264. })(RES || (RES = {}));
  6265. __extends = this.__extends || function(c, e) {
  6266. function f() {
  6267. this.constructor = c
  6268. }
  6269. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  6270. f.prototype = e.prototype;
  6271. c.prototype = new f
  6272. };
  6273. (function(c) {
  6274. (function(e) {
  6275. var f = function(b) {
  6276. function a() {
  6277. b.call(this);
  6278. this.targetLevel = Number.MAX_VALUE;
  6279. this.updateCompleteQueue = new e.DepthQueue;
  6280. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  6281. this.invalidatePropertiesQueue = new e.DepthQueue;
  6282. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  6283. this.invalidateSizeQueue = new e.DepthQueue;
  6284. this.invalidateDisplayListFlag = !1;
  6285. this.invalidateDisplayListQueue = new e.DepthQueue;
  6286. this.listenersAttached = !1
  6287. }
  6288. __extends(a, b);
  6289. a.prototype.invalidateProperties = function(d) {
  6290. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  6291. this.targetLevel <= d.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  6292. this.invalidatePropertiesQueue.insert(d)
  6293. };
  6294. a.prototype.validateProperties = function() {
  6295. for (var d = this.invalidatePropertiesQueue.shift(); d;) d.parent && (d.validateProperties(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)), d = this.invalidatePropertiesQueue.shift();
  6296. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  6297. };
  6298. a.prototype.invalidateSize = function(d) {
  6299. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  6300. this.targetLevel <= d.nestLevel && (this.invalidateClientSizeFlag = !0);
  6301. this.invalidateSizeQueue.insert(d)
  6302. };
  6303. a.prototype.validateSize = function() {
  6304. for (var d = this.invalidateSizeQueue.pop(); d;) d.parent && (d.validateSize(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)), d = this.invalidateSizeQueue.pop();
  6305. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  6306. };
  6307. a.prototype.invalidateDisplayList = function(d) {
  6308. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  6309. this.invalidateDisplayListQueue.insert(d)
  6310. };
  6311. a.prototype.validateDisplayList = function() {
  6312. for (var d = this.invalidateDisplayListQueue.shift(); d;) d.parent && (d.validateDisplayList(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)), d = this.invalidateDisplayListQueue.shift();
  6313. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  6314. };
  6315. a.prototype.attachListeners = function() {
  6316. e.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  6317. e.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  6318. e.UIGlobals.stage.invalidate();
  6319. this.listenersAttached = !0
  6320. };
  6321. a.prototype.doPhasedInstantiationCallBack = function(d) {
  6322. e.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  6323. e.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  6324. this.doPhasedInstantiation()
  6325. };
  6326. a.prototype.doPhasedInstantiation = function() {
  6327. this.invalidatePropertiesFlag && this.validateProperties();
  6328. this.invalidateSizeFlag && this.validateSize();
  6329. this.invalidateDisplayListFlag && this.validateDisplayList();
  6330. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  6331. else {
  6332. this.listenersAttached = !1;
  6333. for (var d = this.updateCompleteQueue.pop(); d;) d.initialized || (d.initialized = !0), d.hasEventListener(e.UIEvent.UPDATE_COMPLETE) && e.UIEvent.dispatchUIEvent(d, e.UIEvent.UPDATE_COMPLETE), d.updateCompletePendingFlag = !1, d = this.updateCompleteQueue.pop();
  6334. e.UIEvent.dispatchUIEvent(this, e.UIEvent.UPDATE_COMPLETE)
  6335. }
  6336. };
  6337. a.prototype.validateNow = function() {
  6338. for (var d = 0; this.listenersAttached && 100 > d++;) this.doPhasedInstantiationCallBack()
  6339. };
  6340. a.prototype.validateClient = function(d, a) {
  6341. void 0 === a && (a = !1);
  6342. var b, c = !1,
  6343. f = this.targetLevel;
  6344. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = d.nestLevel);
  6345. for (; !c;) {
  6346. c = !0;
  6347. for (b = this.invalidatePropertiesQueue.removeSmallestChild(d); b;) b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidatePropertiesQueue.removeSmallestChild(d);
  6348. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  6349. this.invalidateClientPropertiesFlag = !1;
  6350. for (b = this.invalidateSizeQueue.removeLargestChild(d); b;) {
  6351. b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0));
  6352. if (this.invalidateClientPropertiesFlag && (b = this.invalidatePropertiesQueue.removeSmallestChild(d))) {
  6353. this.invalidatePropertiesQueue.insert(b);
  6354. c = !1;
  6355. break
  6356. }
  6357. b = this.invalidateSizeQueue.removeLargestChild(d)
  6358. }
  6359. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  6360. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  6361. if (!a) {
  6362. for (b = this.invalidateDisplayListQueue.removeSmallestChild(d); b;) {
  6363. b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0));
  6364. if (this.invalidateClientPropertiesFlag && (b = this.invalidatePropertiesQueue.removeSmallestChild(d))) {
  6365. this.invalidatePropertiesQueue.insert(b);
  6366. c = !1;
  6367. break
  6368. }
  6369. if (this.invalidateClientSizeFlag && (b = this.invalidateSizeQueue.removeLargestChild(d))) {
  6370. this.invalidateSizeQueue.insert(b);
  6371. c = !1;
  6372. break
  6373. }
  6374. b = this.invalidateDisplayListQueue.removeSmallestChild(d)
  6375. }
  6376. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  6377. }
  6378. }
  6379. if (f == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a))
  6380. for (b = this.updateCompleteQueue.removeLargestChild(d); b;) 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.removeLargestChild(d)
  6381. };
  6382. return a
  6383. }(c.EventDispatcher);
  6384. e.LayoutManager = f;
  6385. f.prototype.__class__ = "egret.gui.LayoutManager"
  6386. })(c.gui || (c.gui = {}))
  6387. })(egret || (egret = {}));
  6388. (function(c) {
  6389. (function(e) {
  6390. var f = function() {
  6391. function a() {
  6392. this.depthBins = [];
  6393. this.minDepth = 0;
  6394. this.maxDepth = -1
  6395. }
  6396. a.prototype.insert = function(d) {
  6397. var a = d.nestLevel,
  6398. c = d.hashCode;
  6399. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a : (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  6400. var e = this.depthBins[a];
  6401. e ? null == e.items[c] && (e.items[c] = d, e.length++) : (e = new b, this.depthBins[a] = e, e.items[c] = d, e.length++)
  6402. };
  6403. a.prototype.pop = function() {
  6404. var d = null;
  6405. if (this.minDepth <= this.maxDepth) {
  6406. for (var a = this.depthBins[this.maxDepth]; !a || 0 == a.length;) {
  6407. this.maxDepth--;
  6408. if (this.maxDepth < this.minDepth) return null;
  6409. a = this.depthBins[this.maxDepth]
  6410. }
  6411. var b = a.items,
  6412. c;
  6413. for (c in b) {
  6414. d = b[c];
  6415. this.remove(d, this.maxDepth);
  6416. break
  6417. }
  6418. for (; !a || 0 == a.length;) {
  6419. this.maxDepth--;
  6420. if (this.maxDepth < this.minDepth) break;
  6421. a = this.depthBins[this.maxDepth]
  6422. }
  6423. }
  6424. return d
  6425. };
  6426. a.prototype.shift = function() {
  6427. var d = null;
  6428. if (this.minDepth <= this.maxDepth) {
  6429. for (var a = this.depthBins[this.minDepth]; !a || 0 == a.length;) {
  6430. this.minDepth++;
  6431. if (this.minDepth > this.maxDepth) return null;
  6432. a = this.depthBins[this.minDepth]
  6433. }
  6434. var b = a.items,
  6435. c;
  6436. for (c in b) {
  6437. d = b[c];
  6438. this.remove(d, this.minDepth);
  6439. break
  6440. }
  6441. for (; !a || 0 == a.length;) {
  6442. this.minDepth++;
  6443. if (this.minDepth > this.maxDepth) break;
  6444. a = this.depthBins[this.minDepth]
  6445. }
  6446. }
  6447. return d
  6448. };
  6449. a.prototype.removeLargestChild = function(d) {
  6450. for (var a = this.maxDepth, b = d.nestLevel, e = d.hashCode; b <= a;) {
  6451. var f = this.depthBins[a];
  6452. if (f && 0 < f.length) {
  6453. if (a == d.nestLevel) {
  6454. if (f.items[e]) return this.remove(d, a), d
  6455. } else {
  6456. var f = f.items,
  6457. h;
  6458. for (h in f) {
  6459. var k = f[h];
  6460. if (k instanceof c.DisplayObject && d instanceof c.DisplayObjectContainer && d.contains(k)) return this.remove(k, a), k
  6461. }
  6462. }
  6463. a--
  6464. } else if (a == this.maxDepth && this.maxDepth--, a--, a < b) break
  6465. }
  6466. return null
  6467. };
  6468. a.prototype.removeSmallestChild = function(d) {
  6469. for (var a = d.nestLevel, b = d.hashCode; a <= this.maxDepth;) {
  6470. var e = this.depthBins[a];
  6471. if (e && 0 < e.length) {
  6472. if (a == d.nestLevel) {
  6473. if (e.items[b]) return this.remove(d, a), d
  6474. } else {
  6475. var e = e.items,
  6476. f;
  6477. for (f in e) {
  6478. var h = e[f];
  6479. if (h instanceof c.DisplayObject && d instanceof c.DisplayObjectContainer && d.contains(h)) return this.remove(h, a), h
  6480. }
  6481. }
  6482. a++
  6483. } else if (a == this.minDepth && this.minDepth++, a++, a > this.maxDepth) break
  6484. }
  6485. return null
  6486. };
  6487. a.prototype.remove = function(d, a) {
  6488. void 0 === a && (a = -1);
  6489. var b = d.hashCode,
  6490. c = this.depthBins[0 <= a ? a : d.nestLevel];
  6491. return c && null != c.items[b] ? (delete c.items[b], c.length--, d) : null
  6492. };
  6493. a.prototype.removeAll = function() {
  6494. this.minDepth = this.depthBins.length = 0;
  6495. this.maxDepth = -1
  6496. };
  6497. a.prototype.isEmpty = function() {
  6498. return this.minDepth > this.maxDepth
  6499. };
  6500. return a
  6501. }();
  6502. e.DepthQueue = f;
  6503. f.prototype.__class__ = "egret.gui.DepthQueue";
  6504. var b = function() {
  6505. return function() {
  6506. this.length = 0;
  6507. this.items = []
  6508. }
  6509. }();
  6510. e.DepthBin = b;
  6511. b.prototype.__class__ = "egret.gui.DepthBin"
  6512. })(c.gui || (c.gui = {}))
  6513. })(egret || (egret = {}));
  6514. (function(c) {
  6515. (function(c) {
  6516. var f = function() {
  6517. function b() {}
  6518. Object.defineProperty(b, "stage", {
  6519. get: function() {
  6520. return b._stage
  6521. },
  6522. enumerable: !0,
  6523. configurable: !0
  6524. });
  6525. b._initlize = function(a) {
  6526. b.initlized || (b._stage = a, b._layoutManager = new c.LayoutManager, b.initlized = !0)
  6527. };
  6528. Object.defineProperty(b, "uiStage", {
  6529. get: function() {
  6530. return b._uiStage
  6531. },
  6532. enumerable: !0,
  6533. configurable: !0
  6534. });
  6535. b.initlized = !1;
  6536. return b
  6537. }();
  6538. c.UIGlobals = f;
  6539. f.prototype.__class__ = "egret.gui.UIGlobals"
  6540. })(c.gui || (c.gui = {}))
  6541. })(egret || (egret = {}));
  6542. __extends = this.__extends || function(c, e) {
  6543. function f() {
  6544. this.constructor = c
  6545. }
  6546. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  6547. f.prototype = e.prototype;
  6548. c.prototype = new f
  6549. };
  6550. (function(c) {
  6551. (function(e) {
  6552. var f = function(b) {
  6553. function a() {
  6554. b.call(this);
  6555. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  6556. this._nestLevel = 0;
  6557. this._hasOwnStyleChain = !1;
  6558. this._styleProtoChain = null;
  6559. this._hasNoStyleChild = !1;
  6560. this._enabled = !0;
  6561. this._minWidth = this._height = this._width = 0;
  6562. this._maxWidth = 1E4;
  6563. this._minHeight = 0;
  6564. this._maxHeight = 1E4;
  6565. this._measuredHeight = this._measuredWidth = 0;
  6566. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  6567. this._includeInLayout = !0;
  6568. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  6569. this.touchEnabled = !0;
  6570. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6571. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this);
  6572. void 0 === a.prototypeCanSet && (a.prototypeCanSet = void 0 !== {}.__proto__)
  6573. }
  6574. __extends(a, b);
  6575. a.prototype.onAddedToStage = function(d) {
  6576. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6577. this._initialize();
  6578. e.UIGlobals._initlize(this.stage);
  6579. 0 < this._nestLevel && this.checkInvalidateFlag()
  6580. };
  6581. Object.defineProperty(a.prototype, "id", {
  6582. get: function() {
  6583. return this._id
  6584. },
  6585. set: function(d) {
  6586. this._id = d
  6587. },
  6588. enumerable: !0,
  6589. configurable: !0
  6590. });
  6591. Object.defineProperty(a.prototype, "isPopUp", {
  6592. get: function() {
  6593. return this._isPopUp
  6594. },
  6595. set: function(d) {
  6596. this._isPopUp = d
  6597. },
  6598. enumerable: !0,
  6599. configurable: !0
  6600. });
  6601. Object.defineProperty(a.prototype, "owner", {
  6602. get: function() {
  6603. return this._owner ? this._owner : this.parent
  6604. },
  6605. enumerable: !0,
  6606. configurable: !0
  6607. });
  6608. a.prototype.ownerChanged = function(d) {
  6609. this._owner = d
  6610. };
  6611. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  6612. get: function() {
  6613. return this._updateCompletePendingFlag
  6614. },
  6615. set: function(d) {
  6616. this._updateCompletePendingFlag = d
  6617. },
  6618. enumerable: !0,
  6619. configurable: !0
  6620. });
  6621. Object.defineProperty(a.prototype, "initialized", {
  6622. get: function() {
  6623. return this._initialized
  6624. },
  6625. set: function(d) {
  6626. this._initialized != d && (this._initialized = d) && (this.childrenCreated(), e.UIEvent.dispatchUIEvent(this, e.UIEvent.CREATION_COMPLETE))
  6627. },
  6628. enumerable: !0,
  6629. configurable: !0
  6630. });
  6631. a.prototype._initialize = function() {
  6632. this.initializeCalled || (e.UIGlobals.stage && this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, e.UIEvent.dispatchUIEvent(this, e.UIEvent.INITIALIZE), this.createChildren(), this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  6633. };
  6634. a.prototype.createChildren = function() {};
  6635. a.prototype.childrenCreated = function() {};
  6636. Object.defineProperty(a.prototype, "nestLevel", {
  6637. get: function() {
  6638. return this._nestLevel
  6639. },
  6640. set: function(d) {
  6641. this._nestLevel != d && (this._nestLevel = d, 0 == this._nestLevel ? this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this), this._updateChildrenNestLevel())
  6642. },
  6643. enumerable: !0,
  6644. configurable: !0
  6645. });
  6646. a.prototype._updateChildrenNestLevel = function() {
  6647. for (var d = this.numChildren - 1; 0 <= d; d--) {
  6648. var a = this.getChildAt(d);
  6649. a && "nestLevel" in a && (a.nestLevel = this._nestLevel + 1)
  6650. }
  6651. };
  6652. a.prototype.getStyle = function(d) {
  6653. var a = this._styleProtoChain;
  6654. return a ? a[d] : void 0
  6655. };
  6656. a.prototype.setStyle = function(d, a) {
  6657. var b = this._styleProtoChain;
  6658. this._hasOwnStyleChain || (b = this._createOwnStyleProtoChain(b));
  6659. b[d] = a;
  6660. this.styleChanged(d);
  6661. this.notifyStyleChangeInChildren(d)
  6662. };
  6663. a.prototype.styleChanged = function(d) {};
  6664. a.prototype.notifyStyleChangeInChildren = function(d) {
  6665. if (!this._hasNoStyleChild)
  6666. for (var a = this.numChildren - 1; 0 <= a; a--) {
  6667. var b = this.getChildAt(a);
  6668. b && "styleChanged" in b && (b.styleChanged(d), b.notifyStyleChangeInChildren(d))
  6669. }
  6670. };
  6671. a.prototype._createOwnStyleProtoChain = function(d) {
  6672. this._hasOwnStyleChain = !0;
  6673. a.prototypeCanSet ? (this._styleProtoChain = {}, this._styleProtoChain.__proto__ = d ? d : a.emptyStyleChain) : this._styleProtoChain = this.createProtoChain(d);
  6674. d = this._styleProtoChain;
  6675. if (!this._hasNoStyleChild)
  6676. for (var b = this.numChildren - 1; 0 <= b; b--) {
  6677. var c = this.getChildAt(b);
  6678. c && "regenerateStyleCache" in c && c.regenerateStyleCache(d)
  6679. }
  6680. return d
  6681. };
  6682. a.prototype.createProtoChain = function(d) {
  6683. function a() {}
  6684. a.prototype = d;
  6685. d = new a;
  6686. a.prototype = null;
  6687. return d
  6688. };
  6689. a.prototype.clearStyle = function(d) {
  6690. this._hasOwnStyleChain && (delete this._styleProtoChain[d], this.styleChanged(d), this.notifyStyleChangeInChildren(d))
  6691. };
  6692. a.prototype.regenerateStyleCache = function(d) {
  6693. if (!a.prototypeCanSet) this.regenerateStyleCacheForIE(d);
  6694. else if (this._hasOwnStyleChain) this._styleProtoChain.__proto__ = d ? d : a.emptyStyleChain;
  6695. else if (this._styleProtoChain != d) {
  6696. this._styleProtoChain = d;
  6697. for (var b = this.numChildren - 1; 0 <= b; b--) {
  6698. var c = this.getChildAt(b);
  6699. c && "regenerateStyleCache" in c && c.regenerateStyleCache(d)
  6700. }
  6701. }
  6702. };
  6703. a.prototype.regenerateStyleCacheForIE = function(d) {
  6704. if (this._hasOwnStyleChain) {
  6705. var a = this._styleProtoChain;
  6706. d = this.createProtoChain(d);
  6707. for (var b in a) a.hasOwnProperty(b) && (d[b] = a[b])
  6708. }
  6709. this._styleProtoChain = d;
  6710. if (!this._hasNoStyleChild)
  6711. for (a = this.numChildren - 1; 0 <= a; a--)(b = this.getChildAt(a)) && "regenerateStyleCacheForIE" in b && b.regenerateStyleCacheForIE(d)
  6712. };
  6713. a.prototype._addToDisplayList = function(d, a) {
  6714. void 0 === a && (a = !0);
  6715. var b = this.numChildren;
  6716. d.parent == this && b--;
  6717. this._addingChild(d);
  6718. this._doAddChild(d, b, a);
  6719. this._childAdded(d);
  6720. return d
  6721. };
  6722. a.prototype._addToDisplayListAt = function(d, a, b) {
  6723. void 0 === b && (b = !0);
  6724. this._addingChild(d);
  6725. this._doAddChild(d, a, b);
  6726. this._childAdded(d);
  6727. return d
  6728. };
  6729. a.prototype._removeFromDisplayList = function(d, a) {
  6730. void 0 === a && (a = !0);
  6731. var b = this._children.indexOf(d);
  6732. if (0 <= b) return this._doRemoveChild(b, a), this._childRemoved(d), d;
  6733. c.Logger.fatal("child未被addChild到该parent");
  6734. return null
  6735. };
  6736. a.prototype._removeFromDisplayListAt = function(d, a) {
  6737. void 0 === a && (a = !0);
  6738. if (0 <= d && d < this._children.length) {
  6739. var b = this._doRemoveChild(d, a);
  6740. this._childRemoved(b);
  6741. return b
  6742. }
  6743. c.Logger.fatal("提供的索引超出范围");
  6744. return null
  6745. };
  6746. a.prototype.addChild = function(d) {
  6747. this._addingChild(d);
  6748. b.prototype.addChild.call(this, d);
  6749. this._childAdded(d);
  6750. return d
  6751. };
  6752. a.prototype.addChildAt = function(d, a) {
  6753. this._addingChild(d);
  6754. b.prototype.addChildAt.call(this, d, a);
  6755. this._childAdded(d);
  6756. return d
  6757. };
  6758. a.prototype._addingChild = function(d) {
  6759. if (d && ("nestLevel" in d && (d.nestLevel = this._nestLevel + 1), "styleChanged" in d)) {
  6760. var a = this._styleProtoChain;
  6761. if (a || d._styleProtoChain) d.regenerateStyleCache(a), d.styleChanged(null), d.notifyStyleChangeInChildren(null)
  6762. }
  6763. };
  6764. a.prototype._childAdded = function(d) {
  6765. d instanceof a && (d._initialize(), d.checkInvalidateFlag())
  6766. };
  6767. a.prototype.removeChild = function(d) {
  6768. b.prototype.removeChild.call(this, d);
  6769. this._childRemoved(d);
  6770. return d
  6771. };
  6772. a.prototype.removeChildAt = function(d) {
  6773. d = b.prototype.removeChildAt.call(this, d);
  6774. this._childRemoved(d);
  6775. return d
  6776. };
  6777. a.prototype._childRemoved = function(d) {
  6778. d && "nestLevel" in d && (d.nestLevel = 0)
  6779. };
  6780. a.prototype.checkInvalidateFlag = function(d) {
  6781. e.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && e.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && e.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && e.UIGlobals._layoutManager.invalidateDisplayList(this), this._validateNowFlag && (e.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  6782. };
  6783. Object.defineProperty(a.prototype, "enabled", {
  6784. get: function() {
  6785. return this._enabled
  6786. },
  6787. set: function(d) {
  6788. this._enabled = d
  6789. },
  6790. enumerable: !0,
  6791. configurable: !0
  6792. });
  6793. Object.defineProperty(a.prototype, "width", {
  6794. get: function() {
  6795. return this._width
  6796. },
  6797. set: function(d) {
  6798. this._setWidth(d)
  6799. },
  6800. enumerable: !0,
  6801. configurable: !0
  6802. });
  6803. a.prototype._setWidth = function(d) {
  6804. if (this._width != d || this._explicitWidth != d) b.prototype._setWidth.call(this, d), isNaN(d) ? this.invalidateSize() : this._width = d, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6805. };
  6806. Object.defineProperty(a.prototype, "height", {
  6807. get: function() {
  6808. return this._height
  6809. },
  6810. set: function(d) {
  6811. this._setHeight(d)
  6812. },
  6813. enumerable: !0,
  6814. configurable: !0
  6815. });
  6816. a.prototype._setHeight = function(d) {
  6817. if (this._height != d || this._explicitHeight != d) b.prototype._setHeight.call(this, d), isNaN(d) ? this.invalidateSize() : this._height = d, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  6818. };
  6819. Object.defineProperty(a.prototype, "scaleX", {
  6820. get: function() {
  6821. return this._scaleX
  6822. },
  6823. set: function(d) {
  6824. this._setScaleX(d)
  6825. },
  6826. enumerable: !0,
  6827. configurable: !0
  6828. });
  6829. a.prototype._setScaleX = function(d) {
  6830. this._scaleX != d && (this._scaleX = d, this.invalidateParentSizeAndDisplayList())
  6831. };
  6832. Object.defineProperty(a.prototype, "scaleY", {
  6833. get: function() {
  6834. return this._scaleY
  6835. },
  6836. set: function(d) {
  6837. this._setScaleY(d)
  6838. },
  6839. enumerable: !0,
  6840. configurable: !0
  6841. });
  6842. a.prototype._setScaleY = function(d) {
  6843. this._scaleY != d && (this._scaleY = d, this.invalidateParentSizeAndDisplayList())
  6844. };
  6845. Object.defineProperty(a.prototype, "minWidth", {
  6846. get: function() {
  6847. return this._minWidth
  6848. },
  6849. set: function(d) {
  6850. this._minWidth != d && (this._minWidth = d, this.invalidateSize())
  6851. },
  6852. enumerable: !0,
  6853. configurable: !0
  6854. });
  6855. Object.defineProperty(a.prototype, "maxWidth", {
  6856. get: function() {
  6857. return this._maxWidth
  6858. },
  6859. set: function(d) {
  6860. this._maxWidth != d && (this._maxWidth = d, this.invalidateSize())
  6861. },
  6862. enumerable: !0,
  6863. configurable: !0
  6864. });
  6865. a.prototype._getMaxWidth = function() {
  6866. return this._maxWidth
  6867. };
  6868. Object.defineProperty(a.prototype, "minHeight", {
  6869. get: function() {
  6870. return this._minHeight
  6871. },
  6872. set: function(d) {
  6873. this._minHeight != d && (this._minHeight = d, this.invalidateSize())
  6874. },
  6875. enumerable: !0,
  6876. configurable: !0
  6877. });
  6878. Object.defineProperty(a.prototype, "maxHeight", {
  6879. get: function() {
  6880. return this._maxHeight
  6881. },
  6882. set: function(d) {
  6883. this._maxHeight != d && (this._maxHeight = d, this.invalidateSize())
  6884. },
  6885. enumerable: !0,
  6886. configurable: !0
  6887. });
  6888. Object.defineProperty(a.prototype, "measuredWidth", {
  6889. get: function() {
  6890. return this._measuredWidth
  6891. },
  6892. set: function(d) {
  6893. this._measuredWidth = d
  6894. },
  6895. enumerable: !0,
  6896. configurable: !0
  6897. });
  6898. Object.defineProperty(a.prototype, "measuredHeight", {
  6899. get: function() {
  6900. return this._measuredHeight
  6901. },
  6902. set: function(d) {
  6903. this._measuredHeight = d
  6904. },
  6905. enumerable: !0,
  6906. configurable: !0
  6907. });
  6908. a.prototype.setActualSize = function(d, a) {
  6909. var b = !1;
  6910. this._width != d && (this._width = d, b = !0);
  6911. this._height != a && (this._height = a, b = !0);
  6912. b && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6913. };
  6914. Object.defineProperty(a.prototype, "x", {
  6915. get: function() {
  6916. return this._x
  6917. },
  6918. set: function(d) {
  6919. this._x != d && (this._setX(d), this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6920. },
  6921. enumerable: !0,
  6922. configurable: !0
  6923. });
  6924. Object.defineProperty(a.prototype, "y", {
  6925. get: function() {
  6926. return this._y
  6927. },
  6928. set: function(d) {
  6929. this._y != d && (this._setY(d), this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6930. },
  6931. enumerable: !0,
  6932. configurable: !0
  6933. });
  6934. a.prototype.invalidateProperties = function() {
  6935. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateProperties(this))
  6936. };
  6937. a.prototype.validateProperties = function() {
  6938. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6939. };
  6940. a.prototype.invalidateSize = function() {
  6941. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateSize(this))
  6942. };
  6943. a.prototype.validateSize = function(d) {
  6944. void 0 === d && (d = !1);
  6945. if (d)
  6946. for (d = 0; d < this.numChildren; d++) {
  6947. var a = this.getChildAt(d);
  6948. "validateSize" in a && a.validateSize(!0)
  6949. }
  6950. this._invalidateSizeFlag && (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6951. };
  6952. a.prototype.measureSizes = function() {
  6953. var d = !1;
  6954. if (!this._invalidateSizeFlag) return d;
  6955. this.canSkipMeasurement() || (this.measure(), this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth), this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth), this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight), this.measuredHeight > this.maxHeight && (this.measuredHeight = this.maxHeight));
  6956. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth = this.preferredWidth, this._oldPreferHeight = this.preferredHeight, d = !0;
  6957. else {
  6958. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) d = !0;
  6959. this._oldPreferWidth = this.preferredWidth;
  6960. this._oldPreferHeight = this.preferredHeight
  6961. }
  6962. return d
  6963. };
  6964. a.prototype.invalidateDisplayList = function() {
  6965. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && e.UIGlobals._layoutManager && e.UIGlobals._layoutManager.invalidateDisplayList(this), this._setSizeDirty())
  6966. };
  6967. a.prototype.validateDisplayList = function() {
  6968. if (this._invalidateDisplayListFlag) {
  6969. var d = 0,
  6970. a = 0,
  6971. d = this._layoutWidthExplicitlySet ? this._width : isNaN(this.explicitWidth) ? this.measuredWidth : this._explicitWidth,
  6972. a = this._layoutHeightExplicitlySet ? this._height : isNaN(this.explicitHeight) ? this.measuredHeight : this._explicitHeight;
  6973. isNaN(d) && (d = 0);
  6974. isNaN(a) && (a = 0);
  6975. this.setActualSize(d, a);
  6976. this.updateDisplayList(d, a);
  6977. this._invalidateDisplayListFlag = !1
  6978. }
  6979. };
  6980. a.prototype.validateNow = function(d) {
  6981. void 0 === d && (d = !1);
  6982. this._validateNowFlag || null == e.UIGlobals._layoutManager ? this._validateNowFlag = !0 : e.UIGlobals._layoutManager.validateClient(this, d)
  6983. };
  6984. a.prototype.invalidateParentSizeAndDisplayList = function() {
  6985. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6986. var d = this.parent;
  6987. d.invalidateSize();
  6988. d.invalidateDisplayList()
  6989. }
  6990. };
  6991. a.prototype.updateDisplayList = function(d, a) {};
  6992. a.prototype.canSkipMeasurement = function() {
  6993. return !isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6994. };
  6995. a.prototype.commitProperties = function() {
  6996. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6997. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6998. };
  6999. a.prototype.measure = function() {
  7000. this._measuredWidth = this._measuredHeight = 0
  7001. };
  7002. a.prototype.dispatchMoveEvent = function() {
  7003. this.hasEventListener(e.MoveEvent.MOVE) && e.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  7004. this.oldX = this.x;
  7005. this.oldY = this.y
  7006. };
  7007. a.prototype._childXYChanged = function() {};
  7008. a.prototype.dispatchResizeEvent = function() {
  7009. this.hasEventListener(e.ResizeEvent.RESIZE) && e.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  7010. this.oldWidth = this._width;
  7011. this.oldHeight = this._height
  7012. };
  7013. Object.defineProperty(a.prototype, "includeInLayout", {
  7014. get: function() {
  7015. return this._includeInLayout
  7016. },
  7017. set: function(d) {
  7018. this._includeInLayout != d && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = d)
  7019. },
  7020. enumerable: !0,
  7021. configurable: !0
  7022. });
  7023. Object.defineProperty(a.prototype, "left", {
  7024. get: function() {
  7025. return this._left
  7026. },
  7027. set: function(d) {
  7028. this._left != d && (this._left = d, this.invalidateParentSizeAndDisplayList())
  7029. },
  7030. enumerable: !0,
  7031. configurable: !0
  7032. });
  7033. Object.defineProperty(a.prototype, "right", {
  7034. get: function() {
  7035. return this._right
  7036. },
  7037. set: function(d) {
  7038. this._right != d && (this._right = d, this.invalidateParentSizeAndDisplayList())
  7039. },
  7040. enumerable: !0,
  7041. configurable: !0
  7042. });
  7043. Object.defineProperty(a.prototype, "top", {
  7044. get: function() {
  7045. return this._top
  7046. },
  7047. set: function(d) {
  7048. this._top != d && (this._top = d, this.invalidateParentSizeAndDisplayList())
  7049. },
  7050. enumerable: !0,
  7051. configurable: !0
  7052. });
  7053. Object.defineProperty(a.prototype, "bottom", {
  7054. get: function() {
  7055. return this._bottom
  7056. },
  7057. set: function(d) {
  7058. this._bottom != d && (this._bottom = d, this.invalidateParentSizeAndDisplayList())
  7059. },
  7060. enumerable: !0,
  7061. configurable: !0
  7062. });
  7063. Object.defineProperty(a.prototype, "horizontalCenter", {
  7064. get: function() {
  7065. return this._horizontalCenter
  7066. },
  7067. set: function(d) {
  7068. this._horizontalCenter != d && (this._horizontalCenter = d, this.invalidateParentSizeAndDisplayList())
  7069. },
  7070. enumerable: !0,
  7071. configurable: !0
  7072. });
  7073. Object.defineProperty(a.prototype, "verticalCenter", {
  7074. get: function() {
  7075. return this._verticalCenter
  7076. },
  7077. set: function(d) {
  7078. this._verticalCenter != d && (this._verticalCenter = d, this.invalidateParentSizeAndDisplayList())
  7079. },
  7080. enumerable: !0,
  7081. configurable: !0
  7082. });
  7083. Object.defineProperty(a.prototype, "percentWidth", {
  7084. get: function() {
  7085. return this._percentWidth
  7086. },
  7087. set: function(d) {
  7088. this._percentWidth != d && (this._percentWidth = d, this.invalidateParentSizeAndDisplayList())
  7089. },
  7090. enumerable: !0,
  7091. configurable: !0
  7092. });
  7093. Object.defineProperty(a.prototype, "percentHeight", {
  7094. get: function() {
  7095. return this._percentHeight
  7096. },
  7097. set: function(d) {
  7098. this._percentHeight != d && (this._percentHeight = d, this.invalidateParentSizeAndDisplayList())
  7099. },
  7100. enumerable: !0,
  7101. configurable: !0
  7102. });
  7103. a.prototype.setLayoutBoundsSize = function(d, a) {
  7104. isNaN(d) ? (this._layoutWidthExplicitlySet = !1, d = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  7105. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  7106. this.setActualSize(d / this._scaleX, a / this._scaleY)
  7107. };
  7108. a.prototype.setLayoutBoundsPosition = function(d, a) {
  7109. 0 > this._scaleX && (d += this.layoutBoundsWidth);
  7110. 0 > this._scaleY && (a += this.layoutBoundsHeight);
  7111. var b = !1;
  7112. this._x != d && (this._setX(d), b = !0);
  7113. this._y != a && (this._setY(a), b = !0);
  7114. b && this.dispatchMoveEvent()
  7115. };
  7116. Object.defineProperty(a.prototype, "preferredWidth", {
  7117. get: function() {
  7118. var d = this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  7119. a = this._scaleX;
  7120. 0 > a && (a = -a);
  7121. return d * a
  7122. },
  7123. enumerable: !0,
  7124. configurable: !0
  7125. });
  7126. Object.defineProperty(a.prototype, "preferredHeight", {
  7127. get: function() {
  7128. var d = this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  7129. a = this._scaleY;
  7130. 0 > a && (a = -a);
  7131. return d * a
  7132. },
  7133. enumerable: !0,
  7134. configurable: !0
  7135. });
  7136. Object.defineProperty(a.prototype, "preferredX", {
  7137. get: function() {
  7138. return 0 <= this._scaleX ? this._x : this._x - this.preferredWidth
  7139. },
  7140. enumerable: !0,
  7141. configurable: !0
  7142. });
  7143. Object.defineProperty(a.prototype, "preferredY", {
  7144. get: function() {
  7145. return 0 <= this._scaleY ? this._y : this._y - this.preferredHeight
  7146. },
  7147. enumerable: !0,
  7148. configurable: !0
  7149. });
  7150. Object.defineProperty(a.prototype, "layoutBoundsX", {
  7151. get: function() {
  7152. return 0 <= this._scaleX ? this._x : this._x - this.layoutBoundsWidth
  7153. },
  7154. enumerable: !0,
  7155. configurable: !0
  7156. });
  7157. Object.defineProperty(a.prototype, "layoutBoundsY", {
  7158. get: function() {
  7159. return 0 <= this._scaleY ? this._y : this._y - this.layoutBoundsHeight
  7160. },
  7161. enumerable: !0,
  7162. configurable: !0
  7163. });
  7164. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  7165. get: function() {
  7166. var d = 0,
  7167. d = this._layoutWidthExplicitlySet ? this._width : this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  7168. a = this._scaleX;
  7169. 0 > a && (a = -a);
  7170. return d * a
  7171. },
  7172. enumerable: !0,
  7173. configurable: !0
  7174. });
  7175. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  7176. get: function() {
  7177. var d = 0,
  7178. d = this._layoutHeightExplicitlySet ? this._height : this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  7179. a = this.scaleY;
  7180. 0 > a && (a = -a);
  7181. return d * a
  7182. },
  7183. enumerable: !0,
  7184. configurable: !0
  7185. });
  7186. a.emptyStyleChain = {};
  7187. return a
  7188. }(c.DisplayObjectContainer);
  7189. e.UIComponent = f;
  7190. f.prototype.__class__ = "egret.gui.UIComponent"
  7191. })(c.gui || (c.gui = {}))
  7192. })(egret || (egret = {}));
  7193. (function(c) {
  7194. (function(c) {
  7195. var f = function() {
  7196. function b() {}
  7197. b.ABOVE = "above";
  7198. b.BELOW = "below";
  7199. b.CENTER = "center";
  7200. b.TOP_LEFT = "topLeft";
  7201. b.LEFT = "left";
  7202. b.RIGHT = "right";
  7203. return b
  7204. }();
  7205. c.PopUpPosition = f;
  7206. f.prototype.__class__ = "egret.gui.PopUpPosition"
  7207. })(c.gui || (c.gui = {}))
  7208. })(egret || (egret = {}));
  7209. __extends = this.__extends || function(c, e) {
  7210. function f() {
  7211. this.constructor = c
  7212. }
  7213. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7214. f.prototype = e.prototype;
  7215. c.prototype = new f
  7216. };
  7217. (function(c) {
  7218. (function(e) {
  7219. var f = function(b) {
  7220. function a(d) {
  7221. void 0 === d && (d = null);
  7222. b.call(this);
  7223. this.generator = d
  7224. }
  7225. __extends(a, b);
  7226. a.prototype.newInstance = function() {
  7227. return new this.generator
  7228. };
  7229. return a
  7230. }(c.HashObject);
  7231. e.ClassFactory = f;
  7232. f.prototype.__class__ = "egret.gui.ClassFactory"
  7233. })(c.gui || (c.gui = {}))
  7234. })(egret || (egret = {}));
  7235. (function(c) {
  7236. (function(c) {
  7237. var f = function() {
  7238. function b() {}
  7239. b.DOWN = 40;
  7240. b.END = 35;
  7241. b.HOME = 36;
  7242. b.LEFT = 37;
  7243. b.PAGE_DOWN = 34;
  7244. b.PAGE_LEFT = 9111;
  7245. b.PAGE_RIGHT = 9112;
  7246. b.PAGE_UP = 33;
  7247. b.RIGHT = 39;
  7248. b.UP = 38;
  7249. return b
  7250. }();
  7251. c.NavigationUnit = f;
  7252. f.prototype.__class__ = "egret.gui.NavigationUnit"
  7253. })(c.gui || (c.gui = {}))
  7254. })(egret || (egret = {}));
  7255. __extends = this.__extends || function(c, e) {
  7256. function f() {
  7257. this.constructor = c
  7258. }
  7259. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7260. f.prototype = e.prototype;
  7261. c.prototype = new f
  7262. };
  7263. (function(c) {
  7264. (function(e) {
  7265. var f = function(b) {
  7266. function a() {
  7267. b.call(this)
  7268. }
  7269. __extends(a, b);
  7270. a.prototype.initialize = function(d) {};
  7271. a.prototype.apply = function(d) {};
  7272. a.prototype.remove = function(d) {};
  7273. a.prototype.initializeFromObject = function(d) {
  7274. for (var a in d) this[a] = d[a];
  7275. return this
  7276. };
  7277. return a
  7278. }(c.HashObject);
  7279. e.OverrideBase = f;
  7280. f.prototype.__class__ = "egret.gui.OverrideBase"
  7281. })(c.gui || (c.gui = {}))
  7282. })(egret || (egret = {}));
  7283. __extends = this.__extends || function(c, e) {
  7284. function f() {
  7285. this.constructor = c
  7286. }
  7287. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7288. f.prototype = e.prototype;
  7289. c.prototype = new f
  7290. };
  7291. (function(c) {
  7292. (function(c) {
  7293. var f = function(b) {
  7294. function a(d, c, e, f) {
  7295. b.call(this);
  7296. this.propertyName = "";
  7297. this.position = a.LAST;
  7298. this.target = d;
  7299. this.propertyName = c;
  7300. this.position = e;
  7301. this.relativeTo = f
  7302. }
  7303. __extends(a, b);
  7304. a.prototype.initialize = function(d) {
  7305. if ((d = d[this.target]) && !(d instanceof c.SkinnableComponent) && "_initialize" in d) try {
  7306. d._initialize()
  7307. } catch (a) {}
  7308. };
  7309. a.prototype.apply = function(d) {
  7310. var b, c;
  7311. try {
  7312. c = d[this.relativeTo]
  7313. } catch (e) {}
  7314. var f = d[this.target];
  7315. d = this.propertyName ? d[this.propertyName] : d;
  7316. if (f && d) {
  7317. switch (this.position) {
  7318. case a.FIRST:
  7319. b = 0;
  7320. break;
  7321. case a.LAST:
  7322. b = -1;
  7323. break;
  7324. case a.BEFORE:
  7325. b = d.getElementIndex(c);
  7326. break;
  7327. case a.AFTER:
  7328. b = d.getElementIndex(c) + 1
  7329. } - 1 == b && (b = d.numElements);
  7330. d.addElementAt(f, b)
  7331. }
  7332. };
  7333. a.prototype.remove = function(d) {
  7334. var a = null == this.propertyName || "" == this.propertyName ? d : d[this.propertyName];
  7335. (d = d[this.target]) && a && -1 != a.getElementIndex(d) && a.removeElement(d)
  7336. };
  7337. a.FIRST = "first";
  7338. a.LAST = "last";
  7339. a.BEFORE = "before";
  7340. a.AFTER = "after";
  7341. return a
  7342. }(c.OverrideBase);
  7343. c.AddItems = f;
  7344. f.prototype.__class__ = "egret.gui.AddItems"
  7345. })(c.gui || (c.gui = {}))
  7346. })(egret || (egret = {}));
  7347. __extends = this.__extends || function(c, e) {
  7348. function f() {
  7349. this.constructor = c
  7350. }
  7351. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7352. f.prototype = e.prototype;
  7353. c.prototype = new f
  7354. };
  7355. (function(c) {
  7356. (function(c) {
  7357. var f = function(b) {
  7358. function a(d, a, c) {
  7359. b.call(this);
  7360. this.target = d;
  7361. this.name = a;
  7362. this.value = c
  7363. }
  7364. __extends(a, b);
  7365. a.prototype.apply = function(d) {
  7366. d = null == this.target || "" == this.target ? d : d[this.target];
  7367. null != d && (this.oldValue = d[this.name], this.setPropertyValue(d, this.name, this.value, this.oldValue))
  7368. };
  7369. a.prototype.remove = function(d) {
  7370. d = null == this.target || "" == this.target ? d : d[this.target];
  7371. null != d && (this.setPropertyValue(d, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  7372. };
  7373. a.prototype.setPropertyValue = function(d, a, b, c) {
  7374. d[a] = void 0 === b || null === b ? b : "number" == typeof c ? parseFloat(b) : "boolean" == typeof c ? this.toBoolean(b) : b
  7375. };
  7376. a.prototype.toBoolean = function(d) {
  7377. return "string" == typeof d ? "true" == d.toLowerCase() : !1 != d
  7378. };
  7379. return a
  7380. }(c.OverrideBase);
  7381. c.SetProperty = f;
  7382. f.prototype.__class__ = "egret.gui.SetProperty"
  7383. })(c.gui || (c.gui = {}))
  7384. })(egret || (egret = {}));
  7385. __extends = this.__extends || function(c, e) {
  7386. function f() {
  7387. this.constructor = c
  7388. }
  7389. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7390. f.prototype = e.prototype;
  7391. c.prototype = new f
  7392. };
  7393. (function(c) {
  7394. (function(c) {
  7395. var f = function(b) {
  7396. function a(d, a, c) {
  7397. b.call(this);
  7398. this.target = d;
  7399. this.name = a;
  7400. this.value = c
  7401. }
  7402. __extends(a, b);
  7403. a.prototype.apply = function(d) {
  7404. d = null == this.target || "" == this.target ? d : d[this.target];
  7405. null != d && (this.oldValue = d.getStyle(this.name), this.setStyleValue(d, this.name, this.value, this.oldValue))
  7406. };
  7407. a.prototype.remove = function(d) {
  7408. d = null == this.target || "" == this.target ? d : d[this.target];
  7409. null != d && (this.setStyleValue(d, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  7410. };
  7411. a.prototype.setStyleValue = function(d, a, b, c) {
  7412. void 0 === b ? d.clearStyle(a) : null === b ? d.setStyle(a, b) : "number" == typeof c ? d.setStyle(a, parseFloat(b)) : "boolean" == typeof c ? d.setStyle(a, this.toBoolean(b)) : d.setStyle(a, b)
  7413. };
  7414. a.prototype.toBoolean = function(d) {
  7415. return "string" == typeof d ? "true" == d.toLowerCase() : !1 != d
  7416. };
  7417. return a
  7418. }(c.OverrideBase);
  7419. c.SetStyle = f;
  7420. f.prototype.__class__ = "egret.gui.SetStyle"
  7421. })(c.gui || (c.gui = {}))
  7422. })(egret || (egret = {}));
  7423. __extends = this.__extends || function(c, e) {
  7424. function f() {
  7425. this.constructor = c
  7426. }
  7427. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7428. f.prototype = e.prototype;
  7429. c.prototype = new f
  7430. };
  7431. (function(c) {
  7432. (function(e) {
  7433. var f = function(b) {
  7434. function a(d, a) {
  7435. b.call(this);
  7436. this.initialized = !1;
  7437. this.name = d;
  7438. this.overrides = a
  7439. }
  7440. __extends(a, b);
  7441. a.prototype.initialize = function(d) {
  7442. if (!this.initialized) {
  7443. this.initialized = !0;
  7444. for (var a = 0; a < this.overrides.length; a++) this.overrides[a].initialize(d)
  7445. }
  7446. };
  7447. return a
  7448. }(c.HashObject);
  7449. e.State = f;
  7450. f.prototype.__class__ = "egret.gui.State"
  7451. })(c.gui || (c.gui = {}))
  7452. })(egret || (egret = {}));
  7453. (function(c) {
  7454. (function(e) {
  7455. var f = {};
  7456. e.getScale9Grid = function(b) {
  7457. if (f[b]) return f[b];
  7458. if (!b) return null;
  7459. var a = b.split(","),
  7460. a = new c.Rectangle(parseInt(a[0]), parseInt(a[1]), parseInt(a[2]), parseInt(a[3]));
  7461. return f[b] = a
  7462. }
  7463. })(c.gui || (c.gui = {}))
  7464. })(egret || (egret = {}));
  7465. (function(c) {
  7466. (function(c) {
  7467. c.setProperties = function(c, b, a) {
  7468. for (var d = b.length, e = 0; e < d; e++) c[b[e]] = a[e];
  7469. return c
  7470. }
  7471. })(c.gui || (c.gui = {}))
  7472. })(egret || (egret = {}));
  7473. __extends = this.__extends || function(c, e) {
  7474. function f() {
  7475. this.constructor = c
  7476. }
  7477. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7478. f.prototype = e.prototype;
  7479. c.prototype = new f
  7480. };
  7481. (function(c) {
  7482. (function(e) {
  7483. var f = function(b) {
  7484. function a(d, a) {
  7485. void 0 === a && (a = !0);
  7486. b.call(this);
  7487. this.fillMode = "scale";
  7488. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  7489. this.autoScale = !0;
  7490. this.touchChildren = !1;
  7491. d && (this.source = d);
  7492. this.autoScale = a
  7493. }
  7494. __extends(a, b);
  7495. Object.defineProperty(a.prototype, "source", {
  7496. get: function() {
  7497. return this._source
  7498. },
  7499. set: function(d) {
  7500. this._source != d && (this._source = d, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0, this._setSizeDirty())
  7501. },
  7502. enumerable: !0,
  7503. configurable: !0
  7504. });
  7505. Object.defineProperty(a.prototype, "content", {
  7506. get: function() {
  7507. return this._content
  7508. },
  7509. enumerable: !0,
  7510. configurable: !0
  7511. });
  7512. a.prototype.createChildren = function() {
  7513. b.prototype.createChildren.call(this);
  7514. this.sourceChanged && this.parseSource();
  7515. this.createChildrenCalled = !0
  7516. };
  7517. a.prototype.parseSource = function() {
  7518. this.sourceChanged = !1;
  7519. var d = a.assetAdapter;
  7520. d || (d = this.getAdapter());
  7521. if (this._source) {
  7522. var b = this.contentReused ? null : this._content;
  7523. this.contentReused = !0;
  7524. d.getAsset(this._source, this.contentChanged, this, b)
  7525. } else this.contentChanged(null, null)
  7526. };
  7527. a.prototype.getAdapter = function() {
  7528. var d;
  7529. try {
  7530. d = c.Injector.getInstance("egret.gui.IAssetAdapter")
  7531. } catch (b) {
  7532. d = new e.DefaultAssetAdapter
  7533. }
  7534. return a.assetAdapter = d
  7535. };
  7536. a.prototype.contentChanged = function(d, a) {
  7537. if (a === this._source) {
  7538. var b = this._content;
  7539. this._content = d;
  7540. b !== d && (b instanceof c.DisplayObject && b.parent == this && this._removeFromDisplayList(b), d instanceof c.DisplayObject && this._addToDisplayListAt(d, 0));
  7541. this.invalidateSize();
  7542. this.invalidateDisplayList();
  7543. this.contentReused = !1;
  7544. this.hasEventListener(e.UIEvent.CONTENT_CHANGED) && e.UIEvent.dispatchUIEvent(this, e.UIEvent.CONTENT_CHANGED)
  7545. }
  7546. };
  7547. a.prototype.measure = function() {
  7548. b.prototype.measure.call(this);
  7549. var d = this._content;
  7550. d instanceof c.DisplayObject ? "preferredWidth" in d ? (this.measuredWidth = d.preferredWidth, this.measuredHeight = d.preferredHeight) : (this.measuredWidth = d.width * d.scaleX, this.measuredHeight = d.height * d.scaleY) : d instanceof c.Texture && (this.measuredWidth = d._textureWidth, this.measuredHeight = d._textureHeight)
  7551. };
  7552. a.prototype.updateDisplayList = function(d, a) {
  7553. b.prototype.updateDisplayList.call(this, d, a);
  7554. var e = this._content;
  7555. this.autoScale && e instanceof c.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(d, a) : (e.width = d / e.scaleX, e.height = a / e.scaleY));
  7556. this._setSizeDirty()
  7557. };
  7558. a.prototype._render = function(d) {
  7559. if (this._content instanceof c.Texture) {
  7560. var a = this._content;
  7561. this._texture_to_render = a;
  7562. var e;
  7563. this.autoScale ? (e = this._width, a = this._height) : (e = a._textureWidth, a = a._textureHeight);
  7564. c.Bitmap._drawBitmap(d, e, a, this)
  7565. } else this._texture_to_render = null;
  7566. b.prototype._render.call(this, d)
  7567. };
  7568. a.prototype._measureBounds = function() {
  7569. if (this._content instanceof c.Texture) {
  7570. var d = this._content,
  7571. a = this.width,
  7572. e = this.height;
  7573. return c.Rectangle.identity.initialize(Math.floor(d._offsetX * a / d._textureWidth), Math.floor(d._offsetY * e / d._textureHeight), a, e)
  7574. }
  7575. return b.prototype._measureBounds.call(this)
  7576. };
  7577. a.prototype.addChild = function(d) {
  7578. throw Error("addChild()" + a.errorStr + "addElement()代替");
  7579. };
  7580. a.prototype.addChildAt = function(d, b) {
  7581. throw Error("addChildAt()" + a.errorStr + "addElementAt()代替");
  7582. };
  7583. a.prototype.removeChild = function(d) {
  7584. throw Error("removeChild()" + a.errorStr + "removeElement()代替");
  7585. };
  7586. a.prototype.removeChildAt = function(d) {
  7587. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()代替");
  7588. };
  7589. a.prototype.setChildIndex = function(d, b) {
  7590. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()代替");
  7591. };
  7592. a.prototype.swapChildren = function(d, b) {
  7593. throw Error("swapChildren()" + a.errorStr + "swapElements()代替");
  7594. };
  7595. a.prototype.swapChildrenAt = function(d, b) {
  7596. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()代替");
  7597. };
  7598. a.errorStr = "在此组件中不可用,若此组件为容器类,请使用";
  7599. return a
  7600. }(e.UIComponent);
  7601. e.UIAsset = f;
  7602. f.prototype.__class__ = "egret.gui.UIAsset"
  7603. })(c.gui || (c.gui = {}))
  7604. })(egret || (egret = {}));
  7605. __extends = this.__extends || function(c, e) {
  7606. function f() {
  7607. this.constructor = c
  7608. }
  7609. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7610. f.prototype = e.prototype;
  7611. c.prototype = new f
  7612. };
  7613. (function(c) {
  7614. (function(e) {
  7615. var f = function(b) {
  7616. function a() {
  7617. b.call(this);
  7618. this.hostComponentKey = null;
  7619. this.stateIsDirty = this.skinLayoutEnabled = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  7620. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  7621. }
  7622. __extends(a, b);
  7623. Object.defineProperty(a.prototype, "skinName", {
  7624. get: function() {
  7625. return this._skinName
  7626. },
  7627. set: function(d) {
  7628. this._skinName != d && (this._skinName = d, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  7629. },
  7630. enumerable: !0,
  7631. configurable: !0
  7632. });
  7633. a.prototype.createChildren = function() {
  7634. b.prototype.createChildren.call(this);
  7635. this.parseSkinName();
  7636. this.createChildrenCalled = !0
  7637. };
  7638. a.prototype.parseSkinName = function() {
  7639. var d = a.skinAdapter;
  7640. d || (d = this.getSkinAdapter());
  7641. var b = this.hostComponentKey || c.getQualifiedClassName(this),
  7642. d = d.getSkin(this._skinName, b);
  7643. d || (b = a._defaultTheme) && (d = b.getDefaultSkin(this));
  7644. this._setSkin(d)
  7645. };
  7646. a.prototype.getSkinAdapter = function() {
  7647. var d;
  7648. try {
  7649. d = c.Injector.getInstance("egret.gui.ISkinAdapter")
  7650. } catch (b) {
  7651. d = new e.DefaultSkinAdapter
  7652. }
  7653. return a.skinAdapter = d
  7654. };
  7655. Object.defineProperty(a.prototype, "skin", {
  7656. get: function() {
  7657. return this._skin
  7658. },
  7659. enumerable: !0,
  7660. configurable: !0
  7661. });
  7662. a.prototype._setSkin = function(d) {
  7663. var a = this._skin;
  7664. this.detachSkin(a);
  7665. a instanceof c.DisplayObject && this._removeFromDisplayList(a);
  7666. this._skin = d;
  7667. d instanceof c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  7668. this.attachSkin(d);
  7669. this.invalidateSkinState();
  7670. this.invalidateSize();
  7671. this.invalidateDisplayList();
  7672. this.hasEventListener(e.UIEvent.SKIN_CHANGED) && e.UIEvent.dispatchUIEvent(this, e.UIEvent.SKIN_CHANGED)
  7673. };
  7674. a.prototype.attachSkin = function(d) {
  7675. d && "hostComponent" in d && (d.hostComponent = this, this.findSkinParts());
  7676. this.skinLayoutEnabled = !d || d instanceof c.DisplayObject ? !1 : !0
  7677. };
  7678. a.prototype.findSkinParts = function() {
  7679. var d = this._skin;
  7680. if (d && "skinParts" in d)
  7681. for (var a = d.skinParts, b = a.length, c = 0; c < b; c++) {
  7682. var e = a[c];
  7683. if (e in d) try {
  7684. this[e] = d[e], this.partAdded(e, d[e])
  7685. } catch (f) {}
  7686. }
  7687. };
  7688. a.prototype.detachSkin = function(d) {
  7689. if (d && "skinParts" in d) {
  7690. for (var a = d.skinParts, b = a.length, c = 0; c < b; c++) {
  7691. var e = a[c];
  7692. e in this && (null != this[e] && this.partRemoved(e, this[e]), this[e] = null)
  7693. }
  7694. d.hostComponent = null
  7695. }
  7696. };
  7697. a.prototype.partAdded = function(d, a) {
  7698. e.SkinPartEvent.dispatchSkinPartEvent(this, e.SkinPartEvent.PART_ADDED, d, a)
  7699. };
  7700. a.prototype.partRemoved = function(d, a) {
  7701. e.SkinPartEvent.dispatchSkinPartEvent(this, e.SkinPartEvent.PART_REMOVED, d, a)
  7702. };
  7703. a.prototype.invalidateSkinState = function() {
  7704. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  7705. };
  7706. a.prototype.validateSkinState = function() {
  7707. var d = this.getCurrentSkinState(),
  7708. a = this._skin;
  7709. a && "currentState" in a && (a.currentState = d);
  7710. this.hasEventListener("stateChanged") && this.dispatchEventWith("stateChanged")
  7711. };
  7712. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  7713. get: function() {
  7714. return this._autoMouseEnabled
  7715. },
  7716. set: function(d) {
  7717. this._autoMouseEnabled != d && ((this._autoMouseEnabled = d) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren : !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled : !1) : (this._touchChildren = this.explicitMouseChildren, this._touchEnabled = this.explicitMouseEnabled))
  7718. },
  7719. enumerable: !0,
  7720. configurable: !0
  7721. });
  7722. Object.defineProperty(a.prototype, "touchChildren", {
  7723. get: function() {
  7724. return this._touchChildren
  7725. },
  7726. set: function(d) {
  7727. this.enabled && (this._touchChildren = d);
  7728. this.explicitMouseChildren = d
  7729. },
  7730. enumerable: !0,
  7731. configurable: !0
  7732. });
  7733. Object.defineProperty(a.prototype, "touchEnabled", {
  7734. get: function() {
  7735. return this._touchEnabled
  7736. },
  7737. set: function(d) {
  7738. this.enabled && (this._touchEnabled = d);
  7739. this.explicitMouseEnabled = d
  7740. },
  7741. enumerable: !0,
  7742. configurable: !0
  7743. });
  7744. Object.defineProperty(a.prototype, "enabled", {
  7745. get: function() {
  7746. return this._enabled
  7747. },
  7748. set: function(d) {
  7749. this._setEnabled(d)
  7750. },
  7751. enumerable: !0,
  7752. configurable: !0
  7753. });
  7754. a.prototype._setEnabled = function(d) {
  7755. this._enabled != d && (this._enabled = d, this._autoMouseEnabled && (this._touchChildren = d ? this.explicitMouseChildren : !1, this._touchEnabled = d ? this.explicitMouseEnabled : !1), this.invalidateSkinState())
  7756. };
  7757. a.prototype.getCurrentSkinState = function() {
  7758. return this.enabled ? "normal" : "disabled"
  7759. };
  7760. a.prototype.commitProperties = function() {
  7761. b.prototype.commitProperties.call(this);
  7762. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  7763. };
  7764. a.prototype._childXYChanged = function() {
  7765. this.skinLayoutEnabled && (this.invalidateSize(), this.invalidateDisplayList())
  7766. };
  7767. a.prototype.measure = function() {
  7768. b.prototype.measure.call(this);
  7769. var d = this._skin;
  7770. d && (this.skinLayoutEnabled ? (d.measure(), this.measuredWidth = d.preferredWidth, this.measuredHeight = d.preferredHeight) : "preferredWidth" in d ? (this.measuredWidth = d.preferredWidth, this.measuredHeight = d.preferredHeight) : (this.measuredWidth = d.width, this.measuredHeight = d.height))
  7771. };
  7772. a.prototype.updateDisplayList = function(d, a) {
  7773. b.prototype.updateDisplayList.call(this, d, a);
  7774. var e = this._skin;
  7775. e && (this.skinLayoutEnabled ? e.updateDisplayList(d, a) : "setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(d, a) : e instanceof c.DisplayObject && (e.scaleX = 0 == e.width ? 1 : d / e.width, e.scaleY = 0 == e.height ? 1 : a / e.height))
  7776. };
  7777. a.prototype.addChild = function(d) {
  7778. throw Error("addChild()" + a.errorStr + "addElement()代替");
  7779. };
  7780. a.prototype.addChildAt = function(d, b) {
  7781. throw Error("addChildAt()" + a.errorStr + "addElementAt()代替");
  7782. };
  7783. a.prototype.removeChild = function(d) {
  7784. throw Error("removeChild()" + a.errorStr + "removeElement()代替");
  7785. };
  7786. a.prototype.removeChildAt = function(d) {
  7787. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()代替");
  7788. };
  7789. a.prototype.setChildIndex = function(d, b) {
  7790. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()代替");
  7791. };
  7792. a.prototype.swapChildren = function(d, b) {
  7793. throw Error("swapChildren()" + a.errorStr + "swapElements()代替");
  7794. };
  7795. a.prototype.swapChildrenAt = function(d, b) {
  7796. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()代替");
  7797. };
  7798. a.errorStr = "在此组件中不可用,若此组件为容器类,请使用";
  7799. return a
  7800. }(e.UIComponent);
  7801. e.SkinnableComponent = f;
  7802. f.prototype.__class__ = "egret.gui.SkinnableComponent"
  7803. })(c.gui || (c.gui = {}))
  7804. })(egret || (egret = {}));
  7805. (function(c) {
  7806. (function(e) {
  7807. var f = function() {
  7808. function b() {}
  7809. b.prototype.getSkin = function(a, d) {
  7810. if (!a) return null;
  7811. if (a.prototype) return new a;
  7812. if ("string" == typeof a) {
  7813. var b = c.getDefinitionByName(a);
  7814. return b ? new b : null
  7815. }
  7816. return a
  7817. };
  7818. return b
  7819. }();
  7820. e.DefaultSkinAdapter = f;
  7821. f.prototype.__class__ = "egret.gui.DefaultSkinAdapter"
  7822. })(c.gui || (c.gui = {}))
  7823. })(egret || (egret = {}));
  7824. (function(c) {
  7825. (function(e) {
  7826. var f = function() {
  7827. function b() {}
  7828. b.prototype.getAsset = function(a, d, b, e) {
  7829. var f = a;
  7830. a.prototype && (f = new a);
  7831. if (f instanceof c.DisplayObject || f instanceof c.Texture) d.call(b, f, a);
  7832. else if ("string" == typeof a) {
  7833. var g = new c.URLLoader;
  7834. g.dataFormat = c.URLLoaderDataFormat.TEXTURE;
  7835. g.addEventListener(c.Event.COMPLETE, function(c) {
  7836. f = g.data;
  7837. d.call(b, f, a)
  7838. }, this);
  7839. g.load(new c.URLRequest(a))
  7840. } else d.call(b, f, a)
  7841. };
  7842. return b
  7843. }();
  7844. e.DefaultAssetAdapter = f;
  7845. f.prototype.__class__ = "egret.gui.DefaultAssetAdapter"
  7846. })(c.gui || (c.gui = {}))
  7847. })(egret || (egret = {}));
  7848. (function(c) {
  7849. (function(e) {
  7850. var f = function() {
  7851. function b(a) {
  7852. this.delyList = [];
  7853. this.loadConfig(a)
  7854. }
  7855. b.load = function(a) {
  7856. this.initialized || (this.initialized = !0, e.SkinnableComponent._defaultTheme = new b(a))
  7857. };
  7858. b.prototype.loadConfig = function(a) {
  7859. var d = new c.URLLoader;
  7860. d.addEventListener(c.Event.COMPLETE, this.onLoadComplete, this);
  7861. d.addEventListener(c.IOErrorEvent.IO_ERROR, this.onLoadError, this);
  7862. d.dataFormat = c.URLLoaderDataFormat.TEXT;
  7863. d.load(new c.URLRequest(a))
  7864. };
  7865. b.prototype.onLoadComplete = function(a) {
  7866. a = a.target;
  7867. try {
  7868. this.skinMap = JSON.parse(a.data).skins
  7869. } catch (d) {
  7870. c.Logger.warning("JSON文件格式不正确: " + a._request.url + "\ndata:" + a.data)
  7871. }
  7872. this.handleDelyList()
  7873. };
  7874. b.prototype.onLoadError = function(a) {
  7875. c.Logger.warning("主题配置文件加载失败: " + a.target._request.url);
  7876. this.handleDelyList()
  7877. };
  7878. b.prototype.handleDelyList = function() {
  7879. if (this.skinMap) {
  7880. var a = this.delyList;
  7881. this.delyList = [];
  7882. for (var d = a.length, b = 0; b < d; b++) {
  7883. var c = a[b];
  7884. if (!c._skin) {
  7885. var e = this.getDefaultSkin(c);
  7886. c._setSkin(e)
  7887. }
  7888. }
  7889. } else this.skinMap = {}, this.delyList = []
  7890. };
  7891. b.prototype.getDefaultSkin = function(a) {
  7892. var d = this.skinMap;
  7893. if (!d) return -1 == this.delyList.indexOf(a) && this.delyList.push(a), null;
  7894. var b, e = a.hostComponentKey;
  7895. if (e) b = d[e];
  7896. else
  7897. for (; a;) {
  7898. e = c.getQualifiedClassName(a);
  7899. if (b = d[e]) break;
  7900. a = c.getDefinitionByName(c.getQualifiedSuperclassName(a))
  7901. }
  7902. if (!b) return null;
  7903. d = c.getDefinitionByName(b);
  7904. return d ? new d : (c.Logger.warning("找不到主题中所配置的皮肤类名: " + b), null)
  7905. };
  7906. b.initialized = !1;
  7907. return b
  7908. }();
  7909. e.Theme = f;
  7910. f.prototype.__class__ = "egret.gui.Theme"
  7911. })(c.gui || (c.gui = {}))
  7912. })(egret || (egret = {}));
  7913. __extends = this.__extends || function(c, e) {
  7914. function f() {
  7915. this.constructor = c
  7916. }
  7917. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7918. f.prototype = e.prototype;
  7919. c.prototype = new f
  7920. };
  7921. (function(c) {
  7922. (function(e) {
  7923. var f = function(b) {
  7924. function a() {
  7925. b.call(this)
  7926. }
  7927. __extends(a, b);
  7928. Object.defineProperty(a.prototype, "target", {
  7929. get: function() {
  7930. return this._target
  7931. },
  7932. set: function(d) {
  7933. this._target = d
  7934. },
  7935. enumerable: !0,
  7936. configurable: !0
  7937. });
  7938. a.prototype.measure = function() {
  7939. if (null != this.target) {
  7940. for (var d = 0, a = 0, b = this._target, c = b.numElements, e = 0; e < c; e++) {
  7941. var f = b.getElementAt(e);
  7942. if (f && f.includeInLayout) {
  7943. var k = f.horizontalCenter,
  7944. l = f.verticalCenter,
  7945. m = f.left,
  7946. n = f.right,
  7947. p = f.top,
  7948. r = f.bottom;
  7949. isNaN(m) || isNaN(n) ? isNaN(k) ? isNaN(m) && isNaN(n) ? k = f.preferredX : (k = isNaN(m) ? 0 : m, k += isNaN(n) ? 0 : n) : k = 2 * Math.abs(k) : k = m + n;
  7950. isNaN(p) || isNaN(r) ? isNaN(l) ? isNaN(p) && isNaN(r) ? l = f.preferredY : (l = isNaN(p) ? 0 : p, l += isNaN(r) ? 0 : r) : l = 2 * Math.abs(l) : l = p + r;
  7951. r = f.preferredHeight;
  7952. d = Math.ceil(Math.max(d, k + f.preferredWidth));
  7953. a = Math.ceil(Math.max(a, l + r))
  7954. }
  7955. }
  7956. this.target.measuredWidth = d;
  7957. this.target.measuredHeight = a
  7958. }
  7959. };
  7960. a.prototype.updateDisplayList = function(d, a) {
  7961. if (null != this.target)
  7962. for (var b = this.target.numElements, c = 0; c < b; c++) {
  7963. var e = this.target.getElementAt(c);
  7964. if (null != e && e.includeInLayout) {
  7965. var f = e.horizontalCenter,
  7966. k = e.verticalCenter,
  7967. l = e.left,
  7968. m = e.right,
  7969. n = e.top,
  7970. p = e.bottom,
  7971. r = e.percentWidth,
  7972. w = e.percentHeight,
  7973. A = NaN,
  7974. u = NaN;
  7975. isNaN(l) || isNaN(m) ? isNaN(r) || (A = Math.round(d * Math.min(0.01 * r, 1))) : A = d - m - l;
  7976. isNaN(n) || isNaN(p) ? isNaN(w) || (u = Math.round(a * Math.min(0.01 * w, 1))) : u = a - p - n;
  7977. e.setLayoutBoundsSize(A, u);
  7978. r = e.layoutBoundsWidth;
  7979. w = e.layoutBoundsHeight;
  7980. u = A = NaN;
  7981. A = isNaN(f) ? isNaN(l) ? isNaN(m) ? e.layoutBoundsX : d - r - m : l : Math.round((d - r) / 2 + f);
  7982. u = isNaN(k) ? isNaN(n) ? isNaN(p) ? e.layoutBoundsY : a - w - p : n : Math.round((a - w) / 2 + k);
  7983. e.setLayoutBoundsPosition(A, u)
  7984. }
  7985. }
  7986. };
  7987. return a
  7988. }(c.HashObject);
  7989. e.SkinBasicLayout = f;
  7990. f.prototype.__class__ = "egret.gui.SkinBasicLayout"
  7991. })(c.gui || (c.gui = {}))
  7992. })(egret || (egret = {}));
  7993. __extends = this.__extends || function(c, e) {
  7994. function f() {
  7995. this.constructor = c
  7996. }
  7997. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  7998. f.prototype = e.prototype;
  7999. c.prototype = new f
  8000. };
  8001. (function(c) {
  8002. (function(e) {
  8003. var f = function(b) {
  8004. function a() {
  8005. b.call(this);
  8006. this._autoRepeat = this._downEventFired = !1;
  8007. this._repeatInterval = this._repeatDelay = 35;
  8008. this._keepDown = this._hovered = !1;
  8009. this._label = "";
  8010. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  8011. this.addHandlers()
  8012. }
  8013. __extends(a, b);
  8014. Object.defineProperty(a.prototype, "autoRepeat", {
  8015. get: function() {
  8016. return this._autoRepeat
  8017. },
  8018. set: function(d) {
  8019. d != this._autoRepeat && (this._autoRepeat = d, this.checkAutoRepeatTimerConditions(this.isDown()))
  8020. },
  8021. enumerable: !0,
  8022. configurable: !0
  8023. });
  8024. Object.defineProperty(a.prototype, "repeatDelay", {
  8025. get: function() {
  8026. return this._repeatDelay
  8027. },
  8028. set: function(d) {
  8029. this._repeatDelay = d
  8030. },
  8031. enumerable: !0,
  8032. configurable: !0
  8033. });
  8034. Object.defineProperty(a.prototype, "repeatInterval", {
  8035. get: function() {
  8036. return this._repeatInterval
  8037. },
  8038. set: function(d) {
  8039. this._repeatInterval = d
  8040. },
  8041. enumerable: !0,
  8042. configurable: !0
  8043. });
  8044. Object.defineProperty(a.prototype, "hovered", {
  8045. get: function() {
  8046. return this._hovered
  8047. },
  8048. set: function(d) {
  8049. d != this._hovered && (this._hovered = d, this.invalidateSkinState(), this.checkButtonDownConditions())
  8050. },
  8051. enumerable: !0,
  8052. configurable: !0
  8053. });
  8054. a.prototype._setKeepDown = function(d) {
  8055. this._keepDown != d && (this._keepDown = d, this.invalidateSkinState())
  8056. };
  8057. Object.defineProperty(a.prototype, "label", {
  8058. get: function() {
  8059. return this._getLabel()
  8060. },
  8061. set: function(d) {
  8062. this._setLabel(d)
  8063. },
  8064. enumerable: !0,
  8065. configurable: !0
  8066. });
  8067. a.prototype._getLabel = function() {
  8068. return this.labelDisplay ? this.labelDisplay.text : this._label
  8069. };
  8070. a.prototype._setLabel = function(d) {
  8071. this._label = d;
  8072. this.labelDisplay && (this.labelDisplay.text = d)
  8073. };
  8074. Object.defineProperty(a.prototype, "mouseCaptured", {
  8075. get: function() {
  8076. return this._mouseCaptured
  8077. },
  8078. set: function(d) {
  8079. d != this._mouseCaptured && (this._mouseCaptured = d, this.invalidateSkinState(), d || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  8080. },
  8081. enumerable: !0,
  8082. configurable: !0
  8083. });
  8084. Object.defineProperty(a.prototype, "stickyHighlighting", {
  8085. get: function() {
  8086. return this._stickyHighlighting
  8087. },
  8088. set: function(d) {
  8089. d != this._stickyHighlighting && (this._stickyHighlighting = d, this.invalidateSkinState(), this.checkButtonDownConditions())
  8090. },
  8091. enumerable: !0,
  8092. configurable: !0
  8093. });
  8094. a.prototype.checkButtonDownConditions = function() {
  8095. var d = this.isDown();
  8096. this._downEventFired != d && (d && e.UIEvent.dispatchUIEvent(this, e.UIEvent.BUTTON_DOWN), this._downEventFired = d, this.checkAutoRepeatTimerConditions(d))
  8097. };
  8098. a.prototype.addHandlers = function() {
  8099. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  8100. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  8101. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler, this);
  8102. this.addEventListener(c.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  8103. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  8104. };
  8105. a.prototype.addStageMouseHandlers = function() {
  8106. e.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8107. e.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  8108. };
  8109. a.prototype.removeStageMouseHandlers = function() {
  8110. e.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8111. e.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  8112. };
  8113. a.prototype.isDown = function() {
  8114. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  8115. };
  8116. a.prototype.checkAutoRepeatTimerConditions = function(d) {
  8117. d = this.autoRepeat && d;
  8118. d != (null != this.autoRepeatTimer) && (d ? this.startTimer() : this.stopTimer())
  8119. };
  8120. a.prototype.startTimer = function() {
  8121. this.autoRepeatTimer = new c.Timer(1);
  8122. this.autoRepeatTimer.delay = this._repeatDelay;
  8123. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  8124. this.autoRepeatTimer.start()
  8125. };
  8126. a.prototype.stopTimer = function() {
  8127. this.autoRepeatTimer.stop();
  8128. this.autoRepeatTimer = null
  8129. };
  8130. a.prototype.mouseEventHandler = function(d) {
  8131. switch (d.type) {
  8132. case c.TouchEvent.TOUCH_ROLL_OVER:
  8133. if (d.touchDown && !this.mouseCaptured) break;
  8134. this.hovered = !0;
  8135. break;
  8136. case c.TouchEvent.TOUCH_ROLL_OUT:
  8137. this.hovered = !1;
  8138. break;
  8139. case c.TouchEvent.TOUCH_BEGIN:
  8140. this.addStageMouseHandlers();
  8141. c.InteractionMode.mode == c.InteractionMode.TOUCH && (this.hovered = !0);
  8142. this.mouseCaptured = !0;
  8143. break;
  8144. case c.TouchEvent.TOUCH_END:
  8145. d.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  8146. break;
  8147. case c.TouchEvent.TOUCH_TAP:
  8148. this.enabled ? this.clickHandler(d) : d.stopImmediatePropagation()
  8149. }
  8150. };
  8151. a.prototype.buttonReleased = function() {};
  8152. a.prototype.clickHandler = function(d) {};
  8153. a.prototype.stage_mouseUpHandler = function(d) {
  8154. d.target != this && (this.mouseCaptured = !1)
  8155. };
  8156. a.prototype.autoRepeat_timerDelayHandler = function(d) {
  8157. this.autoRepeatTimer.reset();
  8158. this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  8159. this.autoRepeatTimer.delay = this._repeatInterval;
  8160. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  8161. this.autoRepeatTimer.start()
  8162. };
  8163. a.prototype.autoRepeat_timerHandler = function(d) {
  8164. e.UIEvent.dispatchUIEvent(this, e.UIEvent.BUTTON_DOWN)
  8165. };
  8166. a.prototype.getCurrentSkinState = function() {
  8167. return this.enabled ? this.isDown() || this._keepDown ? "down" : c.InteractionMode.mode == c.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over" : "up" : b.prototype.getCurrentSkinState.call(this)
  8168. };
  8169. a.prototype.partAdded = function(d, a) {
  8170. b.prototype.partAdded.call(this, d, a);
  8171. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  8172. };
  8173. return a
  8174. }(e.SkinnableComponent);
  8175. e.ButtonBase = f;
  8176. f.prototype.__class__ = "egret.gui.ButtonBase"
  8177. })(c.gui || (c.gui = {}))
  8178. })(egret || (egret = {}));
  8179. __extends = this.__extends || function(c, e) {
  8180. function f() {
  8181. this.constructor = c
  8182. }
  8183. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  8184. f.prototype = e.prototype;
  8185. c.prototype = new f
  8186. };
  8187. (function(c) {
  8188. (function(e) {
  8189. var f = function(b) {
  8190. function a() {
  8191. b.call(this);
  8192. this._autoSelected = !0
  8193. }
  8194. __extends(a, b);
  8195. Object.defineProperty(a.prototype, "selected", {
  8196. get: function() {
  8197. return this._selected
  8198. },
  8199. set: function(d) {
  8200. this._setSelected(d)
  8201. },
  8202. enumerable: !0,
  8203. configurable: !0
  8204. });
  8205. a.prototype._setSelected = function(d) {
  8206. d != this._selected && (this._selected = d, e.UIEvent.dispatchUIEvent(this, e.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  8207. };
  8208. a.prototype.getCurrentSkinState = function() {
  8209. var d = b.prototype.getCurrentSkinState.call(this);
  8210. if (this.selected) {
  8211. var a = d + "AndSelected",
  8212. c = this.skin;
  8213. return c && c.hasState(a) ? a : "disabled" == d ? "disabled" : "down"
  8214. }
  8215. return d
  8216. };
  8217. a.prototype.buttonReleased = function() {
  8218. b.prototype.buttonReleased.call(this);
  8219. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(c.Event.CHANGE))
  8220. };
  8221. return a
  8222. }(e.ButtonBase);
  8223. e.ToggleButtonBase = f;
  8224. f.prototype.__class__ = "egret.gui.ToggleButtonBase"
  8225. })(c.gui || (c.gui = {}))
  8226. })(egret || (egret = {}));
  8227. __extends = this.__extends || function(c, e) {
  8228. function f() {
  8229. this.constructor = c
  8230. }
  8231. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  8232. f.prototype = e.prototype;
  8233. c.prototype = new f
  8234. };
  8235. (function(c) {
  8236. (function(e) {
  8237. var f = function(b) {
  8238. function a() {
  8239. b.call(this);
  8240. this.allStyleChanged = !1;
  8241. this._fontFamily = "SimSun";
  8242. this._size = 30;
  8243. this._focusEnabled = !0;
  8244. this._italic = this._bold = !1;
  8245. this._textAlign = c.HorizontalAlign.LEFT;
  8246. this._verticalAlign = c.VerticalAlign.TOP;
  8247. this._lineSpacing = 0;
  8248. this._textColor = 16777215;
  8249. this._text = "";
  8250. this._textFlow = null;
  8251. this._textFlowChanged = !1;
  8252. this._hasNoStyleChild = !0
  8253. }
  8254. __extends(a, b);
  8255. a.prototype.styleChanged = function(d) {
  8256. if (!this.allStyleChanged) {
  8257. if (d) switch (d) {
  8258. case "textColor":
  8259. this.textColorChanged = !0;
  8260. break;
  8261. case "fontFamily":
  8262. this.fontFamilyChanged = !0;
  8263. break;
  8264. case "size":
  8265. this._sizeChanged = !0;
  8266. break;
  8267. case "bold":
  8268. this.boldChanged = !0;
  8269. break;
  8270. case "italic":
  8271. this.italicChanged = !0;
  8272. break;
  8273. case "textAlign":
  8274. this.textAlignChanged = !0;
  8275. break;
  8276. case "verticalAlign":
  8277. this.verticalAlignChanged = !0
  8278. } else this.allStyleChanged = !0;
  8279. this.invalidateProperties();
  8280. this.invalidateSize();
  8281. this.invalidateDisplayList()
  8282. }
  8283. };
  8284. Object.defineProperty(a.prototype, "fontFamily", {
  8285. get: function() {
  8286. var d = this._styleProtoChain;
  8287. return d && void 0 !== d.fontFamily ? d.fontFamily : this._fontFamily
  8288. },
  8289. set: function(d) {
  8290. this.setStyle("fontFamily", d)
  8291. },
  8292. enumerable: !0,
  8293. configurable: !0
  8294. });
  8295. Object.defineProperty(a.prototype, "size", {
  8296. get: function() {
  8297. var d = this._styleProtoChain;
  8298. return d && void 0 !== d.size ? d.size : this._size
  8299. },
  8300. set: function(d) {
  8301. void 0 === d && (d = 0);
  8302. this.setStyle("size", d)
  8303. },
  8304. enumerable: !0,
  8305. configurable: !0
  8306. });
  8307. Object.defineProperty(a.prototype, "focusEnabled", {
  8308. get: function() {
  8309. return this._focusEnabled
  8310. },
  8311. set: function(d) {
  8312. this._focusEnabled = d
  8313. },
  8314. enumerable: !0,
  8315. configurable: !0
  8316. });
  8317. a.prototype.setFocus = function() {
  8318. !1 != this._focusEnabled && this._textField && this._textField.setFocus()
  8319. };
  8320. Object.defineProperty(a.prototype, "bold", {
  8321. get: function() {
  8322. var d = this._styleProtoChain;
  8323. return d && void 0 !== d.bold ? d.bold : this._bold
  8324. },
  8325. set: function(d) {
  8326. this.setStyle("bold", d)
  8327. },
  8328. enumerable: !0,
  8329. configurable: !0
  8330. });
  8331. Object.defineProperty(a.prototype, "italic", {
  8332. get: function() {
  8333. var d = this._styleProtoChain;
  8334. return d && void 0 !== d.italic ? d.italic : this._italic
  8335. },
  8336. set: function(d) {
  8337. this.setStyle("italic", d)
  8338. },
  8339. enumerable: !0,
  8340. configurable: !0
  8341. });
  8342. Object.defineProperty(a.prototype, "textAlign", {
  8343. get: function() {
  8344. var d = this._styleProtoChain;
  8345. return d && void 0 !== d.textAlign ? d.textAlign : this._textAlign
  8346. },
  8347. set: function(d) {
  8348. this.setStyle("textAlign", d)
  8349. },
  8350. enumerable: !0,
  8351. configurable: !0
  8352. });
  8353. Object.defineProperty(a.prototype, "verticalAlign", {
  8354. get: function() {
  8355. var d = this._styleProtoChain;
  8356. return d && void 0 !== d.verticalAlign ? d.verticalAlign : this._verticalAlign
  8357. },
  8358. set: function(d) {
  8359. this.setStyle("verticalAlign", d)
  8360. },
  8361. enumerable: !0,
  8362. configurable: !0
  8363. });
  8364. Object.defineProperty(a.prototype, "lineSpacing", {
  8365. get: function() {
  8366. return this._getLineSpacing()
  8367. },
  8368. set: function(d) {
  8369. this._setLineSpacing(d)
  8370. },
  8371. enumerable: !0,
  8372. configurable: !0
  8373. });
  8374. a.prototype._getLineSpacing = function() {
  8375. return this._lineSpacing
  8376. };
  8377. a.prototype._setLineSpacing = function(d) {
  8378. this._lineSpacing != d && (this._lineSpacing = d, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  8379. };
  8380. Object.defineProperty(a.prototype, "textColor", {
  8381. get: function() {
  8382. var d = this._styleProtoChain;
  8383. return d && void 0 !== d.textColor ? d.textColor : this._textColor
  8384. },
  8385. set: function(d) {
  8386. this.setStyle("textColor", d)
  8387. },
  8388. enumerable: !0,
  8389. configurable: !0
  8390. });
  8391. Object.defineProperty(a.prototype, "text", {
  8392. get: function() {
  8393. return this._textField ? this._textField.text : this._text
  8394. },
  8395. set: function(d) {
  8396. d != this._text && (this._text = d || "", this._textChanged = !0, this._textFlow = null, this._textFlowChanged = !1, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  8397. },
  8398. enumerable: !0,
  8399. configurable: !0
  8400. });
  8401. Object.defineProperty(a.prototype, "textFlow", {
  8402. get: function() {
  8403. return this._textField ? this._textField.textFlow : this._textFlow
  8404. },
  8405. set: function(d) {
  8406. this._textFlow = d || [];
  8407. this._textFlowChanged = !0;
  8408. this._text = null;
  8409. this._textChanged = !1;
  8410. this.invalidateProperties();
  8411. this.invalidateSize();
  8412. this.invalidateDisplayList()
  8413. },
  8414. enumerable: !0,
  8415. configurable: !0
  8416. });
  8417. a.prototype.createChildren = function() {
  8418. b.prototype.createChildren.call(this);
  8419. this._textField || this.checkTextField()
  8420. };
  8421. a.prototype.commitProperties = function() {
  8422. b.prototype.commitProperties.call(this);
  8423. this._textField || this.checkTextField();
  8424. this.allStyleChanged && (this.allStyleChanged = !1, this.verticalAlignChanged = this.textAlignChanged = this.italicChanged = this.boldChanged = this._sizeChanged = this.fontFamilyChanged = this.textColorChanged = !0);
  8425. this.fontFamilyChanged && (this._textField.fontFamily = this.fontFamily, this.fontFamilyChanged = !1);
  8426. this._sizeChanged && (this._textField.size = this.size, this._sizeChanged = !1);
  8427. this.boldChanged && (this._textField.bold = this.bold, this.boldChanged = !1);
  8428. this.italic && (this._textField.italic = this.italic, this.italicChanged = !1);
  8429. this.textAlignChanged && (this._textField.textAlign = this.textAlign, this.textAlignChanged = !1);
  8430. this.verticalAlignChanged && (this._textField.verticalAlign = this.verticalAlign, this.verticalAlignChanged = !1);
  8431. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  8432. this.textColorChanged && (this._textField.textColor = this.textColor, this.textColorChanged = !1);
  8433. this._textChanged && (this._textField.text = this._text, this._textChanged = !1);
  8434. this._textFlowChanged && (this._textField.textFlow = this._textFlow, this._textFlowChanged = !1)
  8435. };
  8436. a.prototype.checkTextField = function() {
  8437. this._textField || (this._createTextField(), this._text && (this._textField.text = this._text, this._textChanged = !0), this._textFlow && (this._textField.textFlow = this._textFlow, this._textFlowChanged = !0), this.invalidateProperties())
  8438. };
  8439. a.prototype._createTextField = function() {
  8440. this._textField = new c.TextField;
  8441. this._textField.fontFamily = this.fontFamily;
  8442. this._textField.size = this.size;
  8443. this._textField.textAlign = this.textAlign;
  8444. this._textField.verticalAlign = this.verticalAlign;
  8445. this._textField.lineSpacing = this._lineSpacing;
  8446. this._textField.textColor = this.textColor;
  8447. this._textField.multiline = !0;
  8448. this._addToDisplayList(this._textField)
  8449. };
  8450. a.prototype.measure = function() {
  8451. b.prototype.measure.call(this);
  8452. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  8453. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  8454. };
  8455. a.prototype.$updateDisplayList = function(d, a) {
  8456. b.prototype.updateDisplayList.call(this, d, a)
  8457. };
  8458. a.prototype.updateDisplayList = function(d, a) {
  8459. b.prototype.updateDisplayList.call(this, d, a);
  8460. this._textField.width = d;
  8461. this._textField.height = a
  8462. };
  8463. a.prototype.dispatchPropertyChangeEvent = function(d, a, b) {
  8464. this.hasEventListener("propertyChange") && e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, d, a, b, this)
  8465. };
  8466. a.DEFAULT_MEASURED_WIDTH = 160;
  8467. a.DEFAULT_MEASURED_HEIGHT = 22;
  8468. return a
  8469. }(e.UIComponent);
  8470. e.TextBase = f;
  8471. f.prototype.__class__ = "egret.gui.TextBase"
  8472. })(c.gui || (c.gui = {}))
  8473. })(egret || (egret = {}));
  8474. __extends = this.__extends || function(c, e) {
  8475. function f() {
  8476. this.constructor = c
  8477. }
  8478. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  8479. f.prototype = e.prototype;
  8480. c.prototype = new f
  8481. };
  8482. (function(c) {
  8483. (function(e) {
  8484. var f = function(b) {
  8485. function a() {
  8486. b.call(this);
  8487. this._contentHeight = this._contentWidth = 0;
  8488. this._clipAndEnableScrolling = !1;
  8489. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  8490. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  8491. }
  8492. __extends(a, b);
  8493. a.prototype.createChildren = function() {
  8494. b.prototype.createChildren.call(this);
  8495. this._layout || (this.layout = new e.BasicLayout)
  8496. };
  8497. Object.defineProperty(a.prototype, "contentWidth", {
  8498. get: function() {
  8499. return this._contentWidth
  8500. },
  8501. enumerable: !0,
  8502. configurable: !0
  8503. });
  8504. a.prototype.setContentWidth = function(d) {
  8505. if (d != this._contentWidth) {
  8506. var a = this._contentWidth;
  8507. this._contentWidth = d;
  8508. this.hasEventListener("propertyChange") && e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "contentWidth", a, d, this)
  8509. }
  8510. };
  8511. Object.defineProperty(a.prototype, "contentHeight", {
  8512. get: function() {
  8513. return this._contentHeight
  8514. },
  8515. enumerable: !0,
  8516. configurable: !0
  8517. });
  8518. a.prototype.setContentHeight = function(d) {
  8519. if (d != this._contentHeight) {
  8520. var a = this._contentHeight;
  8521. this._contentHeight = d;
  8522. this.hasEventListener("propertyChange") && e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "contentHeight", a, d, this)
  8523. }
  8524. };
  8525. a.prototype.setContentSize = function(d, a) {
  8526. if (d != this._contentWidth || a != this._contentHeight) this.setContentWidth(d), this.setContentHeight(a)
  8527. };
  8528. Object.defineProperty(a.prototype, "layout", {
  8529. get: function() {
  8530. return this._layout
  8531. },
  8532. set: function(d) {
  8533. this._setLayout(d)
  8534. },
  8535. enumerable: !0,
  8536. configurable: !0
  8537. });
  8538. a.prototype._setLayout = function(d) {
  8539. if (this._layout != d) {
  8540. this._layout && (this._layout.target = null);
  8541. if (this._layout = d) this._layout.target = this;
  8542. this.invalidateSize();
  8543. this.invalidateDisplayList();
  8544. this.dispatchEventWith("layoutChanged")
  8545. }
  8546. };
  8547. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  8548. get: function() {
  8549. return this._clipAndEnableScrolling
  8550. },
  8551. set: function(d) {
  8552. d != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = d) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  8553. },
  8554. enumerable: !0,
  8555. configurable: !0
  8556. });
  8557. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  8558. get: function() {
  8559. return this._horizontalScrollPosition
  8560. },
  8561. set: function(d) {
  8562. if (d != this._horizontalScrollPosition) {
  8563. var a = this._horizontalScrollPosition;
  8564. this._horizontalScrollPosition = d;
  8565. this.scrollPositionChanged();
  8566. e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, d, this)
  8567. }
  8568. },
  8569. enumerable: !0,
  8570. configurable: !0
  8571. });
  8572. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  8573. get: function() {
  8574. return this._verticalScrollPosition
  8575. },
  8576. set: function(d) {
  8577. if (d != this._verticalScrollPosition) {
  8578. var a = this._verticalScrollPosition;
  8579. this._verticalScrollPosition = d;
  8580. this.scrollPositionChanged();
  8581. e.PropertyChangeEvent.dispatchPropertyChangeEvent(this, e.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, d, this)
  8582. }
  8583. },
  8584. enumerable: !0,
  8585. configurable: !0
  8586. });
  8587. a.prototype.scrollPositionChanged = function() {
  8588. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(), this._layout && this._layout.scrollPositionChanged())
  8589. };
  8590. a.prototype.updateScrollRect = function(d, a) {
  8591. var b = this._scrollRect;
  8592. this._clipAndEnableScrolling ? b ? (b.x = this._horizontalScrollPosition, b.y = this._verticalScrollPosition, b.width = d, b.height = a) : this._scrollRect = new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, d, a) : b && (this._scrollRect = null)
  8593. };
  8594. a.prototype.measure = function() {
  8595. this._layout && this._layoutInvalidateSizeFlag && (b.prototype.measure.call(this), this._layout.measure())
  8596. };
  8597. a.prototype._invalidateDisplayListExceptLayout = function() {
  8598. b.prototype.invalidateDisplayList.call(this)
  8599. };
  8600. a.prototype.invalidateDisplayList = function() {
  8601. b.prototype.invalidateDisplayList.call(this);
  8602. this._layoutInvalidateDisplayListFlag = !0
  8603. };
  8604. a.prototype._childXYChanged = function() {
  8605. this.invalidateSize();
  8606. this.invalidateDisplayList()
  8607. };
  8608. a.prototype._invalidateSizeExceptLayout = function() {
  8609. b.prototype.invalidateSize.call(this)
  8610. };
  8611. a.prototype.invalidateSize = function() {
  8612. b.prototype.invalidateSize.call(this);
  8613. this._layoutInvalidateSizeFlag = !0
  8614. };
  8615. a.prototype.updateDisplayList = function(d, a) {
  8616. b.prototype.updateDisplayList.call(this, d, a);
  8617. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(d, a), this.updateScrollRect(d, a))
  8618. };
  8619. Object.defineProperty(a.prototype, "numElements", {
  8620. get: function() {
  8621. return -1
  8622. },
  8623. enumerable: !0,
  8624. configurable: !0
  8625. });
  8626. a.prototype.getElementAt = function(d) {
  8627. return null
  8628. };
  8629. a.prototype.getElementIndex = function(d) {
  8630. return -1
  8631. };
  8632. a.prototype.getElementIndicesInView = function() {
  8633. var d = [],
  8634. a;
  8635. if (this.scrollRect)
  8636. for (a = 0; a < this.numChildren; a++) {
  8637. var b = this.getChildAt(a);
  8638. if (b) {
  8639. var e = new c.Rectangle;
  8640. e.x = b.layoutBoundsX;
  8641. e.y = b.layoutBoundsY;
  8642. e.width = b.layoutBoundsWidth;
  8643. e.height = b.layoutBoundsHeight;
  8644. this.scrollRect.intersects(e) && d.push(a)
  8645. }
  8646. } else
  8647. for (a = 0; a < this.numChildren; a++) d.push(a);
  8648. return d
  8649. };
  8650. a.prototype.setVirtualElementIndicesInView = function(d, a) {};
  8651. a.prototype.getVirtualElementAt = function(d) {
  8652. return this.getElementAt(d)
  8653. };
  8654. return a
  8655. }(e.UIComponent);
  8656. e.GroupBase = f;
  8657. f.prototype.__class__ = "egret.gui.GroupBase"
  8658. })(c.gui || (c.gui = {}))
  8659. })(egret || (egret = {}));
  8660. __extends = this.__extends || function(c, e) {
  8661. function f() {
  8662. this.constructor = c
  8663. }
  8664. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  8665. f.prototype = e.prototype;
  8666. c.prototype = new f
  8667. };
  8668. (function(c) {
  8669. (function(c) {
  8670. var f = function(b) {
  8671. function a() {
  8672. b.call(this);
  8673. this._selected = this.dataChangedFlag = !1;
  8674. this._itemIndex = -1;
  8675. this.touchChildren = !0
  8676. }
  8677. __extends(a, b);
  8678. Object.defineProperty(a.prototype, "data", {
  8679. get: function() {
  8680. return this._data
  8681. },
  8682. set: function(d) {
  8683. this._data = d;
  8684. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  8685. },
  8686. enumerable: !0,
  8687. configurable: !0
  8688. });
  8689. a.prototype.dataChanged = function() {};
  8690. Object.defineProperty(a.prototype, "selected", {
  8691. get: function() {
  8692. return this._selected
  8693. },
  8694. set: function(d) {
  8695. this._selected != d && (this._selected = d, this.invalidateSkinState())
  8696. },
  8697. enumerable: !0,
  8698. configurable: !0
  8699. });
  8700. Object.defineProperty(a.prototype, "itemIndex", {
  8701. get: function() {
  8702. return this._itemIndex
  8703. },
  8704. set: function(d) {
  8705. this._itemIndex = d
  8706. },
  8707. enumerable: !0,
  8708. configurable: !0
  8709. });
  8710. a.prototype.commitProperties = function() {
  8711. b.prototype.commitProperties.call(this);
  8712. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  8713. };
  8714. a.prototype.getCurrentSkinState = function() {
  8715. return this._selected ? "down" : b.prototype.getCurrentSkinState.call(this)
  8716. };
  8717. return a
  8718. }(c.ButtonBase);
  8719. c.ItemRenderer = f;
  8720. f.prototype.__class__ = "egret.gui.ItemRenderer"
  8721. })(c.gui || (c.gui = {}))
  8722. })(egret || (egret = {}));
  8723. (function(c) {
  8724. (function(e) {
  8725. var f = function() {
  8726. function b(a, d) {
  8727. this.easerFunction = c.Ease.sineInOut;
  8728. this._duration = 500;
  8729. this._startDelay = 0;
  8730. this._repeatCount = 1;
  8731. this._repeatDelay = 0;
  8732. this.motionPaths = [];
  8733. this._currentValue = {};
  8734. this.pauseTime = 0;
  8735. this._isPaused = !1;
  8736. this.startTime = 0;
  8737. this._started = !1;
  8738. this.playedTimes = 0;
  8739. this.updateFunction = a;
  8740. this.thisObject = d
  8741. }
  8742. Object.defineProperty(b.prototype, "isPlaying", {
  8743. get: function() {
  8744. return this._isPlaying
  8745. },
  8746. enumerable: !0,
  8747. configurable: !0
  8748. });
  8749. Object.defineProperty(b.prototype, "duration", {
  8750. get: function() {
  8751. return this._duration
  8752. },
  8753. set: function(a) {
  8754. this._duration = a
  8755. },
  8756. enumerable: !0,
  8757. configurable: !0
  8758. });
  8759. Object.defineProperty(b.prototype, "startDelay", {
  8760. get: function() {
  8761. return this._startDelay
  8762. },
  8763. set: function(a) {
  8764. this._startDelay = a
  8765. },
  8766. enumerable: !0,
  8767. configurable: !0
  8768. });
  8769. Object.defineProperty(b.prototype, "repeatCount", {
  8770. get: function() {
  8771. return this._repeatCount
  8772. },
  8773. set: function(a) {
  8774. this._repeatCount = a
  8775. },
  8776. enumerable: !0,
  8777. configurable: !0
  8778. });
  8779. Object.defineProperty(b.prototype, "repeatDelay", {
  8780. get: function() {
  8781. return this._repeatDelay
  8782. },
  8783. set: function(a) {
  8784. this._repeatDelay = a
  8785. },
  8786. enumerable: !0,
  8787. configurable: !0
  8788. });
  8789. Object.defineProperty(b.prototype, "currentValue", {
  8790. get: function() {
  8791. return this._currentValue
  8792. },
  8793. enumerable: !0,
  8794. configurable: !0
  8795. });
  8796. b.prototype.play = function() {
  8797. this.stopAnimation();
  8798. this.start()
  8799. };
  8800. b.prototype.seek = function(a) {
  8801. a = Math.min(a, this.duration);
  8802. this.caculateCurrentValue(a / this.duration);
  8803. this.startTime = c.getTimer() - a - this._startDelay;
  8804. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  8805. };
  8806. b.prototype.start = function() {
  8807. this.playedTimes = 0;
  8808. this._started = !0;
  8809. this._isPlaying = !1;
  8810. this._currentValue = {};
  8811. this.caculateCurrentValue(0);
  8812. this.startTime = c.getTimer();
  8813. b.currentTime = this.startTime;
  8814. this.doInterval();
  8815. b.addAnimation(this)
  8816. };
  8817. b.prototype.end = function() {
  8818. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  8819. this.caculateCurrentValue(1);
  8820. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  8821. this.stopAnimation();
  8822. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  8823. };
  8824. b.prototype.stop = function() {
  8825. this.stopAnimation();
  8826. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  8827. };
  8828. b.prototype.stopAnimation = function() {
  8829. this.playedTimes = 0;
  8830. this._isPlaying = !1;
  8831. this.startTime = 0;
  8832. this._started = !1;
  8833. b.removeAnimation(this)
  8834. };
  8835. Object.defineProperty(b.prototype, "isPaused", {
  8836. get: function() {
  8837. return this._isPaused
  8838. },
  8839. enumerable: !0,
  8840. configurable: !0
  8841. });
  8842. b.prototype.pause = function() {
  8843. this._started && (this._isPaused = !0, this.pauseTime = c.getTimer(), this._isPlaying = !1, b.removeAnimation(this))
  8844. };
  8845. b.prototype.resume = function() {
  8846. this._started && this._isPaused && (this._isPaused = !1, this.startTime += c.getTimer() - this.pauseTime, this.pauseTime = -1, b.addAnimation(this))
  8847. };
  8848. Object.defineProperty(b.prototype, "started", {
  8849. get: function() {
  8850. return this._started
  8851. },
  8852. enumerable: !0,
  8853. configurable: !0
  8854. });
  8855. b.prototype.doInterval = function() {
  8856. var a = b.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay : this._startDelay);
  8857. if (0 > a) return !1;
  8858. this._isPlaying || (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  8859. var d = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  8860. this.caculateCurrentValue(d);
  8861. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  8862. if (a = a >= this._duration) this.playedTimes++, this._isPlaying = !1, this.startTime = b.currentTime, 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (b.removeAnimation(this), this._started = !1, this.playedTimes = 0);
  8863. a && null != this.endFunction && this.endFunction.call(this.thisObject, this);
  8864. return a
  8865. };
  8866. b.prototype.caculateCurrentValue = function(a) {
  8867. this.easerFunction && (a = this.easerFunction(a));
  8868. for (var d = this.motionPaths, b = d.length, c = 0; c < b; c++) {
  8869. var e = d[c];
  8870. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  8871. }
  8872. };
  8873. b.addAnimation = function(a) {
  8874. -1 == b.activeAnimations.indexOf(a) && (b.activeAnimations.push(a), b.registered || (b.registered = !0, c.Ticker.getInstance().register(b.onEnterFrame, null)))
  8875. };
  8876. b.removeAnimation = function(a) {
  8877. a = b.activeAnimations.indexOf(a); - 1 != a && (b.activeAnimations.splice(a, 1), a <= b.currentIntervalIndex && b.currentIntervalIndex--);
  8878. 0 == b.activeAnimations.length && b.registered && (b.registered = !1, c.Ticker.getInstance().unregister(b.onEnterFrame, null))
  8879. };
  8880. b.onEnterFrame = function(a, d) {
  8881. b.currentTime = c.getTimer();
  8882. for (b.currentIntervalIndex = 0; b.currentIntervalIndex < b.activeAnimations.length;) b.activeAnimations[b.currentIntervalIndex].doInterval(), b.currentIntervalIndex++;
  8883. b.currentIntervalIndex = -1;
  8884. 0 == b.activeAnimations.length && b.registered && (b.registered = !1, c.Ticker.getInstance().unregister(b.onEnterFrame, null))
  8885. };
  8886. b.currentTime = 0;
  8887. b.TIMER_RESOLUTION = 1E3 / 60;
  8888. b.activeAnimations = [];
  8889. b.currentIntervalIndex = -1;
  8890. return b
  8891. }();
  8892. e.Animation = f;
  8893. f.prototype.__class__ = "egret.gui.Animation"
  8894. })(c.gui || (c.gui = {}))
  8895. })(egret || (egret = {}));
  8896. __extends = this.__extends || function(c, e) {
  8897. function f() {
  8898. this.constructor = c
  8899. }
  8900. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  8901. f.prototype = e.prototype;
  8902. c.prototype = new f
  8903. };
  8904. (function(c) {
  8905. (function(c) {
  8906. var f = function(b) {
  8907. function a() {
  8908. b.call(this);
  8909. this._maximum = 100;
  8910. this.maxChanged = !1;
  8911. this._minimum = 0;
  8912. this.minChanged = !1;
  8913. this._stepSize = 1;
  8914. this.stepSizeChanged = !1;
  8915. this._changedValue = this._value = 0;
  8916. this.valueChanged = !1;
  8917. this._snapInterval = 1;
  8918. this._explicitSnapInterval = this.snapIntervalChanged = !1
  8919. }
  8920. __extends(a, b);
  8921. Object.defineProperty(a.prototype, "maximum", {
  8922. get: function() {
  8923. return this._maximum
  8924. },
  8925. set: function(d) {
  8926. this._setMaximun(d)
  8927. },
  8928. enumerable: !0,
  8929. configurable: !0
  8930. });
  8931. a.prototype._setMaximun = function(d) {
  8932. d != this._maximum && (this._maximum = d, this.maxChanged = !0, this.invalidateProperties())
  8933. };
  8934. Object.defineProperty(a.prototype, "minimum", {
  8935. get: function() {
  8936. return this._minimum
  8937. },
  8938. set: function(d) {
  8939. this._setMinimun(d)
  8940. },
  8941. enumerable: !0,
  8942. configurable: !0
  8943. });
  8944. a.prototype._setMinimun = function(d) {
  8945. d != this._minimum && (this._minimum = d, this.minChanged = !0, this.invalidateProperties())
  8946. };
  8947. Object.defineProperty(a.prototype, "stepSize", {
  8948. get: function() {
  8949. return this._stepSize
  8950. },
  8951. set: function(d) {
  8952. d != this._stepSize && (this._stepSize = d, this.stepSizeChanged = !0, this.invalidateProperties())
  8953. },
  8954. enumerable: !0,
  8955. configurable: !0
  8956. });
  8957. Object.defineProperty(a.prototype, "value", {
  8958. get: function() {
  8959. return this._getValue()
  8960. },
  8961. set: function(d) {
  8962. this._setValue(d)
  8963. },
  8964. enumerable: !0,
  8965. configurable: !0
  8966. });
  8967. a.prototype._setValue = function(d) {
  8968. d != this.value && (this._changedValue = d, this.valueChanged = !0, this.invalidateProperties())
  8969. };
  8970. a.prototype._getValue = function() {
  8971. return this.valueChanged ? this._changedValue : this._value
  8972. };
  8973. Object.defineProperty(a.prototype, "snapInterval", {
  8974. get: function() {
  8975. return this._snapInterval
  8976. },
  8977. set: function(d) {
  8978. this._explicitSnapInterval = !0;
  8979. d != this._snapInterval && (isNaN(d) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = d, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  8980. },
  8981. enumerable: !0,
  8982. configurable: !0
  8983. });
  8984. a.prototype.commitProperties = function() {
  8985. b.prototype.commitProperties.call(this);
  8986. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum : this._minimum = this._maximum);
  8987. if (this.valueChanged || this.maxChanged || this.minChanged || this.snapIntervalChanged) {
  8988. var d = this.valueChanged ? this._changedValue : this._value;
  8989. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  8990. this.setValue(this.nearestValidValue(d, this.snapInterval))
  8991. }
  8992. 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)
  8993. };
  8994. a.prototype.nearestValidSize = function(d) {
  8995. var a = this.snapInterval;
  8996. if (0 == a) return d;
  8997. d = Math.round(d / a) * a;
  8998. return Math.abs(d) < a ? a : d
  8999. };
  9000. a.prototype.nearestValidValue = function(d, a) {
  9001. if (0 == a) return Math.max(this.minimum, Math.min(this.maximum, d));
  9002. var b = this.maximum - this.minimum,
  9003. c = 1;
  9004. d -= this.minimum;
  9005. a != Math.round(a) && (c = (1 + a).toString().split("."), c = Math.pow(10, c[1].length), b *= c, d = Math.round(d * c), a = Math.round(a * c));
  9006. var e = Math.max(0, Math.floor(d / a) * a),
  9007. b = Math.min(b, Math.floor((d + a) / a) * a);
  9008. return (d - e >= (b - e) / 2 ? b : e) / c + this.minimum
  9009. };
  9010. a.prototype.setValue = function(d) {
  9011. this._value != d && (isNaN(d) && (d = 0), !isNaN(this.maximum) && !isNaN(this.minimum) && this.maximum > this.minimum ? this._value = Math.min(this.maximum, Math.max(this.minimum, d)) : this._value = d, this.valueChanged = !1)
  9012. };
  9013. a.prototype.changeValueByStep = function(d) {
  9014. void 0 === d && (d = !0);
  9015. 0 != this.stepSize && this.setValue(this.nearestValidValue(d ? this.value + this.stepSize : this.value - this.stepSize, this.snapInterval))
  9016. };
  9017. return a
  9018. }(c.SkinnableComponent);
  9019. c.Range = f;
  9020. f.prototype.__class__ = "egret.gui.Range"
  9021. })(c.gui || (c.gui = {}))
  9022. })(egret || (egret = {}));
  9023. __extends = this.__extends || function(c, e) {
  9024. function f() {
  9025. this.constructor = c
  9026. }
  9027. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9028. f.prototype = e.prototype;
  9029. c.prototype = new f
  9030. };
  9031. (function(c) {
  9032. (function(e) {
  9033. var f = function(b) {
  9034. function a() {
  9035. b.call(this);
  9036. this._slideDuration = 300;
  9037. this.needUpdateValue = !1;
  9038. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  9039. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  9040. }
  9041. __extends(a, b);
  9042. Object.defineProperty(a.prototype, "slideDuration", {
  9043. get: function() {
  9044. return this._slideDuration
  9045. },
  9046. set: function(d) {
  9047. this._slideDuration = d
  9048. },
  9049. enumerable: !0,
  9050. configurable: !0
  9051. });
  9052. Object.defineProperty(a.prototype, "maximum", {
  9053. get: function() {
  9054. return this._maximum
  9055. },
  9056. set: function(d) {
  9057. d != this._maximum && (this._setMaximun(d), this.invalidateDisplayList())
  9058. },
  9059. enumerable: !0,
  9060. configurable: !0
  9061. });
  9062. Object.defineProperty(a.prototype, "minimum", {
  9063. get: function() {
  9064. return this._minimum
  9065. },
  9066. set: function(d) {
  9067. d != this._minimum && (this._setMinimun(d), this.invalidateDisplayList())
  9068. },
  9069. enumerable: !0,
  9070. configurable: !0
  9071. });
  9072. Object.defineProperty(a.prototype, "value", {
  9073. get: function() {
  9074. return this._getValue()
  9075. },
  9076. set: function(d) {
  9077. d != this._getValue() && (this._setValue(d), this.invalidateDisplayList())
  9078. },
  9079. enumerable: !0,
  9080. configurable: !0
  9081. });
  9082. a.prototype.setValue = function(d) {
  9083. b.prototype.setValue.call(this, d);
  9084. this.invalidateDisplayList()
  9085. };
  9086. a.prototype.pointToValue = function(d, a) {
  9087. return this.minimum
  9088. };
  9089. a.prototype.changeValueByStep = function(d) {
  9090. void 0 === d && (d = !0);
  9091. var a = this.value;
  9092. b.prototype.changeValueByStep.call(this, d);
  9093. this.value != a && this.dispatchEventWith(c.Event.CHANGE)
  9094. };
  9095. a.prototype.partAdded = function(d, a) {
  9096. b.prototype.partAdded.call(this, d, a);
  9097. a == this.thumb ? (this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGIN, 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(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.addEventListener(e.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  9098. };
  9099. a.prototype.partRemoved = function(d, a) {
  9100. b.prototype.partRemoved.call(this, d, a);
  9101. a == this.thumb ? (this.thumb.removeEventListener(c.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(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.removeEventListener(e.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  9102. };
  9103. a.prototype.updateDisplayList = function(d, a) {
  9104. b.prototype.updateDisplayList.call(this, d, a);
  9105. this.updateSkinDisplayList()
  9106. };
  9107. a.prototype.updateSkinDisplayList = function() {};
  9108. a.prototype.addedToStageHandler = function(d) {
  9109. this.updateSkinDisplayList()
  9110. };
  9111. a.prototype.track_resizeHandler = function(d) {
  9112. this.updateSkinDisplayList()
  9113. };
  9114. a.prototype.thumb_resizeHandler = function(d) {
  9115. this.updateSkinDisplayList()
  9116. };
  9117. a.prototype.thumb_updateCompleteHandler = function(d) {
  9118. this.updateSkinDisplayList();
  9119. this.thumb.removeEventListener(e.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)
  9120. };
  9121. a.prototype.thumb_mouseDownHandler = function(d) {
  9122. e.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  9123. e.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  9124. e.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  9125. this.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  9126. d = this.thumb.globalToLocal(d.stageX, d.stageY, c.Point.identity);
  9127. this._clickOffsetX = d.x;
  9128. this._clickOffsetY = d.y;
  9129. e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_PRESS);
  9130. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_START)
  9131. };
  9132. a.prototype.onEnterFrame = function(d) {
  9133. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  9134. };
  9135. a.prototype.updateWhenMouseMove = function() {
  9136. if (this.track) {
  9137. var d = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  9138. d = this.pointToValue(d.x - this._clickOffsetX, d.y - this._clickOffsetY),
  9139. d = this.nearestValidValue(d, this.snapInterval);
  9140. d != this.value && (this.setValue(d), this.validateDisplayList(), e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(c.Event.CHANGE))
  9141. }
  9142. };
  9143. a.prototype.stage_mouseMoveHandler = function(d) {
  9144. this._moveStageX = d.stageX;
  9145. this._moveStageY = d.stageY;
  9146. this.needUpdateValue || (this.needUpdateValue = !0)
  9147. };
  9148. a.prototype.stage_mouseUpHandler = function(d) {
  9149. e.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  9150. e.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  9151. e.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  9152. this.removeEventListener(c.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  9153. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  9154. e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_RELEASE);
  9155. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  9156. };
  9157. a.prototype.track_mouseDownHandler = function(d) {};
  9158. a.prototype.mouseDownHandler = function(d) {
  9159. e.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  9160. e.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  9161. this.mouseDownTarget = d.target
  9162. };
  9163. a.prototype.stage_mouseUpSomewhereHandler = function(d) {
  9164. e.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  9165. e.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  9166. if (this.mouseDownTarget != d.target && d instanceof c.TouchEvent && this.contains(d.target)) {
  9167. var a = d.target.localToGlobal(d.localX, d.localY);
  9168. c.TouchEvent.dispatchTouchEvent(this, c.TouchEvent.TOUCH_TAP, d.touchPointID, a.x, a.y, d.ctrlKey, d.altKey, d.shiftKey, d.touchDown)
  9169. }
  9170. this.mouseDownTarget = null
  9171. };
  9172. return a
  9173. }(e.Range);
  9174. e.TrackBase = f;
  9175. f.prototype.__class__ = "egret.gui.TrackBase"
  9176. })(c.gui || (c.gui = {}))
  9177. })(egret || (egret = {}));
  9178. __extends = this.__extends || function(c, e) {
  9179. function f() {
  9180. this.constructor = c
  9181. }
  9182. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9183. f.prototype = e.prototype;
  9184. c.prototype = new f
  9185. };
  9186. (function(c) {
  9187. (function(e) {
  9188. var f = function(b) {
  9189. function a() {
  9190. b.call(this);
  9191. this._showTrackHighlight = !0;
  9192. this._pendingValue = 0;
  9193. this._liveDragging = !0;
  9194. this.maximum = 10
  9195. }
  9196. __extends(a, b);
  9197. Object.defineProperty(a.prototype, "showTrackHighlight", {
  9198. get: function() {
  9199. return this._showTrackHighlight
  9200. },
  9201. set: function(d) {
  9202. this._showTrackHighlight != d && (this._showTrackHighlight = d, this.trackHighlight && (this.trackHighlight.visible = d), this.invalidateDisplayList())
  9203. },
  9204. enumerable: !0,
  9205. configurable: !0
  9206. });
  9207. Object.defineProperty(a.prototype, "pendingValue", {
  9208. get: function() {
  9209. return this._pendingValue
  9210. },
  9211. set: function(d) {
  9212. d != this._pendingValue && (this._pendingValue = d, this.invalidateDisplayList())
  9213. },
  9214. enumerable: !0,
  9215. configurable: !0
  9216. });
  9217. a.prototype.setValue = function(d) {
  9218. this._pendingValue = d;
  9219. b.prototype.setValue.call(this, d)
  9220. };
  9221. a.prototype._animationUpdateHandler = function(d) {
  9222. this.pendingValue = d.currentValue.value
  9223. };
  9224. a.prototype.animationEndHandler = function(d) {
  9225. this.setValue(this.slideToValue);
  9226. this.dispatchEventWith(c.Event.CHANGE);
  9227. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  9228. };
  9229. a.prototype.stopAnimation = function() {
  9230. this.animator.stop();
  9231. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  9232. this.dispatchEventWith(c.Event.CHANGE);
  9233. e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_END)
  9234. };
  9235. a.prototype.thumb_mouseDownHandler = function(d) {
  9236. this.animator && this.animator.isPlaying && this.stopAnimation();
  9237. b.prototype.thumb_mouseDownHandler.call(this, d)
  9238. };
  9239. Object.defineProperty(a.prototype, "liveDragging", {
  9240. get: function() {
  9241. return this._liveDragging
  9242. },
  9243. set: function(d) {
  9244. this._liveDragging = d
  9245. },
  9246. enumerable: !0,
  9247. configurable: !0
  9248. });
  9249. a.prototype.updateWhenMouseMove = function() {
  9250. if (this.track) {
  9251. var d = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  9252. d = this.pointToValue(d.x - this._clickOffsetX, d.y - this._clickOffsetY),
  9253. d = this.nearestValidValue(d, this.snapInterval);
  9254. d != this.pendingValue && (e.TrackBaseEvent.dispatchTrackBaseEvent(this, e.TrackBaseEvent.THUMB_DRAG), !0 == this.liveDragging ? (this.setValue(d), this.dispatchEventWith(c.Event.CHANGE)) : this.pendingValue = d)
  9255. }
  9256. };
  9257. a.prototype.stage_mouseUpHandler = function(d) {
  9258. b.prototype.stage_mouseUpHandler.call(this, d);
  9259. !1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(c.Event.CHANGE))
  9260. };
  9261. a.prototype.track_mouseDownHandler = function(d) {
  9262. this.enabled && (d = this.track.globalToLocal(d.stageX - (this.thumb ? this.thumb.width : 0) / 2, d.stageY - (this.thumb ? this.thumb.height : 0) / 2, c.Point.identity), d = this.pointToValue(d.x, d.y), d = this.nearestValidValue(d, this.snapInterval), d != this.pendingValue && (0 != this.slideDuration ? (this.animator || (this.animator = new e.Animation(this._animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler), this.animator.isPlaying && this.stopAnimation(), this.slideToValue = d, this.animator.duration = this.slideDuration * (Math.abs(this.pendingValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.motionPaths = [{
  9263. prop: "value",
  9264. from: this.pendingValue,
  9265. to: this.slideToValue
  9266. }], e.UIEvent.dispatchUIEvent(this, e.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(d), this.dispatchEventWith(c.Event.CHANGE))))
  9267. };
  9268. a.prototype.partAdded = function(d, a) {
  9269. b.prototype.partAdded.call(this, d, a);
  9270. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof c.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  9271. };
  9272. return a
  9273. }(e.TrackBase);
  9274. e.SliderBase = f;
  9275. f.prototype.__class__ = "egret.gui.SliderBase"
  9276. })(c.gui || (c.gui = {}))
  9277. })(egret || (egret = {}));
  9278. __extends = this.__extends || function(c, e) {
  9279. function f() {
  9280. this.constructor = c
  9281. }
  9282. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9283. f.prototype = e.prototype;
  9284. c.prototype = new f
  9285. };
  9286. (function(c) {
  9287. (function(c) {
  9288. var f = function(b) {
  9289. function a() {
  9290. b.call(this);
  9291. this._maxDisplayedLines = 0;
  9292. this.lastUnscaledWidth = NaN;
  9293. this.strokeColorChanged = !1;
  9294. this._stroke = this._strokeColor = 0;
  9295. this.strokeChanged = !1;
  9296. this._padding = 0;
  9297. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  9298. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  9299. }
  9300. __extends(a, b);
  9301. a.prototype.updateCompleteHandler = function(d) {
  9302. this.lastUnscaledWidth = NaN
  9303. };
  9304. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  9305. get: function() {
  9306. return this._maxDisplayedLines
  9307. },
  9308. set: function(d) {
  9309. this._maxDisplayedLines != d && (this._maxDisplayedLines = d, this.invalidateSize(), this.invalidateDisplayList())
  9310. },
  9311. enumerable: !0,
  9312. configurable: !0
  9313. });
  9314. Object.defineProperty(a.prototype, "strokeColor", {
  9315. get: function() {
  9316. return this._strokeColor
  9317. },
  9318. set: function(d) {
  9319. this._setStrokeColor(d)
  9320. },
  9321. enumerable: !0,
  9322. configurable: !0
  9323. });
  9324. a.prototype._setStrokeColor = function(d) {
  9325. this._strokeColor != d && (this._strokeColor = d, this.strokeColorChanged = !0, this.invalidateProperties())
  9326. };
  9327. Object.defineProperty(a.prototype, "stroke", {
  9328. get: function() {
  9329. return this._stroke
  9330. },
  9331. set: function(d) {
  9332. this._stroke != d && (this._stroke = d, this.strokeChanged = !0, this.invalidateProperties())
  9333. },
  9334. enumerable: !0,
  9335. configurable: !0
  9336. });
  9337. Object.defineProperty(a.prototype, "padding", {
  9338. get: function() {
  9339. return this._padding
  9340. },
  9341. set: function(d) {
  9342. this._padding != d && (this._padding = d, this.invalidateSize(), this.invalidateDisplayList())
  9343. },
  9344. enumerable: !0,
  9345. configurable: !0
  9346. });
  9347. Object.defineProperty(a.prototype, "paddingLeft", {
  9348. get: function() {
  9349. return this._paddingLeft
  9350. },
  9351. set: function(d) {
  9352. this._paddingLeft != d && (this._paddingLeft = d, this.invalidateSize(), this.invalidateDisplayList())
  9353. },
  9354. enumerable: !0,
  9355. configurable: !0
  9356. });
  9357. Object.defineProperty(a.prototype, "paddingRight", {
  9358. get: function() {
  9359. return this._paddingRight
  9360. },
  9361. set: function(d) {
  9362. this._paddingRight != d && (this._paddingRight = d, this.invalidateSize(), this.invalidateDisplayList())
  9363. },
  9364. enumerable: !0,
  9365. configurable: !0
  9366. });
  9367. Object.defineProperty(a.prototype, "paddingTop", {
  9368. get: function() {
  9369. return this._paddingTop
  9370. },
  9371. set: function(d) {
  9372. this._paddingTop != d && (this._paddingTop = d, this.invalidateSize(), this.invalidateDisplayList())
  9373. },
  9374. enumerable: !0,
  9375. configurable: !0
  9376. });
  9377. Object.defineProperty(a.prototype, "paddingBottom", {
  9378. get: function() {
  9379. return this._paddingBottom
  9380. },
  9381. set: function(d) {
  9382. this._paddingBottom != d && (this._paddingBottom = d, this.invalidateSize(), this.invalidateDisplayList())
  9383. },
  9384. enumerable: !0,
  9385. configurable: !0
  9386. });
  9387. a.prototype.commitProperties = function() {
  9388. b.prototype.commitProperties.call(this);
  9389. this.strokeColorChanged && (this._textField.strokeColor = this._strokeColor, this.strokeColorChanged = !1);
  9390. this.strokeChanged && (this._textField.stroke = this._stroke, this.strokeChanged = !1)
  9391. };
  9392. a.prototype.measure = function() {
  9393. this._invalidatePropertiesFlag && this.validateProperties();
  9394. if (this.isSpecialCase())
  9395. if (isNaN(this.lastUnscaledWidth)) this._oldPreferHeight = this._oldPreferWidth = NaN;
  9396. else {
  9397. this.measureUsingWidth(this.lastUnscaledWidth);
  9398. return
  9399. }
  9400. var d;
  9401. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (d = this.maxWidth) : d = this.explicitWidth;
  9402. this.measureUsingWidth(d)
  9403. };
  9404. a.prototype.isSpecialCase = function() {
  9405. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  9406. };
  9407. a.prototype.measureUsingWidth = function(d) {
  9408. this._textChanged && (this._textField.text = this._text);
  9409. this._textFlowChanged && (this._textField.textFlow = this._textFlow);
  9410. var a = isNaN(this._padding) ? 0 : this._padding,
  9411. b = isNaN(this._paddingLeft) ? a : this._paddingLeft,
  9412. c = isNaN(this._paddingRight) ? a : this._paddingRight,
  9413. e = isNaN(this._paddingTop) ? a : this._paddingTop,
  9414. a = isNaN(this._paddingBottom) ? a : this._paddingBottom;
  9415. this._textField.width = NaN;
  9416. this._textField.height = NaN;
  9417. isNaN(d) || (this._textField.width = d - b - c);
  9418. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  9419. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  9420. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (d = this._textField.lineSpacing, this.measuredHeight = (this._textField.size + d) * this._maxDisplayedLines - d);
  9421. this.measuredWidth += b + c;
  9422. this.measuredHeight += e + a
  9423. };
  9424. a.prototype.updateDisplayList = function(d, a) {
  9425. this.$updateDisplayList(d, a);
  9426. var b = isNaN(this._padding) ? 0 : this._padding,
  9427. c = isNaN(this._paddingLeft) ? b : this._paddingLeft,
  9428. e = isNaN(this._paddingRight) ? b : this._paddingRight,
  9429. f = isNaN(this._paddingTop) ? b : this._paddingTop,
  9430. b = isNaN(this._paddingBottom) ? b : this._paddingBottom;
  9431. this._textField.x = c;
  9432. this._textField.y = f;
  9433. if (this.isSpecialCase()) {
  9434. var k = isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != d;
  9435. this.lastUnscaledWidth = d;
  9436. if (k) {
  9437. this._oldPreferHeight = this._oldPreferWidth = NaN;
  9438. this.invalidateSize();
  9439. return
  9440. }
  9441. }
  9442. this._invalidateSizeFlag && this.validateSize();
  9443. this._textField.visible || (this._textField.visible = !0);
  9444. this._textField.width = d - c - e;
  9445. c = a - f - b;
  9446. this._textField.height = c;
  9447. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(c, (this._textField.size + e) * this._maxDisplayedLines - e))
  9448. };
  9449. return a
  9450. }(c.TextBase);
  9451. c.Label = f;
  9452. f.prototype.__class__ = "egret.gui.Label"
  9453. })(c.gui || (c.gui = {}))
  9454. })(egret || (egret = {}));
  9455. __extends = this.__extends || function(c, e) {
  9456. function f() {
  9457. this.constructor = c
  9458. }
  9459. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9460. f.prototype = e.prototype;
  9461. c.prototype = new f
  9462. };
  9463. (function(c) {
  9464. (function(e) {
  9465. var f = function(b) {
  9466. function a() {
  9467. b.call(this);
  9468. this._fillColor = 16777215;
  9469. this._fillAlpha = 1;
  9470. this._strokeColor = 4473924;
  9471. this._strokeAlpha = 0;
  9472. this._strokeWeight = 1;
  9473. this.touchChildren = !1
  9474. }
  9475. __extends(a, b);
  9476. Object.defineProperty(a.prototype, "graphics", {
  9477. get: function() {
  9478. this._graphics || (this._graphics = new c.Graphics);
  9479. return this._graphics
  9480. },
  9481. enumerable: !0,
  9482. configurable: !0
  9483. });
  9484. a.prototype._render = function(d) {
  9485. this._graphics && this._graphics._draw(d);
  9486. b.prototype._render.call(this, d)
  9487. };
  9488. Object.defineProperty(a.prototype, "fillColor", {
  9489. get: function() {
  9490. return this._fillColor
  9491. },
  9492. set: function(d) {
  9493. this._fillColor != d && (this._fillColor = d, this.invalidateDisplayList())
  9494. },
  9495. enumerable: !0,
  9496. configurable: !0
  9497. });
  9498. Object.defineProperty(a.prototype, "fillAlpha", {
  9499. get: function() {
  9500. return this._fillAlpha
  9501. },
  9502. set: function(d) {
  9503. this._fillAlpha != d && (this._fillAlpha = d, this.invalidateDisplayList())
  9504. },
  9505. enumerable: !0,
  9506. configurable: !0
  9507. });
  9508. Object.defineProperty(a.prototype, "strokeColor", {
  9509. get: function() {
  9510. return this._strokeColor
  9511. },
  9512. set: function(d) {
  9513. this._strokeColor != d && (this._strokeColor = d, this.invalidateDisplayList())
  9514. },
  9515. enumerable: !0,
  9516. configurable: !0
  9517. });
  9518. Object.defineProperty(a.prototype, "strokeAlpha", {
  9519. get: function() {
  9520. return this._strokeAlpha
  9521. },
  9522. set: function(d) {
  9523. this._strokeAlpha != d && (this._strokeAlpha = d, this.invalidateDisplayList())
  9524. },
  9525. enumerable: !0,
  9526. configurable: !0
  9527. });
  9528. Object.defineProperty(a.prototype, "strokeWeight", {
  9529. get: function() {
  9530. return this._strokeWeight
  9531. },
  9532. set: function(d) {
  9533. this._strokeWeight != d && (this._strokeWeight = d, this.invalidateDisplayList())
  9534. },
  9535. enumerable: !0,
  9536. configurable: !0
  9537. });
  9538. a.prototype._measureBounds = function() {
  9539. var d = b.prototype._measureBounds.call(this),
  9540. a = this.width,
  9541. c = this.height;
  9542. 0 < d.x && (d.x = 0);
  9543. 0 < d.y && (d.y = 0);
  9544. 0 + a > d.right && (d.right = 0 + a);
  9545. 0 + c > d.bottom && (d.bottom = 0 + c);
  9546. return d
  9547. };
  9548. a.prototype.updateDisplayList = function(d, a) {
  9549. b.prototype.updateDisplayList.call(this, d, d);
  9550. var c = this.graphics;
  9551. c.clear();
  9552. c.beginFill(this._fillColor, this._fillAlpha);
  9553. 0 < this._strokeAlpha && c.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  9554. c.drawRect(0, 0, d, a);
  9555. c.endFill()
  9556. };
  9557. return a
  9558. }(e.UIComponent);
  9559. e.Rect = f;
  9560. f.prototype.__class__ = "egret.gui.Rect"
  9561. })(c.gui || (c.gui = {}))
  9562. })(egret || (egret = {}));
  9563. __extends = this.__extends || function(c, e) {
  9564. function f() {
  9565. this.constructor = c
  9566. }
  9567. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9568. f.prototype = e.prototype;
  9569. c.prototype = new f
  9570. };
  9571. (function(c) {
  9572. (function(c) {
  9573. var f = function(b) {
  9574. function a() {
  9575. b.call(this)
  9576. }
  9577. __extends(a, b);
  9578. Object.defineProperty(a.prototype, "icon", {
  9579. get: function() {
  9580. return this._getIcon()
  9581. },
  9582. set: function(d) {
  9583. this._setIcon(d)
  9584. },
  9585. enumerable: !0,
  9586. configurable: !0
  9587. });
  9588. a.prototype._getIcon = function() {
  9589. return this.iconDisplay ? this.iconDisplay.source : this._icon
  9590. };
  9591. a.prototype._setIcon = function(d) {
  9592. this._icon = d;
  9593. this.iconDisplay && (this.iconDisplay.source = d)
  9594. };
  9595. a.prototype.partAdded = function(d, a) {
  9596. b.prototype.partAdded.call(this, d, a);
  9597. a == this.iconDisplay && (this.iconDisplay.source = this._icon)
  9598. };
  9599. return a
  9600. }(c.ButtonBase);
  9601. c.Button = f;
  9602. f.prototype.__class__ = "egret.gui.Button"
  9603. })(c.gui || (c.gui = {}))
  9604. })(egret || (egret = {}));
  9605. __extends = this.__extends || function(c, e) {
  9606. function f() {
  9607. this.constructor = c
  9608. }
  9609. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9610. f.prototype = e.prototype;
  9611. c.prototype = new f
  9612. };
  9613. (function(c) {
  9614. (function(c) {
  9615. var f = function(b) {
  9616. function a() {
  9617. b.call(this)
  9618. }
  9619. __extends(a, b);
  9620. Object.defineProperty(a.prototype, "icon", {
  9621. get: function() {
  9622. return this._getIcon()
  9623. },
  9624. set: function(d) {
  9625. this._setIcon(d)
  9626. },
  9627. enumerable: !0,
  9628. configurable: !0
  9629. });
  9630. a.prototype._getIcon = function() {
  9631. return this.iconDisplay ? this.iconDisplay.source : this._icon
  9632. };
  9633. a.prototype._setIcon = function(d) {
  9634. this._icon = d;
  9635. this.iconDisplay && (this.iconDisplay.source = d)
  9636. };
  9637. a.prototype.partAdded = function(d, a) {
  9638. b.prototype.partAdded.call(this, d, a);
  9639. a == this.iconDisplay && (this.iconDisplay.source = this._icon)
  9640. };
  9641. return a
  9642. }(c.ToggleButtonBase);
  9643. c.ToggleButton = f;
  9644. f.prototype.__class__ = "egret.gui.ToggleButton"
  9645. })(c.gui || (c.gui = {}))
  9646. })(egret || (egret = {}));
  9647. __extends = this.__extends || function(c, e) {
  9648. function f() {
  9649. this.constructor = c
  9650. }
  9651. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9652. f.prototype = e.prototype;
  9653. c.prototype = new f
  9654. };
  9655. (function(c) {
  9656. (function(e) {
  9657. var f = function(b) {
  9658. function a() {
  9659. b.call(this);
  9660. this.elementsContentChanged = this.createChildrenCalled = !1;
  9661. this._elementsContent = []
  9662. }
  9663. __extends(a, b);
  9664. a.prototype.createChildren = function() {
  9665. b.prototype.createChildren.call(this);
  9666. this.createChildrenCalled = !0;
  9667. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  9668. };
  9669. a.prototype._getElementsContent = function() {
  9670. return this._elementsContent
  9671. };
  9672. Object.defineProperty(a.prototype, "elementsContent", {
  9673. set: function(d) {
  9674. null == d && (d = []);
  9675. if (d != this._elementsContent)
  9676. if (this.createChildrenCalled) this.setElementsContent(d);
  9677. else {
  9678. this.elementsContentChanged = !0;
  9679. for (var a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9680. this._elementsContent = d
  9681. }
  9682. },
  9683. enumerable: !0,
  9684. configurable: !0
  9685. });
  9686. a.prototype.setElementsContent = function(d) {
  9687. var a;
  9688. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9689. this._elementsContent = d.concat();
  9690. d = this._elementsContent.length;
  9691. for (a = 0; a < d; a++) {
  9692. var b = this._elementsContent[a];
  9693. b.parent && "removeElement" in b.parent ? b.parent.removeElement(b) : b.owner && "removeElement" in b.owner && b.owner.removeElement(b);
  9694. this._elementAdded(b, a)
  9695. }
  9696. };
  9697. Object.defineProperty(a.prototype, "numElements", {
  9698. get: function() {
  9699. return this._elementsContent.length
  9700. },
  9701. enumerable: !0,
  9702. configurable: !0
  9703. });
  9704. a.prototype.getElementAt = function(d) {
  9705. this.checkForRangeError(d);
  9706. return this._elementsContent[d]
  9707. };
  9708. a.prototype.checkForRangeError = function(d, a) {
  9709. void 0 === a && (a = !1);
  9710. var b = this._elementsContent.length - 1;
  9711. a && b++;
  9712. if (0 > d || d > b) throw new RangeError('索引:"' + d + '"超出可视元素索引范围');
  9713. };
  9714. a.prototype.addElement = function(d) {
  9715. var a = this.numElements;
  9716. d.parent == this && (a = this.numElements - 1);
  9717. return this.addElementAt(d, a)
  9718. };
  9719. a.prototype.addElementAt = function(d, a) {
  9720. if (d == this) return d;
  9721. this.checkForRangeError(a, !0);
  9722. var b = d.owner;
  9723. if (b == this || d.parent == this) return this.setElementIndex(d, a), d;
  9724. b && "removeElement" in b && d.owner.removeElement(d);
  9725. this._elementsContent.splice(a, 0, d);
  9726. this.elementsContentChanged || this._elementAdded(d, a);
  9727. return d
  9728. };
  9729. a.prototype.removeElement = function(d) {
  9730. return this.removeElementAt(this.getElementIndex(d))
  9731. };
  9732. a.prototype.removeElementAt = function(d) {
  9733. this.checkForRangeError(d);
  9734. var a = this._elementsContent[d];
  9735. this.elementsContentChanged || this._elementRemoved(a, d);
  9736. this._elementsContent.splice(d, 1);
  9737. return a
  9738. };
  9739. a.prototype.removeAllElements = function() {
  9740. for (var d = this.numElements - 1; 0 <= d; d--) this.removeElementAt(d)
  9741. };
  9742. a.prototype.getElementIndex = function(d) {
  9743. return this._elementsContent.indexOf(d)
  9744. };
  9745. a.prototype.setElementIndex = function(d, a) {
  9746. this.checkForRangeError(a);
  9747. var b = this.getElementIndex(d); - 1 != b && b != a && (this.elementsContentChanged || this._elementRemoved(d, b, !1), this._elementsContent.splice(b, 1), this._elementsContent.splice(a, 0, d), this.elementsContentChanged || this._elementAdded(d, a, !1))
  9748. };
  9749. a.prototype.swapElements = function(d, a) {
  9750. this.swapElementsAt(this.getElementIndex(d), this.getElementIndex(a))
  9751. };
  9752. a.prototype.swapElementsAt = function(d, a) {
  9753. this.checkForRangeError(d);
  9754. this.checkForRangeError(a);
  9755. if (d > a) {
  9756. var b = a;
  9757. a = d;
  9758. d = b
  9759. } else if (d == a) return;
  9760. var b = this._elementsContent,
  9761. c = b[d],
  9762. e = b[a];
  9763. this.elementsContentChanged || (this._elementRemoved(c, d, !1), this._elementRemoved(e, a, !1));
  9764. b[d] = e;
  9765. b[a] = c;
  9766. this.elementsContentChanged || (this._elementAdded(e, d, !1), this._elementAdded(c, a, !1))
  9767. };
  9768. a.prototype._elementAdded = function(d, a, b) {
  9769. void 0 === b && (b = !0);
  9770. d instanceof c.DisplayObject && this._addToDisplayListAt(d, a, b);
  9771. b && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_ADD) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_ADD, d, a);
  9772. this.invalidateSize();
  9773. this.invalidateDisplayList()
  9774. };
  9775. a.prototype._elementRemoved = function(d, a, b) {
  9776. void 0 === b && (b = !0);
  9777. b && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_REMOVE) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_REMOVE, d, a);
  9778. d instanceof c.DisplayObject && d.parent == this && this._removeFromDisplayList(d, b);
  9779. this.invalidateSize();
  9780. this.invalidateDisplayList()
  9781. };
  9782. a.prototype.addChild = function(d) {
  9783. throw Error("addChild()" + a.errorStr + "addElement()代替");
  9784. };
  9785. a.prototype.addChildAt = function(d, b) {
  9786. throw Error("addChildAt()" + a.errorStr + "addElementAt()代替");
  9787. };
  9788. a.prototype.removeChild = function(d) {
  9789. throw Error("removeChild()" + a.errorStr + "removeElement()代替");
  9790. };
  9791. a.prototype.removeChildAt = function(d) {
  9792. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()代替");
  9793. };
  9794. a.prototype.setChildIndex = function(d, b) {
  9795. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()代替");
  9796. };
  9797. a.prototype.swapChildren = function(d, b) {
  9798. throw Error("swapChildren()" + a.errorStr + "swapElements()代替");
  9799. };
  9800. a.prototype.swapChildrenAt = function(d, b) {
  9801. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()代替");
  9802. };
  9803. a.errorStr = "在此组件中不可用,若此组件为容器类,请使用";
  9804. return a
  9805. }(e.GroupBase);
  9806. e.Group = f;
  9807. f.prototype.__class__ = "egret.gui.Group"
  9808. })(c.gui || (c.gui = {}))
  9809. })(egret || (egret = {}));
  9810. __extends = this.__extends || function(c, e) {
  9811. function f() {
  9812. this.constructor = c
  9813. }
  9814. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  9815. f.prototype = e.prototype;
  9816. c.prototype = new f
  9817. };
  9818. (function(c) {
  9819. (function(e) {
  9820. var f = function(b) {
  9821. function a() {
  9822. b.call(this);
  9823. this.maxWidth = 1E4;
  9824. this.minWidth = 0;
  9825. this.maxHeight = 1E4;
  9826. this.minHeight = 0;
  9827. this._hasWidthSet = !1;
  9828. this._width = NaN;
  9829. this._hasHeightSet = !1;
  9830. this._height = NaN;
  9831. this.measuredHeight = this.measuredWidth = 0;
  9832. this._initialized = !1;
  9833. this._elementsContent = [];
  9834. this._states = [];
  9835. this.initialized = !1;
  9836. this.skinLayout = new e.SkinBasicLayout;
  9837. this.skinLayout.target = this
  9838. }
  9839. __extends(a, b);
  9840. Object.defineProperty(a.prototype, "width", {
  9841. get: function() {
  9842. return this._width
  9843. },
  9844. set: function(d) {
  9845. this._width != d && (this._width = d, this._hasWidthSet = c.NumberUtils.isNumber(d))
  9846. },
  9847. enumerable: !0,
  9848. configurable: !0
  9849. });
  9850. Object.defineProperty(a.prototype, "height", {
  9851. get: function() {
  9852. return this._height
  9853. },
  9854. set: function(d) {
  9855. this._height != d && (this._height = d, this._hasHeightSet = c.NumberUtils.isNumber(d))
  9856. },
  9857. enumerable: !0,
  9858. configurable: !0
  9859. });
  9860. Object.defineProperty(a.prototype, "preferredWidth", {
  9861. get: function() {
  9862. return this._hasWidthSet ? this._width : this.measuredWidth
  9863. },
  9864. enumerable: !0,
  9865. configurable: !0
  9866. });
  9867. Object.defineProperty(a.prototype, "preferredHeight", {
  9868. get: function() {
  9869. return this._hasHeightSet ? this._height : this.measuredHeight
  9870. },
  9871. enumerable: !0,
  9872. configurable: !0
  9873. });
  9874. a.prototype.createChildren = function() {};
  9875. Object.defineProperty(a.prototype, "hostComponent", {
  9876. get: function() {
  9877. return this._hostComponent
  9878. },
  9879. set: function(d) {
  9880. this._setHostComponent(d)
  9881. },
  9882. enumerable: !0,
  9883. configurable: !0
  9884. });
  9885. a.prototype._setHostComponent = function(d) {
  9886. if (this._hostComponent != d) {
  9887. var a;
  9888. if (this._hostComponent)
  9889. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9890. this._hostComponent = d;
  9891. this._initialized || (this._initialized = !0, this.createChildren());
  9892. if (this._hostComponent) {
  9893. d = this._elementsContent.length;
  9894. for (a = 0; a < d; a++) this._elementAdded(this._elementsContent[a], a);
  9895. this.initializeStates();
  9896. this.currentStateChanged && this.commitCurrentState()
  9897. }
  9898. }
  9899. };
  9900. a.prototype._getElementsContent = function() {
  9901. return this._elementsContent
  9902. };
  9903. Object.defineProperty(a.prototype, "elementsContent", {
  9904. set: function(d) {
  9905. null == d && (d = []);
  9906. if (d != this._elementsContent)
  9907. if (this._hostComponent) {
  9908. var a;
  9909. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9910. this._elementsContent = d.concat();
  9911. d = this._elementsContent.length;
  9912. for (a = 0; a < d; a++) {
  9913. var b = this._elementsContent[a];
  9914. b.parent && "removeElement" in b.parent ? b.parent.removeElement(b) : b.owner && "removeElement" in b.owner && b.owner.removeElement(b);
  9915. this._elementAdded(b, a)
  9916. }
  9917. } else this._elementsContent = d.concat()
  9918. },
  9919. enumerable: !0,
  9920. configurable: !0
  9921. });
  9922. Object.defineProperty(a.prototype, "numElements", {
  9923. get: function() {
  9924. return this._elementsContent.length
  9925. },
  9926. enumerable: !0,
  9927. configurable: !0
  9928. });
  9929. a.prototype.getElementAt = function(d) {
  9930. this.checkForRangeError(d);
  9931. return this._elementsContent[d]
  9932. };
  9933. a.prototype.checkForRangeError = function(d, a) {
  9934. void 0 === a && (a = !1);
  9935. var b = this._elementsContent.length - 1;
  9936. a && b++;
  9937. if (0 > d || d > b) throw new RangeError('索引:"' + d + '"超出可视元素索引范围');
  9938. };
  9939. a.prototype.addElement = function(d) {
  9940. var a = this.numElements;
  9941. d.owner == this && (a = this.numElements - 1);
  9942. return this.addElementAt(d, a)
  9943. };
  9944. a.prototype.addElementAt = function(d, a) {
  9945. this.checkForRangeError(a, !0);
  9946. var b = d.owner;
  9947. if (b == this) return this.setElementIndex(d, a), d;
  9948. b && "removeElement" in b && b.removeElement(d);
  9949. this._elementsContent.splice(a, 0, d);
  9950. this._hostComponent ? this._elementAdded(d, a) : d.ownerChanged(this);
  9951. return d
  9952. };
  9953. a.prototype.removeElement = function(d) {
  9954. return this.removeElementAt(this.getElementIndex(d))
  9955. };
  9956. a.prototype.removeElementAt = function(d) {
  9957. this.checkForRangeError(d);
  9958. var a = this._elementsContent[d];
  9959. this._hostComponent ? this._elementRemoved(a, d) : a.ownerChanged(null);
  9960. this._elementsContent.splice(d, 1);
  9961. return a
  9962. };
  9963. a.prototype.getElementIndex = function(d) {
  9964. return this._elementsContent.indexOf(d)
  9965. };
  9966. a.prototype.setElementIndex = function(d, a) {
  9967. this.checkForRangeError(a);
  9968. var b = this.getElementIndex(d); - 1 != b && b != a && (this._hostComponent && this._elementRemoved(d, b, !1), this._elementsContent.splice(b, 1), this._elementsContent.splice(a, 0, d), this._hostComponent && this._elementAdded(d, a, !1))
  9969. };
  9970. a.prototype._elementAdded = function(d, a, b) {
  9971. void 0 === b && (b = !0);
  9972. d.ownerChanged(this);
  9973. d instanceof
  9974. c.DisplayObject && this._hostComponent._addToDisplayListAt(d, a, b);
  9975. b && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_ADD) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_ADD, d, a);
  9976. this._hostComponent.invalidateSize();
  9977. this._hostComponent.invalidateDisplayList()
  9978. };
  9979. a.prototype._elementRemoved = function(d, a, b) {
  9980. void 0 === b && (b = !0);
  9981. b && this.hasEventListener(e.ElementExistenceEvent.ELEMENT_REMOVE) && e.ElementExistenceEvent.dispatchElementExistenceEvent(this, e.ElementExistenceEvent.ELEMENT_REMOVE, d, a);
  9982. d instanceof c.DisplayObject && d.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(d, b);
  9983. d.ownerChanged(null);
  9984. this._hostComponent.invalidateSize();
  9985. this._hostComponent.invalidateDisplayList()
  9986. };
  9987. a.prototype.measure = function() {
  9988. this.skinLayout.measure();
  9989. this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth);
  9990. this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth);
  9991. this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight);
  9992. this.measuredHeight > this.maxHeight && (this.measuredHeight = this.maxHeight)
  9993. };
  9994. a.prototype.updateDisplayList = function(d, a) {
  9995. this.skinLayout.updateDisplayList(d, a)
  9996. };
  9997. Object.defineProperty(a.prototype, "states", {
  9998. get: function() {
  9999. return this._states
  10000. },
  10001. set: function(d) {
  10002. this._setStates(d)
  10003. },
  10004. enumerable: !0,
  10005. configurable: !0
  10006. });
  10007. a.prototype._setStates = function(d) {
  10008. d || (d = []);
  10009. if ("string" == typeof d[0])
  10010. for (var a = d.length, b = 0; b < a; b++) {
  10011. var c = new e.State(d[b], []);
  10012. d[b] = c
  10013. }
  10014. this._states = d;
  10015. this.currentStateChanged = !0;
  10016. this.requestedCurrentState = this._currentState;
  10017. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  10018. };
  10019. Object.defineProperty(a.prototype, "currentState", {
  10020. get: function() {
  10021. return this.currentStateChanged ? this.requestedCurrentState : this._currentState ? this._currentState : this.getDefaultState()
  10022. },
  10023. set: function(d) {
  10024. d || (d = this.getDefaultState());
  10025. d != this.currentState && d && this.currentState && (this.requestedCurrentState = d, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  10026. },
  10027. enumerable: !0,
  10028. configurable: !0
  10029. });
  10030. a.prototype.hasState = function(d) {
  10031. return null != this.getState(d)
  10032. };
  10033. a.prototype.getDefaultState = function() {
  10034. return 0 < this._states.length ? this._states[0].name : null
  10035. };
  10036. a.prototype.commitCurrentState = function() {
  10037. if (this.currentStateChanged) {
  10038. this.currentStateChanged = !1;
  10039. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  10040. var d = this._currentState ? this._currentState : "";
  10041. this.hasEventListener(e.StateChangeEvent.CURRENT_STATE_CHANGING) && e.StateChangeEvent.dispatchStateChangeEvent(this, e.StateChangeEvent.CURRENT_STATE_CHANGING, d, this.requestedCurrentState ? this.requestedCurrentState : "");
  10042. this.removeState(this._currentState);
  10043. (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  10044. this.hasEventListener(e.StateChangeEvent.CURRENT_STATE_CHANGE) && e.StateChangeEvent.dispatchStateChangeEvent(this, e.StateChangeEvent.CURRENT_STATE_CHANGE, d, this._currentState ? this._currentState : "")
  10045. }
  10046. };
  10047. a.prototype.getState = function(d) {
  10048. if (!d) return null;
  10049. for (var a = this._states, b = a.length, c = 0; c < b; c++) {
  10050. var e = a[c];
  10051. if (e.name == d) return e
  10052. }
  10053. return null
  10054. };
  10055. a.prototype.removeState = function(d) {
  10056. if (d = this.getState(d)) {
  10057. d = d.overrides;
  10058. for (var a = d.length - 1; 0 <= a; a--) d[a].remove(this)
  10059. }
  10060. };
  10061. a.prototype.applyState = function(a) {
  10062. if (a = this.getState(a)) {
  10063. a = a.overrides;
  10064. for (var b = a.length, c = 0; c < b; c++) a[c].apply(this)
  10065. }
  10066. };
  10067. a.prototype.initializeStates = function() {
  10068. if (!this.initialized) {
  10069. this.initialized = !0;
  10070. for (var a = this._states, b = a.length, c = 0; c < b; c++) a[c].initialize(this)
  10071. }
  10072. };
  10073. return a
  10074. }(c.EventDispatcher);
  10075. e.Skin = f;
  10076. f.prototype.__class__ = "egret.gui.Skin"
  10077. })(c.gui || (c.gui = {}))
  10078. })(egret || (egret = {}));
  10079. __extends = this.__extends || function(c, e) {
  10080. function f() {
  10081. this.constructor = c
  10082. }
  10083. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10084. f.prototype = e.prototype;
  10085. c.prototype = new f
  10086. };
  10087. (function(c) {
  10088. (function(e) {
  10089. var f = function(b) {
  10090. function a(a, e, f) {
  10091. void 0 === a && (a = null);
  10092. void 0 === e && (e = null);
  10093. void 0 === f && (f = null);
  10094. b.call(this);
  10095. this.labelDisplay = new c.gui.Label;
  10096. this.iconDisplay = new c.gui.UIAsset;
  10097. var q = {};
  10098. q.up = a;
  10099. q.down = e;
  10100. q.disabled = f;
  10101. this.stateMap = q;
  10102. this._setStates(["up", "down", "disabled"])
  10103. }
  10104. __extends(a, b);
  10105. Object.defineProperty(a.prototype, "skinParts", {
  10106. get: function() {
  10107. return a._skinParts
  10108. },
  10109. enumerable: !0,
  10110. configurable: !0
  10111. });
  10112. a.prototype.createChildren = function() {
  10113. b.prototype.createChildren.call(this);
  10114. var a = new e.UIAsset;
  10115. a.left = a.top = a.bottom = a.right = 0;
  10116. this.addElement(a);
  10117. this.backgroundAsset = a;
  10118. this.iconDisplay.includeInLayout = !1;
  10119. this.addElement(this.iconDisplay);
  10120. this.labelDisplay.includeInLayout = !1;
  10121. this.labelDisplay.paddingLeft = 5;
  10122. this.labelDisplay.paddingRight = 5;
  10123. this.addElement(this.labelDisplay)
  10124. };
  10125. a.prototype.commitCurrentState = function() {
  10126. b.prototype.commitCurrentState.call(this);
  10127. var a = this.currentState;
  10128. this.stateMap[a] && (this.backgroundAsset.source = this.stateMap[a])
  10129. };
  10130. a.prototype.measure = function() {
  10131. b.prototype.measure.call(this);
  10132. var a = this.iconDisplay.preferredWidth + this.labelDisplay.preferredWidth + 20,
  10133. c = Math.max(this.iconDisplay.preferredHeight, this.labelDisplay.preferredHeight) + 20;
  10134. a > this.measuredWidth && (a < this.minWidth && (a = this.minWidth), a > this.maxWidth && (a = this.maxWidth), this.measuredWidth = a);
  10135. c > this.measuredHeight && (c < this.minHeight && (c = this.minHeight), c > this.maxHeight && (c = this.maxHeight), this.measuredHeight = c)
  10136. };
  10137. a.prototype.updateDisplayList = function(a, c) {
  10138. b.prototype.updateDisplayList.call(this, a, c);
  10139. var e = this.iconDisplay.layoutBoundsWidth,
  10140. f = this.labelDisplay.layoutBoundsHeight,
  10141. g = 0.5 * (a - e - this.labelDisplay.layoutBoundsWidth);
  10142. this.iconDisplay.setLayoutBoundsPosition(g, 0.5 * (c - this.iconDisplay.layoutBoundsHeight));
  10143. this.labelDisplay.setLayoutBoundsPosition(g + e, 0.5 * (c - f))
  10144. };
  10145. a._skinParts = ["labelDisplay", "iconDisplay"];
  10146. return a
  10147. }(e.Skin);
  10148. e.ButtonSkin = f;
  10149. f.prototype.__class__ = "egret.gui.ButtonSkin"
  10150. })(c.gui || (c.gui = {}))
  10151. })(egret || (egret = {}));
  10152. __extends = this.__extends || function(c, e) {
  10153. function f() {
  10154. this.constructor = c
  10155. }
  10156. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10157. f.prototype = e.prototype;
  10158. c.prototype = new f
  10159. };
  10160. (function(c) {
  10161. (function(e) {
  10162. var f = function(b) {
  10163. function a() {
  10164. b.call(this);
  10165. this.useVirtualLayoutChanged = !1;
  10166. this.rendererToClassMap = [];
  10167. this.freeRenderers = [];
  10168. this.dataProviderChanged = this.createNewRendererFlag = !1;
  10169. this.recyclerDic = [];
  10170. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  10171. this.indexToRenderer = [];
  10172. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  10173. }
  10174. __extends(a, b);
  10175. Object.defineProperty(a.prototype, "layout", {
  10176. get: function() {
  10177. return this._layout
  10178. },
  10179. set: function(a) {
  10180. a != this.layout && (this.layout && (this.layout.typicalLayoutRect = null, this.layout.removeEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)), this.layout && a && this.layout.useVirtualLayout != a.useVirtualLayout && this.changeUseVirtualLayout(), this._setLayout(a), a && (a.typicalLayoutRect = this.typicalLayoutRect, a.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)))
  10181. },
  10182. enumerable: !0,
  10183. configurable: !0
  10184. });
  10185. a.prototype.layout_useVirtualLayoutChangedHandler = function(a) {
  10186. this.changeUseVirtualLayout()
  10187. };
  10188. a.prototype.setVirtualElementIndicesInView = function(a, b) {
  10189. if (this.layout && this.layout.useVirtualLayout) {
  10190. this.virtualRendererIndices = [];
  10191. for (var c = a; c <= b; c++) this.virtualRendererIndices.push(c);
  10192. for (var e in this.indexToRenderer) e = parseInt(e), -1 == this.virtualRendererIndices.indexOf(e) && this.freeRendererByIndex(e)
  10193. }
  10194. };
  10195. a.prototype.getVirtualElementAt = function(a) {
  10196. if (0 > a || a >= this.dataProvider.length) return null;
  10197. var b = this.indexToRenderer[a];
  10198. if (!b) {
  10199. var b = this.dataProvider.getItemAt(a),
  10200. c = this.createVirtualRenderer(a);
  10201. this.indexToRenderer[a] = c;
  10202. this.updateRenderer(c, a, b);
  10203. this.createNewRendererFlag && ("validateNow" in c && c.validateNow(), this.createNewRendererFlag = !1, e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_ADD, c, a, b));
  10204. b = c
  10205. }
  10206. return b
  10207. };
  10208. a.prototype.freeRendererByIndex = function(a) {
  10209. if (this.indexToRenderer[a]) {
  10210. var b = this.indexToRenderer[a];
  10211. delete this.indexToRenderer[a];
  10212. b && b instanceof c.DisplayObject && this.doFreeRenderer(b)
  10213. }
  10214. };
  10215. a.prototype.doFreeRenderer = function(a) {
  10216. var b = this.rendererToClassMap[a.hashCode].hashCode;
  10217. this.freeRenderers[b] || (this.freeRenderers[b] = []);
  10218. this.freeRenderers[b].push(a);
  10219. a.visible = !1
  10220. };
  10221. a.prototype.invalidateSize = function() {
  10222. this.createNewRendererFlag || b.prototype.invalidateSize.call(this)
  10223. };
  10224. a.prototype.createVirtualRenderer = function(a) {
  10225. a = this.dataProvider.getItemAt(a);
  10226. a = this.itemToRendererClass(a);
  10227. var b = a.hashCode,
  10228. c = this.freeRenderers;
  10229. if (c[b] && 0 < c[b].length) return a = c[b].pop(), a.visible = !0, a;
  10230. this.createNewRendererFlag = !0;
  10231. return this.createOneRenderer(a)
  10232. };
  10233. a.prototype.createOneRenderer = function(a) {
  10234. var b, e = a.hashCode,
  10235. f = this.recyclerDic[e];
  10236. f && (b = f.pop(), 0 == f.length && delete this.recyclerDic[e]);
  10237. b || (b = a.newInstance(), this.rendererToClassMap[b.hashCode] = a);
  10238. if (!(b && b instanceof c.DisplayObject)) return null;
  10239. this._itemRendererSkinName && this.setItemRenderSkinName(b);
  10240. this._addToDisplayList(b);
  10241. b.setLayoutBoundsSize(NaN, NaN);
  10242. return b
  10243. };
  10244. a.prototype.setItemRenderSkinName = function(a) {
  10245. a && (a ? a._skinNameExplicitlySet || (a.skinName = this._itemRendererSkinName) : a && !a.skinName && (a.skinName = this._itemRendererSkinName))
  10246. };
  10247. a.prototype.finishVirtualLayout = function() {
  10248. if (this.virtualLayoutUnderway) {
  10249. var a = this.virtualLayoutUnderway = !1,
  10250. b;
  10251. for (b in this.freeRenderers)
  10252. if (0 < this.freeRenderers[b].length) {
  10253. a = !0;
  10254. break
  10255. }
  10256. a && (this.cleanTimer || (this.cleanTimer = new c.Timer(3E3, 1), this.cleanTimer.addEventListener(c.TimerEvent.TIMER, this.cleanAllFreeRenderer, this)), this.cleanTimer.reset(), this.cleanTimer.start())
  10257. }
  10258. };
  10259. a.prototype.cleanAllFreeRenderer = function(a) {
  10260. var b = this.freeRenderers,
  10261. c;
  10262. for (c in b)
  10263. for (var e = b[c], f = e.length, h = 0; h < f; h++) a = e[h], a.visible = !0, this.recycle(a);
  10264. this.freeRenderers = [];
  10265. this.cleanFreeRenderer = !1
  10266. };
  10267. a.prototype.getElementIndicesInView = function() {
  10268. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices : [] : b.prototype.getElementIndicesInView.call(this)
  10269. };
  10270. a.prototype.changeUseVirtualLayout = function() {
  10271. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  10272. this.removeDataProviderListener();
  10273. this.invalidateProperties()
  10274. };
  10275. Object.defineProperty(a.prototype, "dataProvider", {
  10276. get: function() {
  10277. return this._dataProvider
  10278. },
  10279. set: function(a) {
  10280. this._dataProvider != a && (this.removeDataProviderListener(), this._dataProvider = a, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  10281. },
  10282. enumerable: !0,
  10283. configurable: !0
  10284. });
  10285. a.prototype.removeDataProviderListener = function() {
  10286. this._dataProvider && this._dataProvider.removeEventListener(e.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  10287. };
  10288. a.prototype.onCollectionChange = function(a) {
  10289. switch (a.kind) {
  10290. case e.CollectionEventKind.ADD:
  10291. this.itemAddedHandler(a.items, a.location);
  10292. break;
  10293. case e.CollectionEventKind.MOVE:
  10294. this.itemMovedHandler(a.items[0], a.location, a.oldLocation);
  10295. break;
  10296. case e.CollectionEventKind.REMOVE:
  10297. this.itemRemovedHandler(a.items, a.location);
  10298. break;
  10299. case e.CollectionEventKind.UPDATE:
  10300. this.itemUpdatedHandler(a.items[0], a.location);
  10301. break;
  10302. case e.CollectionEventKind.REPLACE:
  10303. this.itemRemoved(a.oldItems[0], a.location);
  10304. this.itemAdded(a.items[0], a.location);
  10305. break;
  10306. case e.CollectionEventKind.RESET:
  10307. case e.CollectionEventKind.REFRESH:
  10308. if (this.layout && this.layout.useVirtualLayout)
  10309. for (var b in this.indexToRenderer) b = parseInt(b), this.freeRendererByIndex(b);
  10310. this.dataProviderChanged = !0;
  10311. this.invalidateProperties()
  10312. }
  10313. this.invalidateSize();
  10314. this.invalidateDisplayList()
  10315. };
  10316. a.prototype.itemAddedHandler = function(a, b) {
  10317. for (var c = a.length, e = 0; e < c; e++) this.itemAdded(a[e], b + e);
  10318. this.resetRenderersIndices()
  10319. };
  10320. a.prototype.itemMovedHandler = function(a, b, c) {
  10321. this.itemRemoved(a, c);
  10322. this.itemAdded(a, b);
  10323. this.resetRenderersIndices()
  10324. };
  10325. a.prototype.itemRemovedHandler = function(a, b) {
  10326. for (var c = a.length - 1; 0 <= c; c--) this.itemRemoved(a[c], b + c);
  10327. this.resetRenderersIndices()
  10328. };
  10329. a.prototype.itemAdded = function(a, b) {
  10330. this.layout && this.layout.elementAdded(b);
  10331. if (this.layout && this.layout.useVirtualLayout) {
  10332. var c = this.virtualRendererIndices;
  10333. if (c) {
  10334. for (var f = c.length, g = 0; g < f; g++) {
  10335. var h = c[g];
  10336. h >= b && (c[g] = h + 1)
  10337. }
  10338. this.indexToRenderer.splice(b, 0, null)
  10339. }
  10340. } else c = this.itemToRendererClass(a), c = this.createOneRenderer(c), this.indexToRenderer.splice(b, 0, c), c && (this.updateRenderer(c, b, a), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_ADD, c, b, a))
  10341. };
  10342. a.prototype.itemRemoved = function(a, b) {
  10343. this.layout && this.layout.elementRemoved(b);
  10344. var f = this.virtualRendererIndices;
  10345. if (f && 0 < f.length) {
  10346. for (var q = -1, g = f.length, h = 0; h < g; h++) {
  10347. var k = f[h];
  10348. k == b ? q = h : k > b && (f[h] = k - 1)
  10349. } - 1 != q && f.splice(q, 1)
  10350. }
  10351. f = this.indexToRenderer[b];
  10352. this.indexToRenderer.length > b && this.indexToRenderer.splice(b, 1);
  10353. e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_REMOVE, f, b, a);
  10354. f && f instanceof c.DisplayObject && this.recycle(f)
  10355. };
  10356. a.prototype.recycle = function(a) {
  10357. this._removeFromDisplayList(a);
  10358. "ownerChanged" in a && a.ownerChanged(null);
  10359. var b = this.rendererToClassMap[a.hashCode].hashCode;
  10360. this.recyclerDic[b] || (this.recyclerDic[b] = new c.Recycler);
  10361. this.recyclerDic[b].push(a)
  10362. };
  10363. a.prototype.resetRenderersIndices = function() {
  10364. if (0 != this.indexToRenderer.length)
  10365. if (this.layout && this.layout.useVirtualLayout)
  10366. for (var a = this.virtualRendererIndices, b = a.length, c = 0; c < b; c++) {
  10367. var e = a[c];
  10368. this.resetRendererItemIndex(e)
  10369. } else
  10370. for (a = this.indexToRenderer.length, e = 0; e < a; e++) this.resetRendererItemIndex(e)
  10371. };
  10372. a.prototype.itemUpdatedHandler = function(a, b) {
  10373. if (!this.renderersBeingUpdated) {
  10374. var c = this.indexToRenderer[b];
  10375. c && this.updateRenderer(c, b, a)
  10376. }
  10377. };
  10378. a.prototype.resetRendererItemIndex = function(a) {
  10379. var b = this.indexToRenderer[a];
  10380. b && (b.itemIndex = a)
  10381. };
  10382. Object.defineProperty(a.prototype, "itemRenderer", {
  10383. get: function() {
  10384. return this._itemRenderer
  10385. },
  10386. set: function(a) {
  10387. this._itemRenderer !== a && (this._itemRenderer = a, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  10388. },
  10389. enumerable: !0,
  10390. configurable: !0
  10391. });
  10392. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  10393. get: function() {
  10394. return this._itemRendererSkinName
  10395. },
  10396. set: function(a) {
  10397. this._itemRendererSkinName != a && (this._itemRendererSkinName = a) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  10398. },
  10399. enumerable: !0,
  10400. configurable: !0
  10401. });
  10402. Object.defineProperty(a.prototype, "itemRendererFunction", {
  10403. get: function() {
  10404. return this._itemRendererFunction
  10405. },
  10406. set: function(a) {
  10407. this._itemRendererFunction != a && (this._itemRendererFunction = a, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  10408. },
  10409. enumerable: !0,
  10410. configurable: !0
  10411. });
  10412. a.prototype.itemToRendererClass = function(d) {
  10413. null != this._itemRendererFunction ? (d = this._itemRendererFunction(d), d || (d = this._itemRenderer)) : d = this._itemRenderer;
  10414. return d ? d : a.defaultRendererFactory
  10415. };
  10416. a.prototype.createChildren = function() {
  10417. if (!this.layout) {
  10418. var a = new e.VerticalLayout;
  10419. a.gap = 0;
  10420. a.horizontalAlign = c.HorizontalAlign.CONTENT_JUSTIFY;
  10421. this.layout = a
  10422. }
  10423. b.prototype.createChildren.call(this)
  10424. };
  10425. a.prototype.commitProperties = function() {
  10426. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged) 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, this), this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(), this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  10427. b.prototype.commitProperties.call(this);
  10428. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  10429. if (this.itemRendererSkinNameChange) {
  10430. this.itemRendererSkinNameChange = !1;
  10431. for (var a = this.indexToRenderer.length, c = 0; c < a; c++) this.setItemRenderSkinName(this.indexToRenderer[c]);
  10432. var f = this.freeRenderers,
  10433. q;
  10434. for (q in f) {
  10435. var g = f[q];
  10436. if (g)
  10437. for (a = g.length, c = 0; c < a; c++) this.setItemRenderSkinName(g[c])
  10438. }
  10439. }
  10440. };
  10441. a.prototype.measure = function() {
  10442. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  10443. b.prototype.measure.call(this)
  10444. };
  10445. a.prototype.updateDisplayList = function(a, c) {
  10446. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway = !0, this.ensureTypicalLayoutElement());
  10447. b.prototype.updateDisplayList.call(this, a, c);
  10448. this.virtualLayoutUnderway && this.finishVirtualLayout()
  10449. };
  10450. a.prototype.ensureTypicalLayoutElement = function() {
  10451. !this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  10452. };
  10453. a.prototype.measureRendererSize = function() {
  10454. if (this.typicalItem) {
  10455. var a = this.itemToRendererClass(this.typicalItem);
  10456. if (a = this.createOneRenderer(a)) {
  10457. this.createNewRendererFlag = !0;
  10458. this.updateRenderer(a, 0, this.typicalItem);
  10459. "validateNow" in a && a.validateNow();
  10460. var b = new c.Rectangle(0, 0, a.preferredWidth, a.preferredHeight);
  10461. this.recycle(a);
  10462. this.setTypicalLayoutRect(b);
  10463. this.createNewRendererFlag = !1
  10464. } else this.setTypicalLayoutRect(null)
  10465. } else this.setTypicalLayoutRect(null)
  10466. };
  10467. a.prototype.setTypicalLayoutRect = function(a) {
  10468. this.typicalLayoutRect = a;
  10469. this.layout && (this.layout.typicalLayoutRect = a)
  10470. };
  10471. a.prototype.removeAllRenderers = function() {
  10472. for (var a = this.indexToRenderer.length, b, c = 0; c < a; c++)
  10473. if (b = this.indexToRenderer[c]) this.recycle(b), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_REMOVE, b, b.itemIndex, b.data);
  10474. this.indexToRenderer = [];
  10475. this.virtualRendererIndices = null;
  10476. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  10477. };
  10478. a.prototype.createRenderers = function() {
  10479. if (this._dataProvider)
  10480. for (var a = 0, b = this._dataProvider.length, c = 0; c < b; c++) {
  10481. var f = this._dataProvider.getItemAt(c),
  10482. g = this.itemToRendererClass(f);
  10483. if (g = this.createOneRenderer(g)) this.indexToRenderer[a] = g, this.updateRenderer(g, a, f), e.RendererExistenceEvent.dispatchRendererExistenceEvent(this, e.RendererExistenceEvent.RENDERER_ADD, g, a, f), a++
  10484. }
  10485. };
  10486. a.prototype.updateRenderer = function(a, b, c) {
  10487. this.renderersBeingUpdated = !0;
  10488. this._rendererOwner ? a = this._rendererOwner.updateRenderer(a, b, c) : ("ownerChanged" in a && a.ownerChanged(this), a.itemIndex = b, a.label = this.itemToLabel(c), a.data = c);
  10489. this.renderersBeingUpdated = !1;
  10490. return a
  10491. };
  10492. a.prototype.itemToLabel = function(a) {
  10493. return a ? a.toString() : " "
  10494. };
  10495. a.prototype.getElementAt = function(a) {
  10496. return this.indexToRenderer[a]
  10497. };
  10498. a.prototype.getElementIndex = function(a) {
  10499. return a ? this.indexToRenderer.indexOf(a) : -1
  10500. };
  10501. Object.defineProperty(a.prototype, "numElements", {
  10502. get: function() {
  10503. return this._dataProvider ? this._dataProvider.length : 0
  10504. },
  10505. enumerable: !0,
  10506. configurable: !0
  10507. });
  10508. a.prototype.addChild = function(d) {
  10509. throw Error("addChild()" + a.errorStr + "addElement()代替");
  10510. };
  10511. a.prototype.addChildAt = function(d, b) {
  10512. throw Error("addChildAt()" + a.errorStr + "addElementAt()代替");
  10513. };
  10514. a.prototype.removeChild = function(d) {
  10515. throw Error("removeChild()" + a.errorStr + "removeElement()代替");
  10516. };
  10517. a.prototype.removeChildAt = function(d) {
  10518. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()代替");
  10519. };
  10520. a.prototype.setChildIndex = function(d, b) {
  10521. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()代替");
  10522. };
  10523. a.prototype.swapChildren = function(d, b) {
  10524. throw Error("swapChildren()" + a.errorStr + "swapElements()代替");
  10525. };
  10526. a.prototype.swapChildrenAt = function(d, b) {
  10527. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()代替");
  10528. };
  10529. a.defaultRendererFactory = new e.ClassFactory(e.ItemRenderer);
  10530. a.errorStr = "在此组件中不可用,若此组件为容器类,请使用";
  10531. return a
  10532. }(e.GroupBase);
  10533. e.DataGroup = f;
  10534. f.prototype.__class__ = "egret.gui.DataGroup"
  10535. })(c.gui || (c.gui = {}))
  10536. })(egret || (egret = {}));
  10537. __extends = this.__extends || function(c, e) {
  10538. function f() {
  10539. this.constructor = c
  10540. }
  10541. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10542. f.prototype = e.prototype;
  10543. c.prototype = new f
  10544. };
  10545. (function(c) {
  10546. (function(e) {
  10547. var f = function(b) {
  10548. function a() {
  10549. b.call(this)
  10550. }
  10551. __extends(a, b);
  10552. a.prototype.pointToValue = function(a, b) {
  10553. if (!this.thumb || !this.track) return 0;
  10554. var c = this.maximum - this.minimum,
  10555. e = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  10556. return this.minimum + (0 != e ? a / e * c : 0)
  10557. };
  10558. a.prototype.updateSkinDisplayList = function() {
  10559. if (this.thumb && this.track) {
  10560. var a = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  10561. b = this.maximum - this.minimum,
  10562. a = 0 < b ? (this.pendingValue - this.minimum) / b * a : 0,
  10563. e = this.track.localToGlobal(a, 0),
  10564. b = e.x,
  10565. e = e.y,
  10566. f = this.thumb.parent.globalToLocal(b, e, c.Point.identity).x;
  10567. this.thumb.setLayoutBoundsPosition(Math.round(f), this.thumb.layoutBoundsY);
  10568. this.showTrackHighlight && this.trackHighlight && this.trackHighlight.parent && (b = this.trackHighlight.parent.globalToLocal(b, e, c.Point.identity).x - a, this.trackHighlight.x = Math.round(b), this.trackHighlight.width = Math.round(a))
  10569. }
  10570. };
  10571. return a
  10572. }(e.SliderBase);
  10573. e.HSlider = f;
  10574. f.prototype.__class__ = "egret.gui.HSlider"
  10575. })(c.gui || (c.gui = {}))
  10576. })(egret || (egret = {}));
  10577. __extends = this.__extends || function(c, e) {
  10578. function f() {
  10579. this.constructor = c
  10580. }
  10581. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10582. f.prototype = e.prototype;
  10583. c.prototype = new f
  10584. };
  10585. (function(c) {
  10586. (function(e) {
  10587. var f = function(b) {
  10588. function a() {
  10589. b.call(this);
  10590. this._autoHideTimer = NaN;
  10591. this._autoHideDelay = 3E3;
  10592. this.trackAlpha = 0.4;
  10593. this.thumbAlpha = 0.8;
  10594. this._autoHideShowAnimat = null;
  10595. this._animatTargetIsShow = !1
  10596. }
  10597. __extends(a, b);
  10598. a.prototype._setViewportMetric = function(a, b) {
  10599. this._setMaximun(b - a);
  10600. this._setMinimun(0);
  10601. this._setVisible(a < b);
  10602. this.thumb._setWidth(a * a / b)
  10603. };
  10604. a.prototype._setValue = function(a) {
  10605. a = Math.max(0, a);
  10606. b.prototype._setValue.call(this, a);
  10607. this.hideOrShow(!0);
  10608. this.autoHide()
  10609. };
  10610. a.prototype.setValue = function(a) {
  10611. b.prototype.setValue.call(this, a);
  10612. this.hideOrShow(!0);
  10613. this.autoHide()
  10614. };
  10615. a.prototype.autoHide = function() {
  10616. NaN != this._autoHideDelay && c.clearTimeout(this._autoHideDelay);
  10617. this._autoHideTimer = c.setTimeout(this.hideOrShow.bind(this, !1), this, this._autoHideDelay)
  10618. };
  10619. a.prototype.hideOrShow = function(a) {
  10620. var b = this;
  10621. if (null == this._autoHideShowAnimat) this._autoHideShowAnimat = new e.Animation(function(a) {
  10622. a = a.currentValue.alpha;
  10623. b.thumb.alpha = b.thumbAlpha * a;
  10624. b.track.alpha = b.trackAlpha * a
  10625. }, this);
  10626. else {
  10627. if (this._animatTargetIsShow == a) return;
  10628. this._autoHideShowAnimat.isPlaying && this._autoHideShowAnimat.stop()
  10629. }
  10630. this._animatTargetIsShow = a;
  10631. var c = this._autoHideShowAnimat;
  10632. c.motionPaths = [{
  10633. prop: "alpha",
  10634. from: this.thumb.alpha / this.thumbAlpha,
  10635. to: a ? 1 : 0
  10636. }];
  10637. c.duration = a ? 100 : 500;
  10638. c.play()
  10639. };
  10640. a.prototype._animationUpdateHandler = function(a) {
  10641. this.value = this.pendingValue = a.currentValue.value;
  10642. this.dispatchEventWith(c.Event.CHANGE)
  10643. };
  10644. return a
  10645. }(e.HSlider);
  10646. e.HScrollBar = f;
  10647. f.prototype.__class__ = "egret.gui.HScrollBar"
  10648. })(c.gui || (c.gui = {}))
  10649. })(egret || (egret = {}));
  10650. __extends = this.__extends || function(c, e) {
  10651. function f() {
  10652. this.constructor = c
  10653. }
  10654. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10655. f.prototype = e.prototype;
  10656. c.prototype = new f
  10657. };
  10658. (function(c) {
  10659. (function(e) {
  10660. var f = function(b) {
  10661. function a() {
  10662. b.call(this)
  10663. }
  10664. __extends(a, b);
  10665. a.prototype.pointToValue = function(a, b) {
  10666. if (!this.thumb || !this.track) return 0;
  10667. var c = this.maximum - this.minimum,
  10668. e = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  10669. return this.minimum + (0 != e ? (e - b) / e * c : 0)
  10670. };
  10671. a.prototype.updateSkinDisplayList = function() {
  10672. if (this.thumb && this.track) {
  10673. var a = this.thumb.layoutBoundsHeight,
  10674. b = this.track.layoutBoundsHeight - a,
  10675. e = this.maximum - this.minimum,
  10676. f = this.track.localToGlobal(0, 0 < e ? b - (this.pendingValue - this.minimum) / e * b : 0),
  10677. e = f.x,
  10678. f = f.y,
  10679. g = this.thumb.parent.globalToLocal(e, f, c.Point.identity).y;
  10680. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(g));
  10681. this.showTrackHighlight && this.trackHighlight && this.trackHighlight._parent && (e = this.trackHighlight._parent.globalToLocal(e, f, c.Point.identity).y, this.trackHighlight.y = Math.round(e + a), this.trackHighlight.height = Math.round(b - e))
  10682. }
  10683. };
  10684. return a
  10685. }(e.SliderBase);
  10686. e.VSlider = f;
  10687. f.prototype.__class__ = "egret.gui.VSlider"
  10688. })(c.gui || (c.gui = {}))
  10689. })(egret || (egret = {}));
  10690. __extends = this.__extends || function(c, e) {
  10691. function f() {
  10692. this.constructor = c
  10693. }
  10694. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10695. f.prototype = e.prototype;
  10696. c.prototype = new f
  10697. };
  10698. (function(c) {
  10699. (function(e) {
  10700. var f = function(b) {
  10701. function a() {
  10702. b.call(this);
  10703. this._autoHideTimer = NaN;
  10704. this._autoHideDelay = 3E3;
  10705. this.trackAlpha = 0.4;
  10706. this.thumbAlpha = 0.8;
  10707. this._autoHideShowAnimat = null;
  10708. this._animatTargetIsShow = !1
  10709. }
  10710. __extends(a, b);
  10711. a.prototype._setViewportMetric = function(a, b) {
  10712. this._setMaximun(b - a);
  10713. this._setMinimun(0);
  10714. this._setValue(b - a);
  10715. this._setVisible(a < b);
  10716. this.thumb._setHeight(a * a / b)
  10717. };
  10718. a.prototype.setPosition = function(a) {
  10719. this._setValue(this._maximum - a)
  10720. };
  10721. a.prototype.getPosition = function() {
  10722. return this._maximum - this._getValue()
  10723. };
  10724. a.prototype._setValue = function(a) {
  10725. a = Math.max(0, a);
  10726. b.prototype._setValue.call(this, a);
  10727. this.hideOrShow(!0);
  10728. this.autoHide()
  10729. };
  10730. a.prototype.setValue = function(a) {
  10731. b.prototype.setValue.call(this, a);
  10732. this.hideOrShow(!0);
  10733. this.autoHide()
  10734. };
  10735. a.prototype.autoHide = function() {
  10736. NaN != this._autoHideDelay && c.clearTimeout(this._autoHideDelay);
  10737. this._autoHideTimer = c.setTimeout(this.hideOrShow.bind(this, !1), this, this._autoHideDelay)
  10738. };
  10739. a.prototype.hideOrShow = function(a) {
  10740. var b = this;
  10741. if (null == this._autoHideShowAnimat) this._autoHideShowAnimat = new e.Animation(function(a) {
  10742. a = a.currentValue.alpha;
  10743. b.thumb.alpha = b.thumbAlpha * a;
  10744. b.track.alpha = b.trackAlpha * a
  10745. }, this);
  10746. else {
  10747. if (this._animatTargetIsShow == a) return;
  10748. this._autoHideShowAnimat.isPlaying && this._autoHideShowAnimat.stop()
  10749. }
  10750. this._animatTargetIsShow = a;
  10751. var c = this._autoHideShowAnimat;
  10752. c.motionPaths = [{
  10753. prop: "alpha",
  10754. from: this.thumb.alpha / this.thumbAlpha,
  10755. to: a ? 1 : 0
  10756. }];
  10757. c.duration = a ? 100 : 500;
  10758. c.play()
  10759. };
  10760. a.prototype._animationUpdateHandler = function(a) {
  10761. this.value = this.pendingValue = a.currentValue.value;
  10762. this.dispatchEventWith(c.Event.CHANGE)
  10763. };
  10764. return a
  10765. }(e.VSlider);
  10766. e.VScrollBar = f;
  10767. f.prototype.__class__ = "egret.gui.VScrollBar"
  10768. })(c.gui || (c.gui = {}))
  10769. })(egret || (egret = {}));
  10770. __extends = this.__extends || function(c, e) {
  10771. function f() {
  10772. this.constructor = c
  10773. }
  10774. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  10775. f.prototype = e.prototype;
  10776. c.prototype = new f
  10777. };
  10778. (function(c) {
  10779. (function(e) {
  10780. var f = function(b) {
  10781. function a() {
  10782. b.call(this);
  10783. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  10784. this._popUpPosition = e.PopUpPosition.TOP_LEFT;
  10785. this.inAnimation = !1;
  10786. this.animator = null;
  10787. this._openDuration = 250;
  10788. this._closeDuration = 150;
  10789. this.valueRange = 1;
  10790. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  10791. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, this)
  10792. }
  10793. __extends(a, b);
  10794. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  10795. get: function() {
  10796. return this._popUpHeightMatchesAnchorHeight
  10797. },
  10798. set: function(a) {
  10799. this._popUpHeightMatchesAnchorHeight != a && (this._popUpHeightMatchesAnchorHeight = a, this.invalidateDisplayList())
  10800. },
  10801. enumerable: !0,
  10802. configurable: !0
  10803. });
  10804. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  10805. get: function() {
  10806. return this._popUpWidthMatchesAnchorWidth
  10807. },
  10808. set: function(a) {
  10809. this._popUpWidthMatchesAnchorWidth != a && (this._popUpWidthMatchesAnchorWidth = a, this.invalidateDisplayList())
  10810. },
  10811. enumerable: !0,
  10812. configurable: !0
  10813. });
  10814. Object.defineProperty(a.prototype, "displayPopUp", {
  10815. get: function() {
  10816. return this._displayPopUp
  10817. },
  10818. set: function(a) {
  10819. this._displayPopUp != a && (this._displayPopUp = a, this.addOrRemovePopUp())
  10820. },
  10821. enumerable: !0,
  10822. configurable: !0
  10823. });
  10824. Object.defineProperty(a.prototype, "popUp", {
  10825. get: function() {
  10826. return this._popUp
  10827. },
  10828. set: function(a) {
  10829. this._popUp != a && (this._popUp = a, this.dispatchEventWith("popUpChanged"))
  10830. },
  10831. enumerable: !0,
  10832. configurable: !0
  10833. });
  10834. Object.defineProperty(a.prototype, "popUpPosition", {
  10835. get: function() {
  10836. return this._popUpPosition
  10837. },
  10838. set: function(a) {
  10839. this._popUpPosition != a && (this._popUpPosition = a, this.invalidateDisplayList())
  10840. },
  10841. enumerable: !0,
  10842. configurable: !0
  10843. });
  10844. a.prototype.updateDisplayList = function(a, c) {
  10845. b.prototype.updateDisplayList.call(this, a, c);
  10846. this.applyPopUpTransform(a, c)
  10847. };
  10848. a.prototype.updatePopUpTransform = function() {
  10849. this.applyPopUpTransform(this.width, this.height)
  10850. };
  10851. a.prototype.calculatePopUpPosition = function() {
  10852. var a = c.Point.identity;
  10853. switch (this._popUpPosition) {
  10854. case e.PopUpPosition.BELOW:
  10855. a.x = 0;
  10856. a.y = this.height;
  10857. break;
  10858. case e.PopUpPosition.ABOVE:
  10859. a.x = 0;
  10860. a.y = -this.popUp.layoutBoundsHeight;
  10861. break;
  10862. case e.PopUpPosition.LEFT:
  10863. a.x = -this.popUp.layoutBoundsWidth;
  10864. a.y = 0;
  10865. break;
  10866. case e.PopUpPosition.RIGHT:
  10867. a.x = this.width;
  10868. a.y = 0;
  10869. break;
  10870. case e.PopUpPosition.CENTER:
  10871. a.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth), a.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  10872. }
  10873. a = this.localToGlobal(a.x, a.y, a);
  10874. return a = this.popUp.parent.globalToLocal(a.x, a.y, a)
  10875. };
  10876. Object.defineProperty(a.prototype, "openDuration", {
  10877. get: function() {
  10878. return this._openDuration
  10879. },
  10880. set: function(a) {
  10881. this._openDuration = a
  10882. },
  10883. enumerable: !0,
  10884. configurable: !0
  10885. });
  10886. Object.defineProperty(a.prototype, "closeDuration", {
  10887. get: function() {
  10888. return this._closeDuration
  10889. },
  10890. set: function(a) {
  10891. this._closeDuration = a
  10892. },
  10893. enumerable: !0,
  10894. configurable: !0
  10895. });
  10896. a.prototype.animationStartHandler = function(a) {
  10897. this.inAnimation = !0;
  10898. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  10899. };
  10900. a.prototype.animationUpdateHandler = function(a) {
  10901. var b = this.popUp._scrollRect,
  10902. e = Math.round(a.currentValue.x);
  10903. a = Math.round(a.currentValue.y);
  10904. b ? (b.x = e, b.y = a, b.width = this.popUp.width, b.height = this.popUp.height) : this.popUp._scrollRect = new c.Rectangle(e, a, this.popUp.width, this.popUp.height);
  10905. this.popUp._setScrollRect(b)
  10906. };
  10907. a.prototype.animationEndHandler = function(a) {
  10908. this.inAnimation = !1;
  10909. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  10910. this.popUp.scrollRect = null;
  10911. this.popUpIsDisplayed || (e.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  10912. };
  10913. a.prototype.addOrRemovePopUp = function() {
  10914. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ? (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()) : c.callLater(function() {
  10915. 0 < this.openDuration && this.startAnimation()
  10916. }, this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  10917. };
  10918. a.prototype.removeAndResetPopUp = function() {
  10919. this.inAnimation && this.animator.end();
  10920. this.popUpIsDisplayed = !1;
  10921. 0 < this._closeDuration ? this.startAnimation() : (e.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  10922. };
  10923. a.prototype.applyPopUpTransform = function(a, b) {
  10924. if (this.popUpIsDisplayed) {
  10925. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = a);
  10926. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = b);
  10927. "validateNow" in this.popUp && this.popUp.validateNow();
  10928. var c = this.calculatePopUpPosition();
  10929. this.popUp.x = c.x;
  10930. this.popUp.y = c.y
  10931. }
  10932. };
  10933. a.prototype.startAnimation = function() {
  10934. this.animator || (this.animator = new e.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  10935. this.animator.motionPaths = this.createMotionPath();
  10936. this.animator.duration = this.popUpIsDisplayed ? this._openDuration : this._closeDuration;
  10937. this.animator.play()
  10938. };
  10939. a.prototype.createMotionPath = function() {
  10940. var a = {
  10941. prop: "x"
  10942. }, b = {
  10943. prop: "y"
  10944. }, c = [a, b];
  10945. switch (this._popUpPosition) {
  10946. case e.PopUpPosition.TOP_LEFT:
  10947. case e.PopUpPosition.CENTER:
  10948. case e.PopUpPosition.BELOW:
  10949. a.from = a.to = 0;
  10950. b.from = this.popUp.height;
  10951. b.to = 0;
  10952. this.valueRange = this.popUp.height;
  10953. break;
  10954. case e.PopUpPosition.ABOVE:
  10955. a.from = a.to = 0;
  10956. b.from = -this.popUp.height;
  10957. b.to = 0;
  10958. this.valueRange = this.popUp.height;
  10959. break;
  10960. case e.PopUpPosition.LEFT:
  10961. b.from = b.to = 0;
  10962. a.from = -this.popUp.width;
  10963. a.to = 0;
  10964. this.valueRange = this.popUp.width;
  10965. break;
  10966. case e.PopUpPosition.RIGHT:
  10967. b.from = b.to = 0;
  10968. a.from = this.popUp.width;
  10969. a.to = 0;
  10970. this.valueRange = this.popUp.width;
  10971. break;
  10972. default:
  10973. this.valueRange = 1
  10974. }
  10975. this.valueRange = Math.abs(this.valueRange);
  10976. if (!this.popUpIsDisplayed) {
  10977. var f = a.from;
  10978. a.from = a.to;
  10979. a.to = f;
  10980. f = b.from;
  10981. b.from = b.to;
  10982. b.to = f
  10983. }
  10984. return c
  10985. };
  10986. a.prototype.addedToStageHandler = function(a) {
  10987. this.addedToStage = !0;
  10988. c.callLater(this.checkPopUpState, this)
  10989. };
  10990. a.prototype.checkPopUpState = function() {
  10991. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  10992. };
  10993. a.prototype.removedFromStageHandler = function(a) {
  10994. this.addedToStage = !1;
  10995. c.callLater(this.checkPopUpState, this)
  10996. };
  10997. return a
  10998. }(e.UIComponent);
  10999. e.PopUpAnchor = f;
  11000. f.prototype.__class__ = "egret.gui.PopUpAnchor"
  11001. })(c.gui || (c.gui = {}))
  11002. })(egret || (egret = {}));
  11003. __extends = this.__extends || function(c, e) {
  11004. function f() {
  11005. this.constructor = c
  11006. }
  11007. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11008. f.prototype = e.prototype;
  11009. c.prototype = new f
  11010. };
  11011. (function(c) {
  11012. (function(e) {
  11013. var f = function(a) {
  11014. function d(d) {
  11015. a.call(this, d);
  11016. this._height = this._width = 0
  11017. }
  11018. __extends(d, a);
  11019. d.prototype.setContent = function(d) {
  11020. a.prototype.setContent.call(this, d);
  11021. d = this._content;
  11022. this._scrollLeft = d.horizontalScrollPosition;
  11023. this._scrollTop = d.verticalScrollPosition
  11024. };
  11025. d.prototype._updateContentPosition = function() {
  11026. var a = this._content;
  11027. a.horizontalScrollPosition = this._scrollLeft;
  11028. a.verticalScrollPosition = this._scrollTop;
  11029. a.setLayoutBoundsSize(this._width, this._height);
  11030. this.dispatchEvent(new c.Event(c.Event.CHANGE))
  11031. };
  11032. d.prototype.getMaxScrollLeft = function() {
  11033. var a = this._content;
  11034. return Math.max(a.contentWidth - a.width, 0)
  11035. };
  11036. d.prototype.getMaxScrollTop = function() {
  11037. var a = this._content;
  11038. return Math.max(a.contentHeight - a.height, 0)
  11039. };
  11040. d.prototype._getContentWidth = function() {
  11041. return this._content.contentWidth
  11042. };
  11043. d.prototype._getContentHeight = function() {
  11044. return this._content.contentHeight
  11045. };
  11046. d.prototype._setHeight = function(a) {
  11047. this._explicitHeight = a;
  11048. this._hasHeightSet = c.NumberUtils.isNumber(a);
  11049. this._height = a;
  11050. (a = this._content) && a.setLayoutBoundsSize(this._width, this._height)
  11051. };
  11052. d.prototype._setWidth = function(a) {
  11053. this._explicitWidth = a;
  11054. this._hasWidthSet = c.NumberUtils.isNumber(a);
  11055. this._width = a;
  11056. (a = this._content) && a.setLayoutBoundsSize(this._width, this._height)
  11057. };
  11058. Object.defineProperty(d.prototype, "height", {
  11059. get: function() {
  11060. return this._height
  11061. },
  11062. set: function(a) {
  11063. this._setHeight(a)
  11064. },
  11065. enumerable: !0,
  11066. configurable: !0
  11067. });
  11068. Object.defineProperty(d.prototype, "width", {
  11069. get: function() {
  11070. return this._width
  11071. },
  11072. set: function(a) {
  11073. this._setWidth(a)
  11074. },
  11075. enumerable: !0,
  11076. configurable: !0
  11077. });
  11078. d.prototype.invalidateSize = function() {
  11079. var a = this.parent;
  11080. a && a.invalidateSize()
  11081. };
  11082. d.prototype.invalidateDisplayList = function() {
  11083. var a = this.parent;
  11084. a && a.invalidateDisplayList()
  11085. };
  11086. return d
  11087. }(c.ScrollView);
  11088. f.prototype.__class__ = "egret.gui.ViewportScroller";
  11089. var b = function(a) {
  11090. function d() {
  11091. a.call(this);
  11092. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto"
  11093. }
  11094. __extends(d, a);
  11095. d.prototype.measure = function() {
  11096. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  11097. };
  11098. d.prototype.updateDisplayList = function(a, d) {
  11099. this._scroller._setWidth(a);
  11100. this._scroller._setHeight(d);
  11101. this.horizontalScrollBar && "off" != this._horizontalScrollPolicy && (this.horizontalScrollBar._setViewportMetric(a, this._viewport.contentWidth), this.horizontalScrollBar._setWidth(a - 2), this.horizontalScrollBar.x = 1, this.horizontalScrollBar.y = d - this.horizontalScrollBar._height - 1);
  11102. this.verticalScrollBar && "off" != this._verticalScrollPolicy && (this.verticalScrollBar._setViewportMetric(d, this._viewport.contentHeight), this.verticalScrollBar._setHeight(d - 2), this.verticalScrollBar.y = 1, this.verticalScrollBar.x = a - this.verticalScrollBar.width - 1)
  11103. };
  11104. Object.defineProperty(d.prototype, "verticalScrollPolicy", {
  11105. get: function() {
  11106. return this._verticalScrollPolicy
  11107. },
  11108. set: function(a) {
  11109. a != this._verticalScrollPolicy && (this._verticalScrollPolicy = a, this._checkVbar(), this._scroller && (this._scroller.verticalScrollPolicy = a))
  11110. },
  11111. enumerable: !0,
  11112. configurable: !0
  11113. });
  11114. Object.defineProperty(d.prototype, "horizontalScrollPolicy", {
  11115. get: function() {
  11116. return this._horizontalScrollPolicy
  11117. },
  11118. set: function(a) {
  11119. a != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = a, this._checkHbar(), this._scroller && (this._scroller.horizontalScrollPolicy = a))
  11120. },
  11121. enumerable: !0,
  11122. configurable: !0
  11123. });
  11124. Object.defineProperty(d.prototype, "viewport", {
  11125. get: function() {
  11126. return this._viewport
  11127. },
  11128. set: function(a) {
  11129. a != this._viewport && (this.uninstallViewport(), this._viewport = a, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  11130. },
  11131. enumerable: !0,
  11132. configurable: !0
  11133. });
  11134. d.prototype.installViewport = function() {
  11135. var a = this.viewport;
  11136. null == this._scroller && (this._scroller = new f(a), this._scroller.horizontalScrollPolicy = this._horizontalScrollPolicy, this._scroller.verticalScrollPolicy = this._verticalScrollPolicy, this._scroller.addEventListener(c.Event.CHANGE, this._scrollerChangedHandler, this), this._addToDisplayListAt(this._scroller, 0));
  11137. a && (a.clipAndEnableScrolling = !0, this._scroller.setContent(a), a.addEventListener(c.gui.PropertyChangeEvent.PROPERTY_CHANGE, this._viewportChangedHandler, this), "_addToStyleProtoChain" in a && a._addToStyleProtoChain(this._styleProtoChain))
  11138. };
  11139. d.prototype._onAddToStage = function() {
  11140. a.prototype._onAddToStage.call(this);
  11141. this._scroller._stage = this.stage
  11142. };
  11143. d.prototype.uninstallViewport = function() {
  11144. this.viewport && (this.viewport.clipAndEnableScrolling = !1, this.viewport.removeEventListener(c.gui.PropertyChangeEvent.PROPERTY_CHANGE, this._viewportChangedHandler, this));
  11145. this._scroller && this._scroller.removeContent()
  11146. };
  11147. d.prototype._viewportChangedHandler = function(a) {
  11148. "horizontalScrollPosition" == a.property && this.setViewportHScrollPosition(this.viewport.horizontalScrollPosition);
  11149. "verticalScrollPosition" == a.property && this.setViewportVScrollPosition(this.viewport.verticalScrollPosition)
  11150. };
  11151. d.prototype._scrollerChangedHandler = function(a) {
  11152. this.setViewportHScrollPosition(this._scroller.scrollLeft);
  11153. this.setViewportVScrollPosition(this._scroller.scrollTop)
  11154. };
  11155. d.prototype.setViewportVScrollPosition = function(a) {
  11156. this._scroller.scrollTop != a && (this._scroller.scrollTop = a);
  11157. this.verticalScrollBar && this.verticalScrollBar.value != a && this.verticalScrollBar.setPosition(a)
  11158. };
  11159. d.prototype.setViewportHScrollPosition = function(a) {
  11160. this._scroller.scrollLeft != a && (this._scroller.scrollLeft = a);
  11161. this.horizontalScrollBar && this.horizontalScrollBar.value != a && this.horizontalScrollBar._setValue(a)
  11162. };
  11163. d.prototype.throwHorizontally = function(a, d) {
  11164. void 0 === d && (d = 500);
  11165. this._scroller && this._scroller.setScrollLeft(a, d)
  11166. };
  11167. d.prototype.throwVertically = function(a, d) {
  11168. void 0 === d && (d = 500);
  11169. this._scroller && this._scroller.setScrollTop(a, d)
  11170. };
  11171. Object.defineProperty(d.prototype, "numElements", {
  11172. get: function() {
  11173. return this.viewport ? 1 : 0
  11174. },
  11175. enumerable: !0,
  11176. configurable: !0
  11177. });
  11178. d.prototype.throwRangeError = function(a) {
  11179. throw new RangeError('索引:"' + a + '"超出可视元素索引范围');
  11180. };
  11181. d.prototype.getElementAt = function(a) {
  11182. if (this.viewport && 0 == a) return this.viewport;
  11183. this.throwRangeError(a);
  11184. return null
  11185. };
  11186. d.prototype.getElementIndex = function(a) {
  11187. return null != a && a == this.viewport ? 0 : -1
  11188. };
  11189. d.prototype.containsElement = function(a) {
  11190. return null != a && a == this.viewport ? !0 : !1
  11191. };
  11192. d.prototype.throwNotSupportedError = function() {
  11193. throw Error("此方法在Scroller组件内不可用!");
  11194. };
  11195. d.prototype.addElement = function(a) {
  11196. this.throwNotSupportedError();
  11197. return null
  11198. };
  11199. d.prototype.addElementAt = function(a, d) {
  11200. this.throwNotSupportedError();
  11201. return null
  11202. };
  11203. d.prototype.removeElement = function(a) {
  11204. this.throwNotSupportedError();
  11205. return null
  11206. };
  11207. d.prototype.removeElementAt = function(a) {
  11208. this.throwNotSupportedError();
  11209. return null
  11210. };
  11211. d.prototype.removeAllElements = function() {
  11212. this.throwNotSupportedError()
  11213. };
  11214. d.prototype.setElementIndex = function(a, d) {
  11215. this.throwNotSupportedError()
  11216. };
  11217. d.prototype.swapElements = function(a, d) {
  11218. this.throwNotSupportedError()
  11219. };
  11220. d.prototype.swapElementsAt = function(a, d) {
  11221. this.throwNotSupportedError()
  11222. };
  11223. d.prototype.addChild = function(a) {
  11224. this.throwNotSupportedError();
  11225. return null
  11226. };
  11227. d.prototype.addChildAt = function(a, d) {
  11228. this.throwNotSupportedError();
  11229. return null
  11230. };
  11231. d.prototype.removeChild = function(a) {
  11232. this.throwNotSupportedError();
  11233. return null
  11234. };
  11235. d.prototype.removeChildAt = function(a) {
  11236. this.throwNotSupportedError();
  11237. return null
  11238. };
  11239. d.prototype.setChildIndex = function(a, d) {
  11240. this.throwNotSupportedError()
  11241. };
  11242. d.prototype.swapChildren = function(a, d) {
  11243. this.throwNotSupportedError()
  11244. };
  11245. d.prototype.swapChildrenAt = function(a, d) {
  11246. this.throwNotSupportedError()
  11247. };
  11248. d.prototype._checkHbar = function() {
  11249. if ("off" == this._horizontalScrollPolicy) this.horizontalScrollBar && this._removeFromDisplayList(this.horizontalScrollBar);
  11250. else if (this.horizontalScrollBar) {
  11251. var a = this.horizontalScrollBar;
  11252. a.addEventListener(c.Event.CHANGE, this.hBarChanged, this, !1);
  11253. a._setViewportMetric(this._viewport.width, this._viewport.contentWidth);
  11254. this.horizontalScrollBar = a;
  11255. var d = a.owner;
  11256. d && "removeElement" in d && d.removeElement(a);
  11257. this._addToDisplayList(this.horizontalScrollBar)
  11258. }
  11259. };
  11260. d.prototype._checkVbar = function() {
  11261. if ("off" == this._verticalScrollPolicy) this.verticalScrollBar && this._removeFromDisplayList(this.verticalScrollBar);
  11262. else if (this.verticalScrollBar) {
  11263. var a = this.verticalScrollBar;
  11264. a.addEventListener(c.Event.CHANGE, this.vBarChanged, this, !1);
  11265. a._setViewportMetric(this._viewport.height, this._viewport.contentHeight);
  11266. this.verticalScrollBar = a;
  11267. var d = a.owner;
  11268. d && "removeElement" in d && d.removeElement(a);
  11269. this._addToDisplayList(this.verticalScrollBar)
  11270. }
  11271. };
  11272. d.prototype.partAdded = function(d, b) {
  11273. a.prototype.partAdded.call(this, d, b);
  11274. b == this.horizontalScrollBar && this._checkHbar();
  11275. b == this.verticalScrollBar && this._checkVbar()
  11276. };
  11277. d.prototype._removeScrollBars = function() {
  11278. this.horizontalScrollBar && (this._removeFromDisplayList(this.horizontalScrollBar), this.horizontalScrollBar.removeEventListener(c.Event.CHANGE, this.hBarChanged, this, !1), this.horizontalScrollBar = null);
  11279. this.verticalScrollBar && (this._removeFromDisplayList(this.verticalScrollBar), this.verticalScrollBar.removeEventListener(c.Event.CHANGE, this.vBarChanged, this, !1), this.verticalScrollBar = null)
  11280. };
  11281. d.prototype.hBarChanged = function(a) {
  11282. this.setViewportHScrollPosition(this.horizontalScrollBar._getValue())
  11283. };
  11284. d.prototype.vBarChanged = function(a) {
  11285. this.setViewportVScrollPosition(this.verticalScrollBar.getPosition())
  11286. };
  11287. d.prototype._createOwnStyleProtoChain = function(d) {
  11288. d = a.prototype._createOwnStyleProtoChain.call(this, d);
  11289. var b = this._viewport;
  11290. b && "_addToStyleProtoChain" in b && b._addToStyleProtoChain(d);
  11291. return d
  11292. };
  11293. d.prototype.regenerateStyleCache = function(d) {
  11294. a.prototype.regenerateStyleCache.call(this, d);
  11295. var b = this._viewport;
  11296. b && "regenerateStyleCache" in b && b.regenerateStyleCache(d)
  11297. };
  11298. d.prototype.notifyStyleChangeInChildren = function(d) {
  11299. a.prototype.notifyStyleChangeInChildren.call(this, d);
  11300. var b = this._viewport;
  11301. b && "styleChanged" in b && (b.styleChanged(d), b.notifyStyleChangeInChildren(d))
  11302. };
  11303. d.prototype._updateChildrenNestLevel = function() {
  11304. a.prototype._updateChildrenNestLevel.call(this);
  11305. var d = this._viewport;
  11306. d && "nestLevel" in d && (d.nestLevel = this.nestLevel + 1)
  11307. };
  11308. return d
  11309. }(e.SkinnableComponent);
  11310. e.Scroller = b;
  11311. b.prototype.__class__ = "egret.gui.Scroller"
  11312. })(c.gui || (c.gui = {}))
  11313. })(egret || (egret = {}));
  11314. __extends = this.__extends || function(c, e) {
  11315. function f() {
  11316. this.constructor = c
  11317. }
  11318. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11319. f.prototype = e.prototype;
  11320. c.prototype = new f
  11321. };
  11322. (function(c) {
  11323. (function(e) {
  11324. var f = function(b) {
  11325. function a() {
  11326. b.call(this);
  11327. this._selectable = !0;
  11328. this._displayAsPassword = !1;
  11329. this._editable = this.pendingEditable = this.displayAsPasswordChanged = !0;
  11330. this.editableChanged = !1;
  11331. this._maxChars = 0;
  11332. this.maxCharsChanged = !1;
  11333. this._multiline = !0;
  11334. this.multilineChanged = !1;
  11335. this._restrict = null;
  11336. this.restrictChanged = !1;
  11337. this._heightInLines = NaN;
  11338. this.heightInLinesChanged = !1;
  11339. this._widthInChars = NaN;
  11340. this.widthInCharsChanged = !1;
  11341. this._verticalScrollPosition = this._horizontalScrollPosition = this._contentHeight = this._contentWidth = 0;
  11342. this._clipAndEnableScrolling = !1;
  11343. this.defaultWidth = this.defaultHeight = NaN;
  11344. this.isValidating = !1;
  11345. this.selectable = !0
  11346. }
  11347. __extends(a, b);
  11348. Object.defineProperty(a.prototype, "selectable", {
  11349. get: function() {
  11350. return this._selectable
  11351. },
  11352. set: function(a) {
  11353. this._selectable = a
  11354. },
  11355. enumerable: !0,
  11356. configurable: !0
  11357. });
  11358. Object.defineProperty(a.prototype, "displayAsPassword", {
  11359. get: function() {
  11360. return this._displayAsPassword
  11361. },
  11362. set: function(a) {
  11363. a != this._displayAsPassword && (this._displayAsPassword = a, this.displayAsPasswordChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  11364. },
  11365. enumerable: !0,
  11366. configurable: !0
  11367. });
  11368. Object.defineProperty(a.prototype, "editable", {
  11369. get: function() {
  11370. return this._enabled ? this._editable : this.pendingEditable
  11371. },
  11372. set: function(a) {
  11373. this._editable != a && (this._enabled ? (this._editable = a, this.editableChanged = !0, this.invalidateProperties()) : this.pendingEditable = a)
  11374. },
  11375. enumerable: !0,
  11376. configurable: !0
  11377. });
  11378. Object.defineProperty(a.prototype, "enabled", {
  11379. get: function() {
  11380. return this._editable
  11381. },
  11382. set: function(a) {
  11383. a != this._enabled && ((this._enabled = a) ? (this._editable != this.pendingEditable && (this.editableChanged = !0), this._editable = this.pendingEditable) : (this.editable && (this.editableChanged = !0), this.pendingEditable = this._editable, this._editable = !1), this.invalidateProperties())
  11384. },
  11385. enumerable: !0,
  11386. configurable: !0
  11387. });
  11388. Object.defineProperty(a.prototype, "maxChars", {
  11389. get: function() {
  11390. return this._maxChars
  11391. },
  11392. set: function(a) {
  11393. void 0 === a && (a = 0);
  11394. a != this._maxChars && (this._maxChars = a, this.maxCharsChanged = !0, this.invalidateProperties())
  11395. },
  11396. enumerable: !0,
  11397. configurable: !0
  11398. });
  11399. Object.defineProperty(a.prototype, "multiline", {
  11400. get: function() {
  11401. return this._multiline
  11402. },
  11403. set: function(a) {
  11404. a != this.multiline && (this._multiline = a, this.multilineChanged = !0, this.invalidateProperties())
  11405. },
  11406. enumerable: !0,
  11407. configurable: !0
  11408. });
  11409. Object.defineProperty(a.prototype, "restrict", {
  11410. get: function() {
  11411. return this._restrict
  11412. },
  11413. set: function(a) {
  11414. a != this._restrict && (this._restrict = a, this.restrictChanged = !0, this.invalidateProperties())
  11415. },
  11416. enumerable: !0,
  11417. configurable: !0
  11418. });
  11419. a.prototype.styleChanged = function(a) {
  11420. b.prototype.styleChanged.call(this, a);
  11421. a && "size" != a || (this.widthInCharsChanged = this.heightInLinesChanged = !0)
  11422. };
  11423. a.prototype._setLineSpacing = function(a) {
  11424. this._lineSpacing != a && (b.prototype._setLineSpacing.call(this, a), this.heightInLinesChanged = !0)
  11425. };
  11426. Object.defineProperty(a.prototype, "heightInLines", {
  11427. get: function() {
  11428. return this._heightInLines
  11429. },
  11430. set: function(a) {
  11431. this._heightInLines != a && (this._heightInLines = a, this.heightInLinesChanged = !0, this.invalidateProperties())
  11432. },
  11433. enumerable: !0,
  11434. configurable: !0
  11435. });
  11436. Object.defineProperty(a.prototype, "widthInChars", {
  11437. get: function() {
  11438. return this._widthInChars
  11439. },
  11440. set: function(a) {
  11441. this._widthInChars != a && (this._widthInChars = a, this.widthInCharsChanged = !0, this.invalidateProperties())
  11442. },
  11443. enumerable: !0,
  11444. configurable: !0
  11445. });
  11446. Object.defineProperty(a.prototype, "contentWidth", {
  11447. get: function() {
  11448. return this._contentWidth
  11449. },
  11450. enumerable: !0,
  11451. configurable: !0
  11452. });
  11453. a.prototype.setContentWidth = function(a) {
  11454. if (a != this._contentWidth) {
  11455. var b = this._contentWidth;
  11456. this._contentWidth = a;
  11457. this.dispatchPropertyChangeEvent("contentWidth", b, a)
  11458. }
  11459. };
  11460. Object.defineProperty(a.prototype, "contentHeight", {
  11461. get: function() {
  11462. return this._contentHeight
  11463. },
  11464. enumerable: !0,
  11465. configurable: !0
  11466. });
  11467. a.prototype.setContentHeight = function(a) {
  11468. if (a != this._contentHeight) {
  11469. var b = this._contentHeight;
  11470. this._contentHeight = a;
  11471. this.dispatchPropertyChangeEvent("contentHeight", b, a)
  11472. }
  11473. };
  11474. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  11475. get: function() {
  11476. return this._horizontalScrollPosition
  11477. },
  11478. set: function(a) {
  11479. this._horizontalScrollPosition != a && (this._horizontalScrollPosition = a)
  11480. },
  11481. enumerable: !0,
  11482. configurable: !0
  11483. });
  11484. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  11485. get: function() {
  11486. return this._verticalScrollPosition
  11487. },
  11488. set: function(a) {
  11489. this._verticalScrollPosition != a && (this._verticalScrollPosition = a = Math.round(a))
  11490. },
  11491. enumerable: !0,
  11492. configurable: !0
  11493. });
  11494. a.prototype.getScrollVByVertitcalPos = function(a) {
  11495. if (0 == this._textField.numLines) return 1;
  11496. var b = this._textField._getLineHeight();
  11497. return this._textField.height + (this.height - 4) % b - this.height == a ? this._textField.maxScrollV : parseInt((a - 2) / b) + 1
  11498. };
  11499. a.prototype.getVerticalPosByScrollV = function(a) {
  11500. void 0 === a && (a = 0);
  11501. if (1 == a || 0 == this._textField.numLines) return 0;
  11502. var b = this._textField._getLineHeight();
  11503. return a == this._textField.maxScrollV ? this._textField.height + (this.height - 4) % b - this.height : b * (a - 1) + 2
  11504. };
  11505. a.prototype.getHorizontalScrollPositionDelta = function(a) {
  11506. void 0 === a && (a = 0);
  11507. var b = 0,
  11508. c = this._contentWidth - this._horizontalScrollPosition - this.width,
  11509. f = -this._horizontalScrollPosition;
  11510. switch (a) {
  11511. case e.NavigationUnit.LEFT:
  11512. b = 0 >= this._horizontalScrollPosition ? 0 : Math.max(f, -this.size);
  11513. break;
  11514. case e.NavigationUnit.RIGHT:
  11515. b = this._horizontalScrollPosition + this.width >= this.contentWidth ? 0 : Math.min(c, this.size);
  11516. break;
  11517. case e.NavigationUnit.PAGE_LEFT:
  11518. b = Math.max(f, -this.width);
  11519. break;
  11520. case e.NavigationUnit.PAGE_RIGHT:
  11521. b = Math.min(c, this.width);
  11522. break;
  11523. case e.NavigationUnit.HOME:
  11524. b = f;
  11525. break;
  11526. case e.NavigationUnit.END:
  11527. b = c
  11528. }
  11529. return b
  11530. };
  11531. a.prototype.getVerticalScrollPositionDelta = function(a) {
  11532. void 0 === a && (a = 0);
  11533. var b = 0,
  11534. c = this._contentHeight - this._verticalScrollPosition - this.height,
  11535. f = -this._verticalScrollPosition;
  11536. switch (a) {
  11537. case e.NavigationUnit.UP:
  11538. b = this.getVScrollDelta(-1);
  11539. break;
  11540. case e.NavigationUnit.DOWN:
  11541. b = this.getVScrollDelta(1);
  11542. break;
  11543. case e.NavigationUnit.PAGE_UP:
  11544. b = Math.max(f, -this.width);
  11545. break;
  11546. case e.NavigationUnit.PAGE_DOWN:
  11547. b = Math.min(c, this.width);
  11548. break;
  11549. case e.NavigationUnit.HOME:
  11550. b = f;
  11551. break;
  11552. case e.NavigationUnit.END:
  11553. b = c
  11554. }
  11555. return b
  11556. };
  11557. a.prototype.getVScrollDelta = function(a) {
  11558. void 0 === a && (a = 0);
  11559. if (!this._textField) return 0;
  11560. a = this.getScrollVByVertitcalPos(this._verticalScrollPosition) + a;
  11561. a = Math.max(1, Math.min(this._textField.maxScrollV, a));
  11562. return this.getVerticalPosByScrollV(a) - this._verticalScrollPosition
  11563. };
  11564. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  11565. get: function() {
  11566. return this._clipAndEnableScrolling
  11567. },
  11568. set: function(a) {
  11569. this._clipAndEnableScrolling != a && (this._clipAndEnableScrolling = a)
  11570. },
  11571. enumerable: !0,
  11572. configurable: !0
  11573. });
  11574. a.prototype.commitProperties = function() {
  11575. this._textField || (this.restrictChanged = this.multilineChanged = this.maxCharsChanged = this.displayAsPasswordChanged = this.editableChanged = !0);
  11576. b.prototype.commitProperties.call(this);
  11577. this.editableChanged && (this._textField.type = this._editable ? c.TextFieldType.INPUT : c.TextFieldType.DYNAMIC, this.editableChanged = !1);
  11578. this.displayAsPasswordChanged && (this._textField.displayAsPassword = this._displayAsPassword, this.displayAsPasswordChanged = !1);
  11579. this.maxCharsChanged && (this._textField.maxChars = this._maxChars, this.maxCharsChanged = !1);
  11580. this.multilineChanged && (this._textField.multiline = this._multiline, this.multilineChanged = !1);
  11581. this.restrictChanged && (this.restrictChanged = !1);
  11582. if (this.heightInLinesChanged)
  11583. if (this.heightInLinesChanged = !1, isNaN(this._heightInLines)) this.defaultHeight = NaN;
  11584. else {
  11585. var a = parseInt(this.heightInLines),
  11586. e = 22;
  11587. 0 < this._textField._text.length ? e = this._textField._getLineHeight() : (this._textField._text = "M", e = this._textField._getLineHeight(), this._textField._text = "");
  11588. this.defaultHeight = a * e + 4
  11589. }
  11590. this.widthInCharsChanged && (this.widthInCharsChanged = !1, isNaN(this._widthInChars) ? this.defaultWidth = NaN : (a = parseInt(this._widthInChars), this.defaultWidth = this.size * a + 5))
  11591. };
  11592. a.prototype.updateDisplayList = function(a, c) {
  11593. this.isValidating = !0;
  11594. b.prototype.updateDisplayList.call(this, a, c);
  11595. this.updateContentSize();
  11596. this.isValidating = !1
  11597. };
  11598. a.prototype.updateContentSize = function() {
  11599. if (this.clipAndEnableScrolling) {
  11600. this.setContentWidth(this._textField.width);
  11601. var a = 0;
  11602. 0 == this._textField.numLines ? a = 4 : (a = this._textField._getLineHeight(), a = this._textField.height + (this.height - 4) % a);
  11603. this.setContentHeight(a)
  11604. }
  11605. };
  11606. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  11607. get: function() {
  11608. this.validateProperties();
  11609. return this._textField ? this._textField.selectionBeginIndex : 0
  11610. },
  11611. enumerable: !0,
  11612. configurable: !0
  11613. });
  11614. Object.defineProperty(a.prototype, "selectionEndIndex", {
  11615. get: function() {
  11616. this.validateProperties();
  11617. return this._textField ? this._textField.selectionEndIndex : 0
  11618. },
  11619. enumerable: !0,
  11620. configurable: !0
  11621. });
  11622. Object.defineProperty(a.prototype, "caretIndex", {
  11623. get: function() {
  11624. this.validateProperties();
  11625. return this._textField ? this._textField.caretIndex : 0
  11626. },
  11627. enumerable: !0,
  11628. configurable: !0
  11629. });
  11630. a.prototype.setSelection = function(a, b) {
  11631. void 0 === b && (b = 0);
  11632. this.validateProperties();
  11633. this._textField && this._textField._setSelection(a, b)
  11634. };
  11635. a.prototype.selectAll = function() {
  11636. this.validateProperties();
  11637. this._textField && this._textField._setSelection(0, this._textField.text.length)
  11638. };
  11639. a.prototype.measure = function() {
  11640. this.measuredWidth = isNaN(this.defaultWidth) ? e.TextBase.DEFAULT_MEASURED_WIDTH : this.defaultWidth;
  11641. 0 != this._maxChars && (this.measuredWidth = Math.min(this.measuredWidth, this._textField.width));
  11642. this.measuredHeight = this._multiline ? isNaN(this.defaultHeight) ? 2 * e.TextBase.DEFAULT_MEASURED_HEIGHT : this.defaultHeight : this._textField.height
  11643. };
  11644. a.prototype._createTextField = function() {
  11645. b.prototype._createTextField.call(this);
  11646. this._textField.type = this._editable ? c.TextFieldType.INPUT : c.TextFieldType.DYNAMIC;
  11647. this._textField.multiline = this._multiline;
  11648. this._textField.addEventListener(c.Event.CHANGE, this.textField_changeHandler, this);
  11649. this._textField.addEventListener("scroll", this.textField_scrollHandler, this);
  11650. this._textField.addEventListener("input", this.textField_textInputHandler, this)
  11651. };
  11652. a.prototype.textField_changeHandler = function(a) {
  11653. a.stopImmediatePropagation();
  11654. this.dispatchEvent(new c.Event(c.Event.CHANGE));
  11655. this.invalidateSize();
  11656. this.invalidateDisplayList();
  11657. this.updateContentSize()
  11658. };
  11659. a.prototype.textField_scrollHandler = function(a) {};
  11660. a.prototype.textField_textInputHandler = function(a) {
  11661. a.stopImmediatePropagation();
  11662. var b = new c.Event(a.type, !1, !0);
  11663. b.data = a.data;
  11664. this.dispatchEvent(b);
  11665. b.isDefaultPrevented() && a.preventDefault()
  11666. };
  11667. return a
  11668. }(e.TextBase);
  11669. e.EditableText = f;
  11670. f.prototype.__class__ = "egret.gui.EditableText"
  11671. })(c.gui || (c.gui = {}))
  11672. })(egret || (egret = {}));
  11673. __extends = this.__extends || function(c, e) {
  11674. function f() {
  11675. this.constructor = c
  11676. }
  11677. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11678. f.prototype = e.prototype;
  11679. c.prototype = new f
  11680. };
  11681. (function(c) {
  11682. (function(e) {
  11683. var f = function(b) {
  11684. function a(a, c, e) {
  11685. void 0 === c && (c = !1);
  11686. void 0 === e && (e = !1);
  11687. b.call(this, a, c, e)
  11688. }
  11689. __extends(a, b);
  11690. a.dispatchUIEvent = function(b, e) {
  11691. c.Event._dispatchByTarget(a, b, e)
  11692. };
  11693. a.INITIALIZE = "initialize";
  11694. a.CREATION_COMPLETE = "creationComplete";
  11695. a.UPDATE_COMPLETE = "updateComplete";
  11696. a.BUTTON_DOWN = "buttonDown";
  11697. a.CHANGE_END = "changeEnd";
  11698. a.CHANGE_START = "changeStart";
  11699. a.CHANGING = "changing";
  11700. a.VALUE_COMMIT = "valueCommit";
  11701. a.SKIN_CHANGED = "skinChanged";
  11702. a.CONTENT_CHANGED = "contentChanged";
  11703. a.OPEN = "open";
  11704. a.CLOSE = "close";
  11705. a.PLAY_COMPLETE = "playComplete";
  11706. return a
  11707. }(c.Event);
  11708. e.UIEvent = f;
  11709. f.prototype.__class__ = "egret.gui.UIEvent"
  11710. })(c.gui || (c.gui = {}))
  11711. })(egret || (egret = {}));
  11712. __extends = this.__extends || function(c, e) {
  11713. function f() {
  11714. this.constructor = c
  11715. }
  11716. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11717. f.prototype = e.prototype;
  11718. c.prototype = new f
  11719. };
  11720. (function(c) {
  11721. (function(e) {
  11722. var f = function(b) {
  11723. function a(a, c, e, f, g, h, k, l) {
  11724. void 0 === c && (c = !1);
  11725. void 0 === e && (e = !1);
  11726. void 0 === f && (f = null);
  11727. void 0 === g && (g = null);
  11728. void 0 === h && (h = null);
  11729. void 0 === k && (k = null);
  11730. void 0 === l && (l = null);
  11731. b.call(this, a, c, e);
  11732. this.kind = f;
  11733. this.property = g;
  11734. this.oldValue = h;
  11735. this.newValue = k;
  11736. this.source = l
  11737. }
  11738. __extends(a, b);
  11739. a.dispatchPropertyChangeEvent = function(b, e, f, q, g, h) {
  11740. void 0 === e && (e = null);
  11741. void 0 === f && (f = null);
  11742. void 0 === q && (q = null);
  11743. void 0 === g && (g = null);
  11744. void 0 === h && (h = null);
  11745. var k = c.Event._getPropertyData(a);
  11746. k.kind = e;
  11747. k.property = f;
  11748. k.oldValue = q;
  11749. k.newValue = g;
  11750. k.source = h;
  11751. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, k)
  11752. };
  11753. a.PROPERTY_CHANGE = "propertyChange";
  11754. return a
  11755. }(c.Event);
  11756. e.PropertyChangeEvent = f;
  11757. f.prototype.__class__ = "egret.gui.PropertyChangeEvent"
  11758. })(c.gui || (c.gui = {}))
  11759. })(egret || (egret = {}));
  11760. (function(c) {
  11761. (function(c) {
  11762. var f = function() {
  11763. function b() {}
  11764. b.UPDATE = "update";
  11765. b.DELETE = "delete";
  11766. return b
  11767. }();
  11768. c.PropertyChangeEventKind = f;
  11769. f.prototype.__class__ = "egret.gui.PropertyChangeEventKind"
  11770. })(c.gui || (c.gui = {}))
  11771. })(egret || (egret = {}));
  11772. __extends = this.__extends || function(c, e) {
  11773. function f() {
  11774. this.constructor = c
  11775. }
  11776. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11777. f.prototype = e.prototype;
  11778. c.prototype = new f
  11779. };
  11780. (function(c) {
  11781. (function(e) {
  11782. var f = function(b) {
  11783. function a(a, c, e, f, g) {
  11784. void 0 === c && (c = NaN);
  11785. void 0 === e && (e = NaN);
  11786. void 0 === f && (f = !1);
  11787. void 0 === g && (g = !1);
  11788. b.call(this, a, f, g);
  11789. this.oldX = c;
  11790. this.oldY = e
  11791. }
  11792. __extends(a, b);
  11793. a.dispatchMoveEvent = function(b, e, f) {
  11794. void 0 === e && (e = NaN);
  11795. void 0 === f && (f = NaN);
  11796. var q = c.Event._getPropertyData(a);
  11797. q.oldX = e;
  11798. q.oldY = f;
  11799. c.Event._dispatchByTarget(a, b, a.MOVE, q)
  11800. };
  11801. a.MOVE = "move";
  11802. return a
  11803. }(c.Event);
  11804. e.MoveEvent = f;
  11805. f.prototype.__class__ = "egret.gui.MoveEvent"
  11806. })(c.gui || (c.gui = {}))
  11807. })(egret || (egret = {}));
  11808. __extends = this.__extends || function(c, e) {
  11809. function f() {
  11810. this.constructor = c
  11811. }
  11812. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11813. f.prototype = e.prototype;
  11814. c.prototype = new f
  11815. };
  11816. (function(c) {
  11817. (function(e) {
  11818. var f = function(b) {
  11819. function a(a, c, e, f, g) {
  11820. void 0 === c && (c = NaN);
  11821. void 0 === e && (e = NaN);
  11822. void 0 === f && (f = !1);
  11823. void 0 === g && (g = !1);
  11824. b.call(this, a, f, g);
  11825. this.oldWidth = c;
  11826. this.oldHeight = e
  11827. }
  11828. __extends(a, b);
  11829. a.dispatchResizeEvent = function(b, e, f) {
  11830. void 0 === e && (e = NaN);
  11831. void 0 === f && (f = NaN);
  11832. var q = c.Event._getPropertyData(a);
  11833. q.oldWidth = e;
  11834. q.oldHeight = f;
  11835. c.Event._dispatchByTarget(a, b, a.RESIZE, q)
  11836. };
  11837. a.RESIZE = "resize";
  11838. return a
  11839. }(c.Event);
  11840. e.ResizeEvent = f;
  11841. f.prototype.__class__ = "egret.gui.ResizeEvent"
  11842. })(c.gui || (c.gui = {}))
  11843. })(egret || (egret = {}));
  11844. __extends = this.__extends || function(c, e) {
  11845. function f() {
  11846. this.constructor = c
  11847. }
  11848. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11849. f.prototype = e.prototype;
  11850. c.prototype = new f
  11851. };
  11852. (function(c) {
  11853. (function(e) {
  11854. var f = function(b) {
  11855. function a(a, c, e, f, g) {
  11856. void 0 === c && (c = !1);
  11857. void 0 === e && (e = !1);
  11858. void 0 === f && (f = null);
  11859. void 0 === g && (g = null);
  11860. b.call(this, a, c, e);
  11861. this.partName = f;
  11862. this.instance = g
  11863. }
  11864. __extends(a, b);
  11865. a.dispatchSkinPartEvent = function(b, e, f, q) {
  11866. void 0 === f && (f = null);
  11867. void 0 === q && (q = null);
  11868. var g = c.Event._getPropertyData(a);
  11869. g.partName = f;
  11870. g.instance = q;
  11871. c.Event._dispatchByTarget(a, b, e, g)
  11872. };
  11873. a.PART_ADDED = "partAdded";
  11874. a.PART_REMOVED = "partRemoved";
  11875. return a
  11876. }(c.Event);
  11877. e.SkinPartEvent = f;
  11878. f.prototype.__class__ = "egret.gui.SkinPartEvent"
  11879. })(c.gui || (c.gui = {}))
  11880. })(egret || (egret = {}));
  11881. __extends = this.__extends || function(c, e) {
  11882. function f() {
  11883. this.constructor = c
  11884. }
  11885. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11886. f.prototype = e.prototype;
  11887. c.prototype = new f
  11888. };
  11889. (function(c) {
  11890. (function(e) {
  11891. var f = function(b) {
  11892. function a(a, c, e, f, g, h, k, l) {
  11893. void 0 === c && (c = !1);
  11894. void 0 === e && (e = !1);
  11895. void 0 === f && (f = null);
  11896. void 0 === g && (g = -1);
  11897. void 0 === h && (h = -1);
  11898. void 0 === k && (k = null);
  11899. void 0 === l && (l = null);
  11900. b.call(this, a, c, e);
  11901. this.kind = f;
  11902. this.location = g;
  11903. this.oldLocation = h;
  11904. this.items = k ? k : [];
  11905. this.oldItems = l ? l : []
  11906. }
  11907. __extends(a, b);
  11908. a.dispatchCollectionEvent = function(b, e, f, q, g, h, k) {
  11909. void 0 === f && (f = null);
  11910. void 0 === q && (q = -1);
  11911. void 0 === g && (g = -1);
  11912. void 0 === h && (h = null);
  11913. void 0 === k && (k = null);
  11914. var l = c.Event._getPropertyData(a);
  11915. l.kind = f;
  11916. l.location = q;
  11917. l.oldLocation = g;
  11918. l.items = h;
  11919. l.oldItems = k;
  11920. c.Event._dispatchByTarget(a, b, e, l)
  11921. };
  11922. a.COLLECTION_CHANGE = "collectionChange";
  11923. return a
  11924. }(c.Event);
  11925. e.CollectionEvent = f;
  11926. f.prototype.__class__ = "egret.gui.CollectionEvent"
  11927. })(c.gui || (c.gui = {}))
  11928. })(egret || (egret = {}));
  11929. (function(c) {
  11930. (function(c) {
  11931. var f = function() {
  11932. function b() {}
  11933. b.ADD = "add";
  11934. b.MOVE = "move";
  11935. b.REFRESH = "refresh";
  11936. b.REMOVE = "remove";
  11937. b.REPLACE = "replace";
  11938. b.RESET = "reset";
  11939. b.UPDATE = "update";
  11940. b.OPEN = "open";
  11941. b.CLOSE = "close";
  11942. return b
  11943. }();
  11944. c.CollectionEventKind = f;
  11945. f.prototype.__class__ = "egret.gui.CollectionEventKind"
  11946. })(c.gui || (c.gui = {}))
  11947. })(egret || (egret = {}));
  11948. __extends = this.__extends || function(c, e) {
  11949. function f() {
  11950. this.constructor = c
  11951. }
  11952. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11953. f.prototype = e.prototype;
  11954. c.prototype = new f
  11955. };
  11956. (function(c) {
  11957. (function(e) {
  11958. var f = function(b) {
  11959. function a(a, c, e, f, g) {
  11960. void 0 === c && (c = !1);
  11961. void 0 === e && (e = !1);
  11962. void 0 === f && (f = null);
  11963. void 0 === g && (g = -1);
  11964. b.call(this, a, c, e);
  11965. this.element = f;
  11966. this.index = g
  11967. }
  11968. __extends(a, b);
  11969. a.dispatchElementExistenceEvent = function(b, e, f, q) {
  11970. void 0 === f && (f = null);
  11971. void 0 === q && (q = -1);
  11972. var g = c.Event._getPropertyData(a);
  11973. g.element = f;
  11974. g.index = q;
  11975. c.Event._dispatchByTarget(a, b, e, g)
  11976. };
  11977. a.ELEMENT_ADD = "elementAdd";
  11978. a.ELEMENT_REMOVE = "elementRemove";
  11979. return a
  11980. }(c.Event);
  11981. e.ElementExistenceEvent = f;
  11982. f.prototype.__class__ = "egret.gui.ElementExistenceEvent"
  11983. })(c.gui || (c.gui = {}))
  11984. })(egret || (egret = {}));
  11985. __extends = this.__extends || function(c, e) {
  11986. function f() {
  11987. this.constructor = c
  11988. }
  11989. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  11990. f.prototype = e.prototype;
  11991. c.prototype = new f
  11992. };
  11993. (function(c) {
  11994. (function(e) {
  11995. var f = function(b) {
  11996. function a(a, c, e, f, g) {
  11997. void 0 === c && (c = !1);
  11998. void 0 === e && (e = !1);
  11999. void 0 === f && (f = null);
  12000. void 0 === g && (g = !1);
  12001. b.call(this, a, c, e);
  12002. this.popUp = f;
  12003. this.modal = g
  12004. }
  12005. __extends(a, b);
  12006. a.dispatchPopUpEvent = function(b, e, f, q) {
  12007. void 0 === f && (f = null);
  12008. void 0 === q && (q = !1);
  12009. var g = c.Event._getPropertyData(a);
  12010. g.popUp = f;
  12011. g.modal = q;
  12012. c.Event._dispatchByTarget(a, b, e, g)
  12013. };
  12014. a.ADD_POPUP = "addPopUp";
  12015. a.REMOVE_POPUP = "removePopUp";
  12016. a.BRING_TO_FRONT = "bringToFront";
  12017. return a
  12018. }(c.Event);
  12019. e.PopUpEvent = f;
  12020. f.prototype.__class__ = "egret.gui.PopUpEvent"
  12021. })(c.gui || (c.gui = {}))
  12022. })(egret || (egret = {}));
  12023. __extends = this.__extends || function(c, e) {
  12024. function f() {
  12025. this.constructor = c
  12026. }
  12027. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12028. f.prototype = e.prototype;
  12029. c.prototype = new f
  12030. };
  12031. (function(c) {
  12032. (function(e) {
  12033. var f = function(b) {
  12034. function a(a, c, e, f, g, h) {
  12035. void 0 === c && (c = !1);
  12036. void 0 === e && (e = !1);
  12037. void 0 === f && (f = null);
  12038. void 0 === g && (g = -1);
  12039. void 0 === h && (h = null);
  12040. b.call(this, a, c, e);
  12041. this.renderer = f;
  12042. this.index = g;
  12043. this.data = h
  12044. }
  12045. __extends(a, b);
  12046. a.dispatchRendererExistenceEvent = function(b, e, f, q, g) {
  12047. void 0 === f && (f = null);
  12048. void 0 === q && (q = -1);
  12049. void 0 === g && (g = null);
  12050. var h = c.Event._getPropertyData(a);
  12051. h.renderer = f;
  12052. h.index = q;
  12053. h.data = g;
  12054. c.Event._dispatchByTarget(a, b, e, h)
  12055. };
  12056. a.RENDERER_ADD = "rendererAdd";
  12057. a.RENDERER_REMOVE = "rendererRemove";
  12058. return a
  12059. }(c.Event);
  12060. e.RendererExistenceEvent = f;
  12061. f.prototype.__class__ = "egret.gui.RendererExistenceEvent"
  12062. })(c.gui || (c.gui = {}))
  12063. })(egret || (egret = {}));
  12064. __extends = this.__extends || function(c, e) {
  12065. function f() {
  12066. this.constructor = c
  12067. }
  12068. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12069. f.prototype = e.prototype;
  12070. c.prototype = new f
  12071. };
  12072. (function(c) {
  12073. (function(e) {
  12074. var f = function(b) {
  12075. function a(a, c, e, f, g) {
  12076. void 0 === c && (c = !1);
  12077. void 0 === e && (e = !1);
  12078. void 0 === f && (f = null);
  12079. void 0 === g && (g = null);
  12080. b.call(this, a, c, e);
  12081. this.oldState = f;
  12082. this.newState = g
  12083. }
  12084. __extends(a, b);
  12085. a.dispatchStateChangeEvent = function(b, e, f, q) {
  12086. void 0 === f && (f = null);
  12087. void 0 === q && (q = null);
  12088. var g = c.Event._getPropertyData(a);
  12089. g.oldState = f;
  12090. g.newState = q;
  12091. c.Event._dispatchByTarget(a, b, e, g)
  12092. };
  12093. a.CURRENT_STATE_CHANGE = "currentStateChange";
  12094. a.CURRENT_STATE_CHANGING = "currentStateChanging";
  12095. return a
  12096. }(c.Event);
  12097. e.StateChangeEvent = f;
  12098. f.prototype.__class__ = "egret.gui.StateChangeEvent"
  12099. })(c.gui || (c.gui = {}))
  12100. })(egret || (egret = {}));
  12101. __extends = this.__extends || function(c, e) {
  12102. function f() {
  12103. this.constructor = c
  12104. }
  12105. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12106. f.prototype = e.prototype;
  12107. c.prototype = new f
  12108. };
  12109. (function(c) {
  12110. (function(e) {
  12111. var f = function(b) {
  12112. function a(a, c, e) {
  12113. void 0 === c && (c = !1);
  12114. void 0 === e && (e = !1);
  12115. b.call(this, a, c, e)
  12116. }
  12117. __extends(a, b);
  12118. a.dispatchTrackBaseEvent = function(b, e) {
  12119. c.Event._dispatchByTarget(a, b, e)
  12120. };
  12121. a.THUMB_DRAG = "thumbDrag";
  12122. a.THUMB_PRESS = "thumbPress";
  12123. a.THUMB_RELEASE = "thumbRelease";
  12124. return a
  12125. }(c.Event);
  12126. e.TrackBaseEvent = f;
  12127. f.prototype.__class__ = "egret.gui.TrackBaseEvent"
  12128. })(c.gui || (c.gui = {}))
  12129. })(egret || (egret = {}));
  12130. __extends = this.__extends || function(c, e) {
  12131. function f() {
  12132. this.constructor = c
  12133. }
  12134. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12135. f.prototype = e.prototype;
  12136. c.prototype = new f
  12137. };
  12138. (function(c) {
  12139. (function(e) {
  12140. var f = function(b) {
  12141. function a() {
  12142. b.call(this);
  12143. this._useVirtualLayout = !1
  12144. }
  12145. __extends(a, b);
  12146. Object.defineProperty(a.prototype, "target", {
  12147. get: function() {
  12148. return this._target
  12149. },
  12150. set: function(a) {
  12151. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  12152. },
  12153. enumerable: !0,
  12154. configurable: !0
  12155. });
  12156. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12157. get: function() {
  12158. return this._useVirtualLayout
  12159. },
  12160. set: function(a) {
  12161. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"), this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  12162. },
  12163. enumerable: !0,
  12164. configurable: !0
  12165. });
  12166. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  12167. get: function() {
  12168. return this._typicalLayoutRect
  12169. },
  12170. set: function(a) {
  12171. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  12172. },
  12173. enumerable: !0,
  12174. configurable: !0
  12175. });
  12176. a.prototype.scrollPositionChanged = function() {};
  12177. a.prototype.clearVirtualLayoutCache = function() {};
  12178. a.prototype.elementAdded = function(a) {};
  12179. a.prototype.elementRemoved = function(a) {};
  12180. a.prototype.measure = function() {};
  12181. a.prototype.updateDisplayList = function(a, b) {};
  12182. return a
  12183. }(c.EventDispatcher);
  12184. e.LayoutBase = f;
  12185. f.prototype.__class__ = "egret.gui.LayoutBase"
  12186. })(c.gui || (c.gui = {}))
  12187. })(egret || (egret = {}));
  12188. __extends = this.__extends || function(c, e) {
  12189. function f() {
  12190. this.constructor = c
  12191. }
  12192. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12193. f.prototype = e.prototype;
  12194. c.prototype = new f
  12195. };
  12196. (function(c) {
  12197. (function(e) {
  12198. var f = function(b) {
  12199. function a() {
  12200. b.call(this);
  12201. this._mouseWheelSpeed = 20
  12202. }
  12203. __extends(a, b);
  12204. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12205. set: function(a) {},
  12206. enumerable: !0,
  12207. configurable: !0
  12208. });
  12209. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  12210. get: function() {
  12211. return this._mouseWheelSpeed
  12212. },
  12213. set: function(a) {
  12214. 0 == a && (a = 1);
  12215. this._mouseWheelSpeed = a
  12216. },
  12217. enumerable: !0,
  12218. configurable: !0
  12219. });
  12220. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  12221. var b = new c.Rectangle;
  12222. b.x = a.x - this._mouseWheelSpeed;
  12223. b.right = a.x;
  12224. return b
  12225. };
  12226. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  12227. var b = new c.Rectangle;
  12228. b.x = a.right;
  12229. b.right = a.right + this._mouseWheelSpeed;
  12230. return b
  12231. };
  12232. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  12233. var b = new c.Rectangle;
  12234. b.y = a.y - this._mouseWheelSpeed;
  12235. b.bottom = a.y;
  12236. return b
  12237. };
  12238. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  12239. var b = new c.Rectangle;
  12240. b.y = a.bottom;
  12241. b.bottom = a.bottom + this._mouseWheelSpeed;
  12242. return b
  12243. };
  12244. a.prototype.measure = function() {
  12245. b.prototype.measure.call(this);
  12246. if (null != this.target) {
  12247. for (var a = 0, c = 0, e = this.target.numElements, f = 0; f < e; f++) {
  12248. var g = this.target.getElementAt(f);
  12249. if (g && g.includeInLayout) {
  12250. var h = g.horizontalCenter,
  12251. k = g.verticalCenter,
  12252. l = g.left,
  12253. m = g.right,
  12254. n = g.top,
  12255. p = g.bottom;
  12256. isNaN(l) || isNaN(m) ? isNaN(h) ? isNaN(l) && isNaN(m) ? h = g.preferredX : (h = isNaN(l) ? 0 : l, h += isNaN(m) ? 0 : m) : h = 2 * Math.abs(h) : h = l + m;
  12257. isNaN(n) || isNaN(p) ? isNaN(k) ? isNaN(n) && isNaN(p) ? k = g.preferredY : (k = isNaN(n) ? 0 : n, k += isNaN(p) ? 0 : p) : k = 2 * Math.abs(k) : k = n + p;
  12258. p = g.preferredHeight;
  12259. a = Math.ceil(Math.max(a, h + g.preferredWidth));
  12260. c = Math.ceil(Math.max(c, k + p))
  12261. }
  12262. }
  12263. this.target.measuredWidth = a;
  12264. this.target.measuredHeight = c
  12265. }
  12266. };
  12267. a.prototype.updateDisplayList = function(a, c) {
  12268. b.prototype.updateDisplayList.call(this, a, c);
  12269. if (null != this.target) {
  12270. for (var e = this.target.numElements, f = 0, g = 0, h = 0; h < e; h++) {
  12271. var k = this.target.getElementAt(h);
  12272. if (null != k && k.includeInLayout) {
  12273. var l = k.horizontalCenter,
  12274. m = k.verticalCenter,
  12275. n = k.left,
  12276. p = k.right,
  12277. r = k.top,
  12278. w = k.bottom,
  12279. A = k.percentWidth,
  12280. u = k.percentHeight,
  12281. y = NaN,
  12282. v = NaN;
  12283. isNaN(n) || isNaN(p) ? isNaN(A) || (y = Math.round(a * Math.min(0.01 * A, 1))) : y = a - p - n;
  12284. isNaN(r) || isNaN(w) ? isNaN(u) || (v = Math.round(c * Math.min(0.01 * u, 1))) : v = c - w - r;
  12285. k.setLayoutBoundsSize(y, v);
  12286. A = k.layoutBoundsWidth;
  12287. u = k.layoutBoundsHeight;
  12288. v = y = NaN;
  12289. y = isNaN(l) ? isNaN(n) ? isNaN(p) ? k.layoutBoundsX : a - A - p : n : Math.round((a - A) / 2 + l);
  12290. v = isNaN(m) ? isNaN(r) ? isNaN(w) ? k.layoutBoundsY : c - u - w : r : Math.round((c - u) / 2 + m);
  12291. k.setLayoutBoundsPosition(y, v);
  12292. f = Math.max(f, y + A);
  12293. g = Math.max(g, v + u)
  12294. }
  12295. }
  12296. this.target.setContentSize(f, g)
  12297. }
  12298. };
  12299. return a
  12300. }(e.LayoutBase);
  12301. e.BasicLayout = f;
  12302. f.prototype.__class__ = "egret.gui.BasicLayout"
  12303. })(c.gui || (c.gui = {}))
  12304. })(egret || (egret = {}));
  12305. __extends = this.__extends || function(c, e) {
  12306. function f() {
  12307. this.constructor = c
  12308. }
  12309. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12310. f.prototype = e.prototype;
  12311. c.prototype = new f
  12312. };
  12313. (function(c) {
  12314. (function(e) {
  12315. var f = function(a) {
  12316. function d() {
  12317. a.call(this);
  12318. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12319. this._verticalAlign = c.VerticalAlign.TOP;
  12320. this._gap = 6;
  12321. this._padding = 0;
  12322. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  12323. this.elementSizeTable = [];
  12324. this.endIndex = this.startIndex = -1;
  12325. this.indexInViewCalculated = !1;
  12326. this.maxElementWidth = 0
  12327. }
  12328. __extends(d, a);
  12329. Object.defineProperty(d.prototype, "horizontalAlign", {
  12330. get: function() {
  12331. return this._horizontalAlign
  12332. },
  12333. set: function(a) {
  12334. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  12335. },
  12336. enumerable: !0,
  12337. configurable: !0
  12338. });
  12339. Object.defineProperty(d.prototype, "verticalAlign", {
  12340. get: function() {
  12341. return this._verticalAlign
  12342. },
  12343. set: function(a) {
  12344. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  12345. },
  12346. enumerable: !0,
  12347. configurable: !0
  12348. });
  12349. Object.defineProperty(d.prototype, "gap", {
  12350. get: function() {
  12351. return this._gap
  12352. },
  12353. set: function(a) {
  12354. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  12355. },
  12356. enumerable: !0,
  12357. configurable: !0
  12358. });
  12359. Object.defineProperty(d.prototype, "padding", {
  12360. get: function() {
  12361. return this._padding
  12362. },
  12363. set: function(a) {
  12364. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  12365. },
  12366. enumerable: !0,
  12367. configurable: !0
  12368. });
  12369. Object.defineProperty(d.prototype, "paddingLeft", {
  12370. get: function() {
  12371. return this._paddingLeft
  12372. },
  12373. set: function(a) {
  12374. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  12375. },
  12376. enumerable: !0,
  12377. configurable: !0
  12378. });
  12379. Object.defineProperty(d.prototype, "paddingRight", {
  12380. get: function() {
  12381. return this._paddingRight
  12382. },
  12383. set: function(a) {
  12384. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  12385. },
  12386. enumerable: !0,
  12387. configurable: !0
  12388. });
  12389. Object.defineProperty(d.prototype, "paddingTop", {
  12390. get: function() {
  12391. return this._paddingTop
  12392. },
  12393. set: function(a) {
  12394. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  12395. },
  12396. enumerable: !0,
  12397. configurable: !0
  12398. });
  12399. Object.defineProperty(d.prototype, "paddingBottom", {
  12400. get: function() {
  12401. return this._paddingBottom
  12402. },
  12403. set: function(a) {
  12404. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  12405. },
  12406. enumerable: !0,
  12407. configurable: !0
  12408. });
  12409. d.prototype.invalidateTargetSizeAndDisplayList = function() {
  12410. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  12411. };
  12412. d.prototype.measure = function() {
  12413. a.prototype.measure.call(this);
  12414. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  12415. };
  12416. d.prototype.measureVirtual = function() {
  12417. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), d = this.getElementTotalSize(), c = this.target.getElementIndicesInView(), e = c.length, f = 0; f < e; f++) {
  12418. var l = c[f],
  12419. m = this.target.getElementAt(l);
  12420. if (null != m && m.includeInLayout) var n = m.preferredWidth,
  12421. d = d + m.preferredHeight, d = d - (isNaN(this.elementSizeTable[l]) ? a : this.elementSizeTable[l]), b = Math.max(b, n)
  12422. }
  12423. f = isNaN(this._padding) ? 0 : this._padding;
  12424. a = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  12425. c = isNaN(this._paddingRight) ? f : this._paddingRight;
  12426. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  12427. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  12428. e += f;
  12429. this.target.measuredWidth = Math.ceil(b + (a + c));
  12430. this.target.measuredHeight = Math.ceil(d + e)
  12431. };
  12432. d.prototype.measureReal = function() {
  12433. for (var a = this.target.numElements, b = a, d = 0, c = 0, e = 0; e < a; e++) {
  12434. var f = this.target.getElementAt(e);
  12435. if (f && f.includeInLayout) var l = f.preferredWidth,
  12436. c = c + f.preferredHeight, d = Math.max(d, l);
  12437. else b--
  12438. }
  12439. a = isNaN(this._gap) ? 0 : this._gap;
  12440. c += (b - 1) * a;
  12441. f = isNaN(this._padding) ? 0 : this._padding;
  12442. b = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  12443. a = isNaN(this._paddingRight) ? f : this._paddingRight;
  12444. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  12445. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  12446. e += f;
  12447. this.target.measuredWidth = Math.ceil(d + (b + a));
  12448. this.target.measuredHeight = Math.ceil(c + e)
  12449. };
  12450. d.prototype.updateDisplayList = function(b, d) {
  12451. a.prototype.updateDisplayList.call(this, b, d);
  12452. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, d) : this.updateDisplayListReal(b, d))
  12453. };
  12454. d.prototype.getStartPosition = function(a) {
  12455. var b = isNaN(this._padding) ? 0 : this._padding,
  12456. d = isNaN(this._paddingTop) ? b : this._paddingTop,
  12457. b = isNaN(this._gap) ? 0 : this._gap;
  12458. if (!this.useVirtualLayout) {
  12459. var c;
  12460. this.target && (c = this.target.getElementAt(a));
  12461. return c ? c.y : d
  12462. }
  12463. c = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  12464. for (var e = 0; e < a; e++) {
  12465. var f = this.elementSizeTable[e];
  12466. isNaN(f) && (f = c);
  12467. d += f + b
  12468. }
  12469. return d
  12470. };
  12471. d.prototype.getElementSize = function(a) {
  12472. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22), a) : this.target ? this.target.getElementAt(a).height : 0
  12473. };
  12474. d.prototype.getElementTotalSize = function() {
  12475. for (var a = isNaN(this._gap) ? 0 : this._gap, b = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, d = 0, c = this.target.numElements, e = 0; e < c; e++) {
  12476. var f = this.elementSizeTable[e];
  12477. isNaN(f) && (f = b);
  12478. d += f + a
  12479. }
  12480. return d - a
  12481. };
  12482. d.prototype.elementAdded = function(b) {
  12483. a.prototype.elementAdded.call(this, b);
  12484. this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.height : 22)
  12485. };
  12486. d.prototype.elementRemoved = function(b) {
  12487. a.prototype.elementRemoved.call(this, b);
  12488. this.elementSizeTable.splice(b, 1)
  12489. };
  12490. d.prototype.clearVirtualLayoutCache = function() {
  12491. a.prototype.clearVirtualLayoutCache.call(this);
  12492. this.elementSizeTable = [];
  12493. this.maxElementWidth = 0
  12494. };
  12495. d.prototype.findIndexAt = function(a, b, d) {
  12496. var c = Math.floor(0.5 * (b + d)),
  12497. e = this.getStartPosition(c),
  12498. f = this.getElementSize(c),
  12499. l = isNaN(this._gap) ? 0 : this._gap;
  12500. return a >= e && a < e + f + l ? c : b == d ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, c - 1)) : this.findIndexAt(a, Math.min(c + 1, d), d)
  12501. };
  12502. d.prototype.scrollPositionChanged = function() {
  12503. a.prototype.scrollPositionChanged.call(this);
  12504. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  12505. };
  12506. d.prototype.getIndexInView = function() {
  12507. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1, !1;
  12508. var a = isNaN(this._padding) ? 0 : this._padding,
  12509. b = isNaN(this._paddingTop) ? a : this._paddingTop,
  12510. d = isNaN(this._paddingBottom) ? a : this._paddingBottom,
  12511. a = this.target.numElements,
  12512. c = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + d,
  12513. e = this.target.verticalScrollPosition;
  12514. if (e > c - d) return this.endIndex = this.startIndex = -1, !1;
  12515. d = this.target.verticalScrollPosition + this.target.height;
  12516. if (d < b) return this.endIndex = this.startIndex = -1, !1;
  12517. b = this.startIndex;
  12518. c = this.endIndex;
  12519. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  12520. this.endIndex = this.findIndexAt(d, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  12521. return b != this.startIndex || c != this.endIndex
  12522. };
  12523. d.prototype.updateDisplayListVirtual = function(a, b) {
  12524. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  12525. var d = isNaN(this._padding) ? 0 : this._padding,
  12526. e = isNaN(this._paddingLeft) ? d : this._paddingLeft,
  12527. f = isNaN(this._paddingRight) ? d : this._paddingRight,
  12528. k = isNaN(this._paddingBottom) ? d : this._paddingBottom,
  12529. l = isNaN(this._gap) ? 0 : this._gap,
  12530. m = this.target.numElements;
  12531. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(m) - l + k, this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  12532. else {
  12533. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  12534. var n = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12535. p = this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12536. r = 0;
  12537. n || (this._horizontalAlign == c.HorizontalAlign.CENTER ? r = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (r = 1));
  12538. var w = Math.max(0, a - e - f),
  12539. A = Math.ceil(w),
  12540. u, y = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22,
  12541. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, this.maxElementWidth);
  12542. if (p) {
  12543. for (var v = this.startIndex; v <= this.endIndex; v++)(u = this.target.getVirtualElementAt(v)) && u.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, u.preferredWidth));
  12544. A = Math.ceil(Math.max(w, this.maxElementWidth))
  12545. }
  12546. for (var z = 0, t = 0, v = 0, E = !1, C = this.startIndex; C <= this.endIndex; C++)
  12547. if (z = 0, u = this.target.getVirtualElementAt(C)) u.includeInLayout ? (n ? (z = e, u.setLayoutBoundsSize(A, NaN)) : (z = (w - u.layoutBoundsWidth) * r, z = 0 < z ? z : 0, z = e + z), p || (this.maxElementWidth = Math.max(this.maxElementWidth, u.preferredWidth)), v = Math.max(v, u.layoutBoundsWidth), E || (t = isNaN(this.elementSizeTable[C]) ? y : this.elementSizeTable[C], t != u.layoutBoundsHeight && (E = !0)), 0 == C && 0 < this.elementSizeTable.length && this.elementSizeTable[C] != u.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[C] = u.layoutBoundsHeight, t = this.getStartPosition(C), u.setLayoutBoundsPosition(Math.round(z), Math.round(t))) : this.elementSizeTable[C] = 0;
  12548. v += e + f;
  12549. e = this.getStartPosition(m) - l + k;
  12550. this.target.setContentSize(Math.ceil(v), Math.ceil(e));
  12551. (E || d < this.maxElementWidth) && this.target.invalidateSize()
  12552. }
  12553. };
  12554. d.prototype.updateDisplayListReal = function(a, e) {
  12555. var f = isNaN(this._padding) ? 0 : this._padding,
  12556. g = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  12557. h = isNaN(this._paddingRight) ? f : this._paddingRight,
  12558. k = isNaN(this._paddingTop) ? f : this._paddingTop,
  12559. f = isNaN(this._paddingBottom) ? f : this._paddingBottom,
  12560. l = isNaN(this._gap) ? 0 : this._gap,
  12561. m = Math.max(0, a - g - h),
  12562. n = Math.max(0, e - k - f),
  12563. p = this._verticalAlign == c.VerticalAlign.JUSTIFY,
  12564. r = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  12565. w = 0;
  12566. r || (this._horizontalAlign == c.HorizontalAlign.CENTER ? w = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (w = 1));
  12567. var A = this.target.numElements,
  12568. u = A,
  12569. y = g,
  12570. v = k,
  12571. z, t, E = 0,
  12572. y = 0,
  12573. C = [],
  12574. D, B = n;
  12575. for (z = 0; z < A; z++)(t = this.target.getElementAt(z)) && t.includeInLayout ? (this.maxElementWidth = Math.max(this.maxElementWidth, t.preferredWidth), p ? E += t.preferredHeight : isNaN(t.percentHeight) ? B -= t.preferredHeight : (y += t.percentHeight, D = new b, D.layoutElement = t, D.percent = t.percentHeight, D.min = t.minHeight, D.max = t.maxHeight, C.push(D))) : u--;
  12576. var B = B - (u - 1) * l,
  12577. B = 0 < B ? B : 0,
  12578. F = n - E - l * (u - 1),
  12579. G, H = u,
  12580. I = [];
  12581. if (p) {
  12582. if (0 > F) {
  12583. G = B / u;
  12584. for (z = 0; z < A; z++)(t = this.target.getElementAt(z)) && t.includeInLayout && (t = t.preferredHeight, t <= G && (B -= t, H--));
  12585. B = 0 < B ? B : 0
  12586. }
  12587. } else if (0 < y) {
  12588. d.flexChildrenProportionally(n, B, y, C);
  12589. n = 0;
  12590. t = C.length;
  12591. for (z = 0; z < t; z++) D = C[z], y = Math.round(D.size + n), n += D.size - y, I[D.layoutElement.hashCode] = y, B -= y;
  12592. B = 0 < B ? B : 0
  12593. }
  12594. this._verticalAlign == c.VerticalAlign.MIDDLE ? v = k + 0.5 * B : this._verticalAlign == c.VerticalAlign.BOTTOM && (v = k + B);
  12595. C = g;
  12596. t = u = 0;
  12597. D = Math.ceil(m);
  12598. this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY && (D = Math.ceil(Math.max(m, this.maxElementWidth)));
  12599. n = 0;
  12600. u = NaN;
  12601. for (z = 0; z < A; z++) y = 0, (t = this.target.getElementAt(z)) && t.includeInLayout && (u = NaN, p ? (y = NaN, 0 < F ? y = B * t.preferredHeight / E : 0 > F && t.preferredHeight > G && (y = B / H), isNaN(y) || (u = Math.round(y + n), n += y - u)) : u = I[t.hashCode], r ? (y = g, t.setLayoutBoundsSize(D, u)) : (y = NaN, isNaN(t.percentWidth) || (y = Math.min(100, t.percentWidth), y = Math.round(m * y * 0.01)), t.setLayoutBoundsSize(y, u), y = (m - t.layoutBoundsWidth) * w, y = 0 < y ? y : 0, y = g + y), t.setLayoutBoundsPosition(Math.round(y), Math.round(v)), u = Math.ceil(t.layoutBoundsWidth), t = Math.ceil(t.layoutBoundsHeight), C = Math.max(C, y + u), k = Math.max(k, v + t), v += t + l);
  12602. this.target.setContentSize(Math.ceil(C + h), Math.ceil(k + f))
  12603. };
  12604. d.flexChildrenProportionally = function(a, b, d, c) {
  12605. var e = c.length,
  12606. f;
  12607. do {
  12608. f = !0;
  12609. var l = b - a * d / 100;
  12610. 0 < l ? b -= l : l = 0;
  12611. for (var m = b / d, n = 0; n < e; n++) {
  12612. var p = c[n],
  12613. r = p.percent * m;
  12614. if (r < p.min) {
  12615. f = p.min;
  12616. p.size = f;
  12617. c[n] = c[--e];
  12618. c[e] = p;
  12619. d -= p.percent;
  12620. l >= f || (b -= f - l);
  12621. f = !1;
  12622. break
  12623. } else if (r > p.max) {
  12624. f = p.max;
  12625. p.size = f;
  12626. c[n] = c[--e];
  12627. c[e] = p;
  12628. d -= p.percent;
  12629. l >= f || (b -= f - l);
  12630. f = !1;
  12631. break
  12632. } else p.size = r
  12633. }
  12634. } while (!f)
  12635. };
  12636. return d
  12637. }(e.LayoutBase);
  12638. e.VerticalLayout = f;
  12639. f.prototype.__class__ = "egret.gui.VerticalLayout";
  12640. var b = function() {
  12641. return function() {
  12642. this.size = 0
  12643. }
  12644. }();
  12645. b.prototype.__class__ = "egret.gui.ChildInfo"
  12646. })(c.gui || (c.gui = {}))
  12647. })(egret || (egret = {}));
  12648. __extends = this.__extends || function(c, e) {
  12649. function f() {
  12650. this.constructor = c
  12651. }
  12652. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  12653. f.prototype = e.prototype;
  12654. c.prototype = new f
  12655. };
  12656. (function(c) {
  12657. (function(e) {
  12658. var f = function(a) {
  12659. function d() {
  12660. a.call(this);
  12661. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12662. this._verticalAlign = c.VerticalAlign.TOP;
  12663. this._gap = 6;
  12664. this._padding = 0;
  12665. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  12666. this.elementSizeTable = [];
  12667. this.endIndex = this.startIndex = -1;
  12668. this.indexInViewCalculated = !1;
  12669. this.maxElementHeight = 0
  12670. }
  12671. __extends(d, a);
  12672. Object.defineProperty(d.prototype, "horizontalAlign", {
  12673. get: function() {
  12674. return this._horizontalAlign
  12675. },
  12676. set: function(a) {
  12677. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  12678. },
  12679. enumerable: !0,
  12680. configurable: !0
  12681. });
  12682. Object.defineProperty(d.prototype, "verticalAlign", {
  12683. get: function() {
  12684. return this._verticalAlign
  12685. },
  12686. set: function(a) {
  12687. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  12688. },
  12689. enumerable: !0,
  12690. configurable: !0
  12691. });
  12692. Object.defineProperty(d.prototype, "gap", {
  12693. get: function() {
  12694. return this._gap
  12695. },
  12696. set: function(a) {
  12697. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  12698. },
  12699. enumerable: !0,
  12700. configurable: !0
  12701. });
  12702. Object.defineProperty(d.prototype, "padding", {
  12703. get: function() {
  12704. return this._padding
  12705. },
  12706. set: function(a) {
  12707. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  12708. },
  12709. enumerable: !0,
  12710. configurable: !0
  12711. });
  12712. Object.defineProperty(d.prototype, "paddingLeft", {
  12713. get: function() {
  12714. return this._paddingLeft
  12715. },
  12716. set: function(a) {
  12717. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  12718. },
  12719. enumerable: !0,
  12720. configurable: !0
  12721. });
  12722. Object.defineProperty(d.prototype, "paddingRight", {
  12723. get: function() {
  12724. return this._paddingRight
  12725. },
  12726. set: function(a) {
  12727. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  12728. },
  12729. enumerable: !0,
  12730. configurable: !0
  12731. });
  12732. Object.defineProperty(d.prototype, "paddingTop", {
  12733. get: function() {
  12734. return this._paddingTop
  12735. },
  12736. set: function(a) {
  12737. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  12738. },
  12739. enumerable: !0,
  12740. configurable: !0
  12741. });
  12742. Object.defineProperty(d.prototype, "paddingBottom", {
  12743. get: function() {
  12744. return this._paddingBottom
  12745. },
  12746. set: function(a) {
  12747. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  12748. },
  12749. enumerable: !0,
  12750. configurable: !0
  12751. });
  12752. d.prototype.invalidateTargetSizeAndDisplayList = function() {
  12753. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  12754. };
  12755. d.prototype.measure = function() {
  12756. a.prototype.measure.call(this);
  12757. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  12758. };
  12759. d.prototype.measureVirtual = function() {
  12760. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, d = this.getElementTotalSize(), a = Math.max(this.maxElementHeight, a), c = this.target.getElementIndicesInView(), e = c.length, f = 0; f < e; f++) {
  12761. var l = c[f],
  12762. m = this.target.getElementAt(l);
  12763. if (null != m && m.includeInLayout) var n = m.preferredHeight,
  12764. d = d + m.preferredWidth, d = d - (isNaN(this.elementSizeTable[l]) ? b : this.elementSizeTable[l]), a = Math.max(a, n)
  12765. }
  12766. f = isNaN(this._padding) ? 0 : this._padding;
  12767. b = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  12768. c = isNaN(this._paddingRight) ? f : this._paddingRight;
  12769. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  12770. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  12771. e += f;
  12772. this.target.measuredWidth = Math.ceil(d + (b + c));
  12773. this.target.measuredHeight = Math.ceil(a + e)
  12774. };
  12775. d.prototype.measureReal = function() {
  12776. for (var a = this.target.numElements, b = a, d = 0, c = 0, e = 0; e < a; e++) {
  12777. var f = this.target.getElementAt(e);
  12778. if (f && f.includeInLayout) var l = f.preferredHeight,
  12779. d = d + f.preferredWidth, c = Math.max(c, l);
  12780. else b--
  12781. }
  12782. a = isNaN(this._gap) ? 0 : this._gap;
  12783. d += (b - 1) * a;
  12784. f = isNaN(this._padding) ? 0 : this._padding;
  12785. b = isNaN(this._paddingLeft) ? f : this._paddingLeft;
  12786. a = isNaN(this._paddingRight) ? f : this._paddingRight;
  12787. e = isNaN(this._paddingTop) ? f : this._paddingTop;
  12788. f = isNaN(this._paddingBottom) ? f : this._paddingBottom;
  12789. e += f;
  12790. this.target.measuredWidth = Math.ceil(d + (b + a));
  12791. this.target.measuredHeight = Math.ceil(c + e)
  12792. };
  12793. d.prototype.updateDisplayList = function(b, d) {
  12794. a.prototype.updateDisplayList.call(this, b, d);
  12795. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, d) : this.updateDisplayListReal(b, d))
  12796. };
  12797. d.prototype.getStartPosition = function(a) {
  12798. var b = isNaN(this._padding) ? 0 : this._padding,
  12799. d = isNaN(this._paddingLeft) ? b : this._paddingLeft,
  12800. b = isNaN(this._gap) ? 0 : this._gap;
  12801. if (!this.useVirtualLayout) {
  12802. var c;
  12803. this.target && (c = this.target.getElementAt(a));
  12804. return c ? c.x : d
  12805. }
  12806. c = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71;
  12807. for (var e = 0; e < a; e++) {
  12808. var f = this.elementSizeTable[e];
  12809. isNaN(f) && (f = c);
  12810. d += f + b
  12811. }
  12812. return d
  12813. };
  12814. d.prototype.getElementSize = function(a) {
  12815. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), a) : this.target ? this.target.getElementAt(a).width : 0
  12816. };
  12817. d.prototype.getElementTotalSize = function() {
  12818. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, b = isNaN(this._gap) ? 0 : this._gap, d = 0, c = this.target.numElements, e = 0; e < c; e++) {
  12819. var f = this.elementSizeTable[e];
  12820. isNaN(f) && (f = a);
  12821. d += f + b
  12822. }
  12823. return d - b
  12824. };
  12825. d.prototype.elementAdded = function(b) {
  12826. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71))
  12827. };
  12828. d.prototype.elementRemoved = function(b) {
  12829. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  12830. };
  12831. d.prototype.clearVirtualLayoutCache = function() {
  12832. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  12833. };
  12834. d.prototype.findIndexAt = function(a, b, d) {
  12835. var c = Math.floor(0.5 * (b + d)),
  12836. e = this.getStartPosition(c),
  12837. f = this.getElementSize(c),
  12838. l = isNaN(this._gap) ? 0 : this._gap;
  12839. return a >= e && a < e + f + l ? c : b == d ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, c - 1)) : this.findIndexAt(a, Math.min(c + 1, d), d)
  12840. };
  12841. d.prototype.scrollPositionChanged = function() {
  12842. a.prototype.scrollPositionChanged.call(this);
  12843. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  12844. };
  12845. d.prototype.getIndexInView = function() {
  12846. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1, !1;
  12847. var a = isNaN(this._padding) ? 0 : this._padding,
  12848. b = isNaN(this._paddingLeft) ? a : this._paddingLeft,
  12849. d = isNaN(this._paddingRight) ? a : this._paddingRight;
  12850. isNaN(this._paddingTop);
  12851. isNaN(this._paddingBottom);
  12852. var a = this.target.numElements,
  12853. c = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + d,
  12854. e = this.target.horizontalScrollPosition;
  12855. if (e > c - d) return this.endIndex = this.startIndex = -1, !1;
  12856. d = this.target.horizontalScrollPosition + this.target.width;
  12857. if (d < b) return this.endIndex = this.startIndex = -1, !1;
  12858. b = this.startIndex;
  12859. c = this.endIndex;
  12860. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  12861. this.endIndex = this.findIndexAt(d, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  12862. return b != this.startIndex || c != this.endIndex
  12863. };
  12864. d.prototype.updateDisplayListVirtual = function(a, b) {
  12865. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  12866. var d = isNaN(this._padding) ? 0 : this._padding,
  12867. e = isNaN(this._paddingRight) ? d : this._paddingRight,
  12868. f = isNaN(this._paddingTop) ? d : this._paddingTop,
  12869. k = isNaN(this._paddingBottom) ? d : this._paddingBottom,
  12870. l = isNaN(this._gap) ? 0 : this._gap,
  12871. m = this.target.numElements;
  12872. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(m) - l + e, this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  12873. else {
  12874. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  12875. var n = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  12876. p = this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  12877. r = 0;
  12878. n || (this._verticalAlign == c.VerticalAlign.MIDDLE ? r = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (r = 1));
  12879. var w = Math.max(0, b - f - k),
  12880. A = Math.ceil(w),
  12881. u, y = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71,
  12882. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, this.maxElementHeight);
  12883. if (p) {
  12884. for (var v = this.startIndex; v <= this.endIndex; v++)(u = this.target.getVirtualElementAt(v)) && u.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, u.preferredHeight));
  12885. A = Math.ceil(Math.max(w, this.maxElementHeight))
  12886. }
  12887. for (var z = 0, t = 0, v = 0, E = !1, C = this.startIndex; C <= this.endIndex; C++)
  12888. if (t = 0, u = this.target.getVirtualElementAt(C)) u.includeInLayout ? (n ? (t = f, u.setLayoutBoundsSize(NaN, A)) : (t = (w - u.layoutBoundsHeight) * r, t = 0 < t ? t : 0, t = f + t), p || (this.maxElementHeight = Math.max(this.maxElementHeight, u.preferredHeight)), v = Math.max(v, u.layoutBoundsHeight), E || (z = isNaN(this.elementSizeTable[C]) ? y : this.elementSizeTable[C], z != u.layoutBoundsWidth && (E = !0)), 0 == C && 0 < this.elementSizeTable.length && this.elementSizeTable[C] != u.layoutBoundsWidth && (this.typicalLayoutRect = null), this.elementSizeTable[C] = u.layoutBoundsWidth, z = this.getStartPosition(C), u.setLayoutBoundsPosition(Math.round(z), Math.round(t))) : this.elementSizeTable[C] = 0;
  12889. v += f + k;
  12890. e = this.getStartPosition(m) - l + e;
  12891. this.target.setContentSize(Math.ceil(e), Math.ceil(v));
  12892. (E || d < this.maxElementHeight) && this.target.invalidateSize()
  12893. }
  12894. };
  12895. d.prototype.updateDisplayListReal = function(a, e) {
  12896. var f = isNaN(this._padding) ? 0 : this._padding,
  12897. g = isNaN(this._paddingLeft) ? f : this._paddingLeft,
  12898. h = isNaN(this._paddingRight) ? f : this._paddingRight,
  12899. k = isNaN(this._paddingTop) ? f : this._paddingTop,
  12900. f = isNaN(this._paddingBottom) ? f : this._paddingBottom,
  12901. l = isNaN(this._gap) ? 0 : this._gap,
  12902. m = Math.max(0, a - g - h),
  12903. n = Math.max(0, e - k - f),
  12904. p = this._horizontalAlign == c.HorizontalAlign.JUSTIFY,
  12905. r = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  12906. w = 0;
  12907. r || (this._verticalAlign == c.VerticalAlign.MIDDLE ? w = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (w = 1));
  12908. var A = this.target.numElements,
  12909. u = A,
  12910. y = g,
  12911. v = k,
  12912. z, t, E = 0,
  12913. v = 0,
  12914. C = [],
  12915. D, B = m;
  12916. for (z = 0; z < A; z++)(t = this.target.getElementAt(z)) && t.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, t.preferredHeight), p ? E += t.preferredWidth : isNaN(t.percentWidth) ? B -= t.preferredWidth : (v += t.percentWidth, D = new b, D.layoutElement = t, D.percent = t.percentWidth, D.min = t.minWidth, D.max = t.maxWidth, C.push(D))) : u--;
  12917. var B = B - l * (u - 1),
  12918. B = 0 < B ? B : 0,
  12919. F = m - E - l * (u - 1),
  12920. G, H = u,
  12921. I = [];
  12922. if (p) {
  12923. if (0 > F) {
  12924. G = B / u;
  12925. for (z = 0; z < A; z++)(t = this.target.getElementAt(z)) && t.includeInLayout && (t = t.preferredWidth, t <= G && (B -= t, H--));
  12926. B = 0 < B ? B : 0
  12927. }
  12928. } else if (0 < v) {
  12929. d.flexChildrenProportionally(m, B, v, C);
  12930. m = 0;
  12931. t = C.length;
  12932. for (z = 0; z < t; z++) D = C[z], v = Math.round(D.size + m), m += D.size - v, I[D.layoutElement.hashCode] = v, B -= v;
  12933. B = 0 < B ? B : 0
  12934. }
  12935. this._horizontalAlign == c.HorizontalAlign.CENTER ? y = g + 0.5 * B : this._horizontalAlign == c.HorizontalAlign.RIGHT && (y = g + B);
  12936. C = k;
  12937. t = u = 0;
  12938. D = Math.ceil(n);
  12939. this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY && (D = Math.ceil(Math.max(n, this.maxElementHeight)));
  12940. for (z = m = 0; z < A; z++) v = 0, (t = this.target.getElementAt(z)) && t.includeInLayout && (u = NaN, p ? (v = NaN, 0 < F ? v = B * t.preferredWidth / E : 0 > F && t.preferredWidth > G && (v = B / H), isNaN(v) || (u = Math.round(v + m), m += v - u)) : u = I[t.hashCode], r ? (v = k, t.setLayoutBoundsSize(u, D)) : (v = NaN, isNaN(t.percentHeight) || (v = Math.min(100, t.percentHeight), v = Math.round(n * v * 0.01)), t.setLayoutBoundsSize(u, v), v = (n - t.layoutBoundsHeight) * w, v = 0 < v ? v : 0, v = k + v), t.setLayoutBoundsPosition(Math.round(y), Math.round(v)), u = Math.ceil(t.layoutBoundsWidth), t = Math.ceil(t.layoutBoundsHeight), g = Math.max(g, y + u), C = Math.max(C, v + t), y += u + l);
  12941. this.target.setContentSize(Math.ceil(g + h), Math.ceil(C + f))
  12942. };
  12943. d.flexChildrenProportionally = function(a, b, d, c) {
  12944. var e = c.length,
  12945. f;
  12946. do {
  12947. f = !0;
  12948. var l = b - a * d / 100;
  12949. 0 < l ? b -= l : l = 0;
  12950. for (var m = b / d, n = 0; n < e; n++) {
  12951. var p = c[n],
  12952. r = p.percent * m;
  12953. if (r < p.min) {
  12954. f = p.min;
  12955. p.size = f;
  12956. c[n] = c[--e];
  12957. c[e] = p;
  12958. d -= p.percent;
  12959. l >= f || (b -= f - l);
  12960. f = !1;
  12961. break
  12962. } else if (r > p.max) {
  12963. f = p.max;
  12964. p.size = f;
  12965. c[n] = c[--e];
  12966. c[e] = p;
  12967. d -= p.percent;
  12968. l >= f || (b -= f - l);
  12969. f = !1;
  12970. break
  12971. } else p.size = r
  12972. }
  12973. } while (!f)
  12974. };
  12975. return d
  12976. }(e.LayoutBase);
  12977. e.HorizontalLayout = f;
  12978. f.prototype.__class__ = "egret.gui.HorizontalLayout";
  12979. var b = function() {
  12980. return function() {
  12981. this.size = 0
  12982. }
  12983. }();
  12984. b.prototype.__class__ = "egret.gui.ChildInfo"
  12985. })(c.gui || (c.gui = {}))
  12986. })(egret || (egret = {}));
  12987. (function(c) {
  12988. (function(c) {
  12989. var f = function() {
  12990. function b(a, b, c) {
  12991. this.raw_getElementAt = "raw_getElementAt";
  12992. this.raw_addElementAt = "raw_addElementAt";
  12993. this.raw_getElementIndex = "raw_getElementIndex";
  12994. this.raw_removeElement = "raw_removeElement";
  12995. this.raw_removeElementAt = "raw_removeElementAt";
  12996. this.raw_setElementIndex = "raw_setElementIndex";
  12997. this.owner = a;
  12998. this.lowerBoundReference = b;
  12999. this.upperBoundReference = c
  13000. }
  13001. Object.defineProperty(b.prototype, "numElements", {
  13002. get: function() {
  13003. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  13004. },
  13005. enumerable: !0,
  13006. configurable: !0
  13007. });
  13008. b.prototype.getElementAt = function(a) {
  13009. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  13010. };
  13011. b.prototype.addElement = function(a) {
  13012. var b = this.owner[this.upperBoundReference];
  13013. a.parent === this.owner && b--;
  13014. this.owner[this.upperBoundReference]++;
  13015. this.owner[this.raw_addElementAt](a, b);
  13016. a.ownerChanged(this);
  13017. return a
  13018. };
  13019. b.prototype.addElementAt = function(a, b) {
  13020. this.owner[this.upperBoundReference]++;
  13021. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] + b);
  13022. a.ownerChanged(this);
  13023. return a
  13024. };
  13025. b.prototype.removeElement = function(a) {
  13026. var b = this.owner[this.raw_getElementIndex](a);
  13027. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  13028. a.ownerChanged(null);
  13029. return a
  13030. };
  13031. b.prototype.removeElementAt = function(a) {
  13032. a += this.owner[this.lowerBoundReference];
  13033. var b;
  13034. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a), this.owner[this.upperBoundReference]--);
  13035. b.ownerChanged(null);
  13036. return b
  13037. };
  13038. b.prototype.getElementIndex = function(a) {
  13039. a = this.owner[this.raw_getElementIndex](a);
  13040. return a -= this.owner[this.lowerBoundReference]
  13041. };
  13042. b.prototype.setElementIndex = function(a, b) {
  13043. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  13044. };
  13045. return b
  13046. }();
  13047. c.UILayer = f;
  13048. f.prototype.__class__ = "egret.gui.UILayer"
  13049. })(c.gui || (c.gui = {}))
  13050. })(egret || (egret = {}));
  13051. __extends = this.__extends || function(c, e) {
  13052. function f() {
  13053. this.constructor = c
  13054. }
  13055. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  13056. f.prototype = e.prototype;
  13057. c.prototype = new f
  13058. };
  13059. (function(c) {
  13060. (function(e) {
  13061. var f = function(b) {
  13062. function a() {
  13063. b.call(this);
  13064. this._autoResize = !0;
  13065. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  13066. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  13067. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  13068. }
  13069. __extends(a, b);
  13070. a.prototype.onAddToStage = function(a) {
  13071. if (e.UIGlobals._uiStage) throw Error("UIStage是GUI根容器,只能有一个此实例在显示列表中!");
  13072. e.UIGlobals._uiStage = this;
  13073. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  13074. };
  13075. a.prototype.onRemoveFromStage = function(a) {
  13076. e.UIGlobals._uiStage = null;
  13077. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  13078. };
  13079. a.prototype.onResize = function(a) {
  13080. this._setWidth(this.stage.stageWidth);
  13081. this._setHeight(this.stage.stageHeight)
  13082. };
  13083. Object.defineProperty(a.prototype, "autoResize", {
  13084. get: function() {
  13085. return this._autoResize
  13086. },
  13087. set: function(a) {
  13088. this._autoResize != a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)))
  13089. },
  13090. enumerable: !0,
  13091. configurable: !0
  13092. });
  13093. Object.defineProperty(a.prototype, "x", {
  13094. get: function() {
  13095. return this._x
  13096. },
  13097. set: function(a) {
  13098. this._autoResize || (this._x = a)
  13099. },
  13100. enumerable: !0,
  13101. configurable: !0
  13102. });
  13103. Object.defineProperty(a.prototype, "y", {
  13104. get: function() {
  13105. return this._y
  13106. },
  13107. set: function(a) {
  13108. this._autoResize || (this._y = a)
  13109. },
  13110. enumerable: !0,
  13111. configurable: !0
  13112. });
  13113. Object.defineProperty(a.prototype, "width", {
  13114. get: function() {
  13115. return this._width
  13116. },
  13117. set: function(a) {
  13118. this._autoResize || this._setWidth(a)
  13119. },
  13120. enumerable: !0,
  13121. configurable: !0
  13122. });
  13123. Object.defineProperty(a.prototype, "height", {
  13124. get: function() {
  13125. return this._height
  13126. },
  13127. set: function(a) {
  13128. this._autoResize || this._setHeight(a)
  13129. },
  13130. enumerable: !0,
  13131. configurable: !0
  13132. });
  13133. Object.defineProperty(a.prototype, "scaleX", {
  13134. get: function() {
  13135. return this._scaleX
  13136. },
  13137. set: function(a) {
  13138. this._autoResize || this._setScaleX(a)
  13139. },
  13140. enumerable: !0,
  13141. configurable: !0
  13142. });
  13143. Object.defineProperty(a.prototype, "scaleY", {
  13144. get: function() {
  13145. return this._scaleY
  13146. },
  13147. set: function(a) {
  13148. this._autoResize || this._setScaleY(a)
  13149. },
  13150. enumerable: !0,
  13151. configurable: !0
  13152. });
  13153. a.prototype.setActualSize = function(a, c) {
  13154. this._autoResize || b.prototype.setActualSize.call(this, a, c)
  13155. };
  13156. a.prototype.setLayoutBoundsPosition = function(a, c) {
  13157. this._autoResize || b.prototype.setLayoutBoundsPosition.call(this, a, c)
  13158. };
  13159. a.prototype.setLayoutBoundsSize = function(a, c) {
  13160. this._autoResize || b.prototype.setLayoutBoundsSize.call(this, a, c)
  13161. };
  13162. Object.defineProperty(a.prototype, "layout", {
  13163. get: function() {
  13164. return this._layout
  13165. },
  13166. set: function(a) {
  13167. a instanceof e.BasicLayout && this._setLayout(a)
  13168. },
  13169. enumerable: !0,
  13170. configurable: !0
  13171. });
  13172. Object.defineProperty(a.prototype, "popUpContainer", {
  13173. get: function() {
  13174. this._popUpContainer || (this._popUpContainer = new e.UILayer(this, "noTopMostIndex", "topMostIndex"));
  13175. return this._popUpContainer
  13176. },
  13177. enumerable: !0,
  13178. configurable: !0
  13179. });
  13180. Object.defineProperty(a.prototype, "toolTipContainer", {
  13181. get: function() {
  13182. this._toolTipContainer || (this._toolTipContainer = new e.UILayer(this, "topMostIndex", "toolTipIndex"));
  13183. return this._toolTipContainer
  13184. },
  13185. enumerable: !0,
  13186. configurable: !0
  13187. });
  13188. Object.defineProperty(a.prototype, "cursorContainer", {
  13189. get: function() {
  13190. this._cursorContainer || (this._cursorContainer = new e.UILayer(this, "toolTipIndex", "cursorIndex"));
  13191. return this._cursorContainer
  13192. },
  13193. enumerable: !0,
  13194. configurable: !0
  13195. });
  13196. Object.defineProperty(a.prototype, "noTopMostIndex", {
  13197. get: function() {
  13198. return this._noTopMostIndex
  13199. },
  13200. set: function(a) {
  13201. var b = a - this._noTopMostIndex;
  13202. this._noTopMostIndex = a;
  13203. this.topMostIndex += b
  13204. },
  13205. enumerable: !0,
  13206. configurable: !0
  13207. });
  13208. Object.defineProperty(a.prototype, "topMostIndex", {
  13209. get: function() {
  13210. return this._topMostIndex
  13211. },
  13212. set: function(a) {
  13213. var b = a - this._topMostIndex;
  13214. this._topMostIndex = a;
  13215. this.toolTipIndex += b
  13216. },
  13217. enumerable: !0,
  13218. configurable: !0
  13219. });
  13220. Object.defineProperty(a.prototype, "toolTipIndex", {
  13221. get: function() {
  13222. return this._toolTipIndex
  13223. },
  13224. set: function(a) {
  13225. var b = a - this._toolTipIndex;
  13226. this._toolTipIndex = a;
  13227. this.cursorIndex += b
  13228. },
  13229. enumerable: !0,
  13230. configurable: !0
  13231. });
  13232. Object.defineProperty(a.prototype, "cursorIndex", {
  13233. get: function() {
  13234. return this._cursorIndex
  13235. },
  13236. set: function(a) {
  13237. this._cursorIndex = a
  13238. },
  13239. enumerable: !0,
  13240. configurable: !0
  13241. });
  13242. a.prototype.addElement = function(a) {
  13243. var b = this._noTopMostIndex;
  13244. a.parent == this && b--;
  13245. return this.addElementAt(a, b)
  13246. };
  13247. a.prototype.addElementAt = function(a, c) {
  13248. if (a.parent == this) {
  13249. var e = this.getElementIndex(a);
  13250. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  13251. }
  13252. c <= this._noTopMostIndex ? this.noTopMostIndex++ : c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++ : c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++ : this.cursorIndex++;
  13253. return b.prototype.addElementAt.call(this, a, c)
  13254. };
  13255. a.prototype.removeElement = function(a) {
  13256. return this.removeElementAt(b.prototype.getElementIndex.call(this, a))
  13257. };
  13258. a.prototype.removeElementAt = function(a) {
  13259. var c = b.prototype.removeElementAt.call(this, a);
  13260. a < this._noTopMostIndex ? this.noTopMostIndex-- : a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex-- : a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--;
  13261. return c
  13262. };
  13263. a.prototype.removeAllElements = function() {
  13264. for (; 0 < this._noTopMostIndex;) b.prototype.removeElementAt.call(this, 0), this.noTopMostIndex--
  13265. };
  13266. a.prototype._elementRemoved = function(a, e, f) {
  13267. void 0 === f && (f = !0);
  13268. f && c.Event.dispatchEvent(a, "removeFromUIStage");
  13269. b.prototype._elementRemoved.call(this, a, e, f)
  13270. };
  13271. a.prototype.raw_getElementAt = function(a) {
  13272. return b.prototype.getElementAt.call(this, a)
  13273. };
  13274. a.prototype.raw_addElement = function(a) {
  13275. var b = this.numElements;
  13276. a.parent == this && b--;
  13277. return this.raw_addElementAt(a, b)
  13278. };
  13279. a.prototype.raw_addElementAt = function(a, c) {
  13280. if (a.parent == this) {
  13281. var e = this.getElementIndex(a);
  13282. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  13283. }
  13284. return b.prototype.addElementAt.call(this, a, c)
  13285. };
  13286. a.prototype.raw_removeElement = function(a) {
  13287. return b.prototype.removeElementAt.call(this, b.prototype.getElementIndex.call(this, a))
  13288. };
  13289. a.prototype.raw_removeElementAt = function(a) {
  13290. return b.prototype.removeElementAt.call(this, a)
  13291. };
  13292. a.prototype.raw_removeAllElements = function() {
  13293. for (; 0 < this.numElements;) b.prototype.removeElementAt.call(this, 0)
  13294. };
  13295. a.prototype.raw_getElementIndex = function(a) {
  13296. return b.prototype.getElementIndex.call(this, a)
  13297. };
  13298. a.prototype.raw_setElementIndex = function(a, c) {
  13299. b.prototype.setElementIndex.call(this, a, c)
  13300. };
  13301. a.prototype.raw_swapElements = function(a, c) {
  13302. b.prototype.swapElementsAt.call(this, b.prototype.getElementIndex.call(this, a), b.prototype.getElementIndex.call(this, c))
  13303. };
  13304. a.prototype.raw_swapElementsAt = function(a, c) {
  13305. b.prototype.swapElementsAt.call(this, a, c)
  13306. };
  13307. return a
  13308. }(e.Group);
  13309. e.UIStage = f;
  13310. f.prototype.__class__ = "egret.gui.UIStage"
  13311. })(c.gui || (c.gui = {}))
  13312. })(egret || (egret = {}));
  13313. __extends = this.__extends || function(c, e) {
  13314. function f() {
  13315. this.constructor = c
  13316. }
  13317. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  13318. f.prototype = e.prototype;
  13319. c.prototype = new f
  13320. };
  13321. (function(c) {
  13322. (function(e) {
  13323. var f = function(a) {
  13324. function d() {
  13325. a.call(this);
  13326. this._popUpList = [];
  13327. this.popUpDataList = [];
  13328. this._modalColor = 0;
  13329. this._modalAlpha = 0.5;
  13330. this.invalidateModalFlag = !1
  13331. }
  13332. __extends(d, a);
  13333. Object.defineProperty(d.prototype, "popUpList", {
  13334. get: function() {
  13335. return this._popUpList.concat()
  13336. },
  13337. enumerable: !0,
  13338. configurable: !0
  13339. });
  13340. d.prototype.findPopUpData = function(a) {
  13341. for (var b = this.popUpDataList, d = b.length, c = 0; c < d; c++) {
  13342. var e = b[c];
  13343. if (e.popUp == a) return e
  13344. }
  13345. return null
  13346. };
  13347. d.prototype.addPopUp = function(a, c, f) {
  13348. void 0 === c && (c = !1);
  13349. void 0 === f && (f = !0);
  13350. var g = e.UIGlobals.uiStage,
  13351. h = this.findPopUpData(a);
  13352. h ? (h.modal = c, a.removeEventListener(d.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (h = new b(a, c), this.popUpDataList.push(h), this._popUpList.push(a));
  13353. g.popUpContainer.addElement(a);
  13354. f && this.centerPopUp(a);
  13355. "isPopUp" in a && (a.isPopUp = !0);
  13356. c && this.invalidateModal();
  13357. a.addEventListener(d.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  13358. };
  13359. d.prototype.onRemoved = function(a) {
  13360. for (var b = 0, c = this.popUpDataList, e = c.length, f = 0; f < e; f++) {
  13361. var k = c[f];
  13362. if (k.popUp == a.target) {
  13363. "isPopUp" in k.popUp && (k.popUp.isPopUp = !1);
  13364. k.popUp.removeEventListener(d.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  13365. this.popUpDataList.splice(b, 1);
  13366. this._popUpList.splice(b, 1);
  13367. this.invalidateModal();
  13368. break
  13369. }
  13370. b++
  13371. }
  13372. };
  13373. Object.defineProperty(d.prototype, "modalColor", {
  13374. get: function() {
  13375. return this._modalColor
  13376. },
  13377. set: function(a) {
  13378. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  13379. },
  13380. enumerable: !0,
  13381. configurable: !0
  13382. });
  13383. Object.defineProperty(d.prototype, "modalAlpha", {
  13384. get: function() {
  13385. return this._modalAlpha
  13386. },
  13387. set: function(a) {
  13388. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  13389. },
  13390. enumerable: !0,
  13391. configurable: !0
  13392. });
  13393. d.prototype.invalidateModal = function() {
  13394. this.invalidateModalFlag || (this.invalidateModalFlag = !0, e.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.validateModal, this), e.UIGlobals.stage.addEventListener(c.Event.RENDER, this.validateModal, this), e.UIGlobals.stage.invalidate())
  13395. };
  13396. d.prototype.validateModal = function(a) {
  13397. this.invalidateModalFlag = !1;
  13398. e.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.validateModal, this);
  13399. e.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  13400. this.updateModal(e.UIGlobals.uiStage)
  13401. };
  13402. d.prototype.updateModal = function(a) {
  13403. for (var b = a.popUpContainer, d = !1, c = b.numElements - 1; 0 <= c; c--) {
  13404. var f = b.getElementAt(c);
  13405. if ((f = this.findPopUpData(f)) && f.modal) {
  13406. d = !0;
  13407. break
  13408. }
  13409. }
  13410. d ? (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, this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < c && c--, b.setElementIndex(this.modalMask, c)) : b.addElementAt(this.modalMask, c)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  13411. };
  13412. d.prototype.removePopUp = function(a) {
  13413. 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 c.DisplayObject && a.parent.removeChild(a))
  13414. };
  13415. d.prototype.centerPopUp = function(a) {
  13416. a.top = a.bottom = a.left = a.right = NaN;
  13417. a.verticalCenter = a.horizontalCenter = 0;
  13418. var b = a.parent;
  13419. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  13420. };
  13421. d.prototype.bringToFront = function(a) {
  13422. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  13423. var b = a.parent;
  13424. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  13425. this.invalidateModal()
  13426. }
  13427. };
  13428. d.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  13429. return d
  13430. }(c.EventDispatcher);
  13431. e.PopUpManagerImpl = f;
  13432. f.prototype.__class__ = "egret.gui.PopUpManagerImpl";
  13433. var b = function() {
  13434. return function(a, b) {
  13435. this.popUp = a;
  13436. this.modal = b
  13437. }
  13438. }();
  13439. b.prototype.__class__ = "egret.gui.PopUpData"
  13440. })(c.gui || (c.gui = {}))
  13441. })(egret || (egret = {}));
  13442. (function(c) {
  13443. (function(e) {
  13444. var f = function() {
  13445. function b() {}
  13446. b.getImpl = function() {
  13447. if (!b._impl) try {
  13448. b._impl = c.Injector.getInstance("egret.gui.IPopUpManager")
  13449. } catch (a) {
  13450. b._impl = new e.PopUpManagerImpl
  13451. }
  13452. return b._impl
  13453. };
  13454. Object.defineProperty(b.prototype, "modalColor", {
  13455. get: function() {
  13456. return b.getImpl().modalColor
  13457. },
  13458. set: function(a) {
  13459. b.getImpl().modalColor = a
  13460. },
  13461. enumerable: !0,
  13462. configurable: !0
  13463. });
  13464. Object.defineProperty(b.prototype, "modalAlpha", {
  13465. get: function() {
  13466. return b.getImpl().modalAlpha
  13467. },
  13468. set: function(a) {
  13469. b.getImpl().modalAlpha = a
  13470. },
  13471. enumerable: !0,
  13472. configurable: !0
  13473. });
  13474. b.addPopUp = function(a, d, c) {
  13475. void 0 === d && (d = !1);
  13476. void 0 === c && (c = !0);
  13477. b.getImpl().addPopUp(a, d, c);
  13478. e.PopUpEvent.dispatchPopUpEvent(b.getImpl(), e.PopUpEvent.ADD_POPUP, a, d)
  13479. };
  13480. b.removePopUp = function(a) {
  13481. b.getImpl().removePopUp(a);
  13482. e.PopUpEvent.dispatchPopUpEvent(b.getImpl(), e.PopUpEvent.REMOVE_POPUP, a)
  13483. };
  13484. b.centerPopUp = function(a) {
  13485. b.getImpl().centerPopUp(a)
  13486. };
  13487. b.bringToFront = function(a) {
  13488. b.getImpl().bringToFront(a);
  13489. e.PopUpEvent.dispatchPopUpEvent(b.getImpl(), e.PopUpEvent.BRING_TO_FRONT, a)
  13490. };
  13491. Object.defineProperty(b, "popUpList", {
  13492. get: function() {
  13493. return b.getImpl().popUpList
  13494. },
  13495. enumerable: !0,
  13496. configurable: !0
  13497. });
  13498. b.addEventListener = function(a, d, c, e, f) {
  13499. void 0 === e && (e = !1);
  13500. void 0 === f && (f = 0);
  13501. b.getImpl().addEventListener(a, d, this, e, f)
  13502. };
  13503. b.removeEventListener = function(a, d, c, e) {
  13504. void 0 === e && (e = !1);
  13505. b.getImpl().removeEventListener(a, d, c, e)
  13506. };
  13507. return b
  13508. }();
  13509. e.PopUpManager = f;
  13510. f.prototype.__class__ = "egret.gui.PopUpManager"
  13511. })(c.gui || (c.gui = {}))
  13512. })(egret || (egret = {}));
  13513. __extends = this.__extends || function(c, e) {
  13514. function f() {
  13515. this.constructor = c
  13516. }
  13517. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  13518. f.prototype = e.prototype;
  13519. c.prototype = new f
  13520. };
  13521. (function(c) {
  13522. var e = function(e) {
  13523. function b(a) {
  13524. void 0 === a && (a = 60);
  13525. e.call(this);
  13526. this.frameRate = a;
  13527. this._time = 0;
  13528. this._isActivate = !0;
  13529. 60 == a && (b.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, b.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  13530. b.requestAnimationFrame || (b.requestAnimationFrame = function(b) {
  13531. return window.setTimeout(b, 1E3 / a)
  13532. });
  13533. b.cancelAnimationFrame || (b.cancelAnimationFrame = function(a) {
  13534. return window.clearTimeout(a)
  13535. });
  13536. b.instance = this;
  13537. this.registerListener()
  13538. }
  13539. __extends(b, e);
  13540. b.prototype.enterFrame = function() {
  13541. var a = b.instance,
  13542. d = b._thisObject,
  13543. e = b._callback,
  13544. f = c.getTimer(),
  13545. q = f - a._time;
  13546. a._requestAnimationId = b.requestAnimationFrame.call(window, b.prototype.enterFrame);
  13547. e.call(d, q);
  13548. a._time = f
  13549. };
  13550. b.prototype.executeMainLoop = function(a, d) {
  13551. b._callback = a;
  13552. b._thisObject = d;
  13553. this.enterFrame()
  13554. };
  13555. b.prototype.reset = function() {
  13556. var a = b.instance;
  13557. a._requestAnimationId && (a._time = c.getTimer(), b.cancelAnimationFrame.call(window, a._requestAnimationId), a.enterFrame())
  13558. };
  13559. b.prototype.registerListener = function() {
  13560. var a = this,
  13561. d = function() {
  13562. a._isActivate && (a._isActivate = !1, c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.DEACTIVATE)))
  13563. },
  13564. e = function() {
  13565. a._isActivate || (a._isActivate = !0, b.instance.reset(), c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.ACTIVATE)))
  13566. }, f = function() {
  13567. document[q] ? d() : e()
  13568. };
  13569. window.addEventListener("focus", e, !1);
  13570. window.addEventListener("blur", d, !1);
  13571. var q, g;
  13572. "undefined" !== typeof document.hidden ? (q = "hidden", g = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (q = "mozHidden", g = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (q = "msHidden", g = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (q = "webkitHidden", g = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (q = "oHidden", g = "ovisibilitychange");
  13573. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", d, !1));
  13574. q && g && document.addEventListener(g, f, !1)
  13575. };
  13576. return b
  13577. }(c.DeviceContext);
  13578. c.HTML5DeviceContext = e;
  13579. e.prototype.__class__ = "egret.HTML5DeviceContext"
  13580. })(egret || (egret = {}));
  13581. var egret_html5_localStorage;
  13582. (function(c) {
  13583. c.getItem = function(c) {
  13584. return window.localStorage.getItem(c)
  13585. };
  13586. c.setItem = function(c, f) {
  13587. try {
  13588. return window.localStorage.setItem(c, f), !0
  13589. } catch (b) {
  13590. return console.log("egret_html5_localStorage.setItem保存失败,key=" + c + "&value=" + f), !1
  13591. }
  13592. };
  13593. c.removeItem = function(c) {
  13594. window.localStorage.removeItem(c)
  13595. };
  13596. c.clear = function() {
  13597. window.localStorage.clear()
  13598. };
  13599. c.init = function() {
  13600. for (var e in c) egret.localStorage[e] = c[e]
  13601. }
  13602. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  13603. egret_html5_localStorage.init();
  13604. __extends = this.__extends || function(c, e) {
  13605. function f() {
  13606. this.constructor = c
  13607. }
  13608. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  13609. f.prototype = e.prototype;
  13610. c.prototype = new f
  13611. };
  13612. (function(c) {
  13613. var e = function(e) {
  13614. function b(a) {
  13615. e.call(this);
  13616. this.globalAlpha = 1;
  13617. this.canvas = a || this.createCanvas();
  13618. this.canvasContext = this.canvas.getContext("2d");
  13619. this._cacheCanvas = document.createElement("canvas");
  13620. this._cacheCanvas.width = this.canvas.width;
  13621. this._cacheCanvas.height = this.canvas.height;
  13622. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  13623. this.onResize();
  13624. var b = this.canvasContext.setTransform,
  13625. c = this;
  13626. this._cacheCanvasContext.setTransform = function(a, e, f, h, k, l) {
  13627. c._matrixA = a;
  13628. c._matrixB = e;
  13629. c._matrixC = f;
  13630. c._matrixD = h;
  13631. c._matrixTx = k;
  13632. c._matrixTy = l;
  13633. b.call(c._cacheCanvasContext, a, e, f, h, k, l)
  13634. };
  13635. this._matrixA = 1;
  13636. this._matrixC = this._matrixB = 0;
  13637. this._matrixD = 1;
  13638. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  13639. this.initBlendMode()
  13640. }
  13641. __extends(b, e);
  13642. b.prototype.createCanvas = function() {
  13643. var a = c.Browser.getInstance().$("#egretCanvas");
  13644. if (!a) {
  13645. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  13646. a = c.Browser.getInstance().$new("canvas");
  13647. a.id = "egretCanvas";
  13648. b.appendChild(a)
  13649. }
  13650. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
  13651. return a
  13652. };
  13653. b.prototype.onResize = function() {
  13654. if (this.canvas) {
  13655. var a = document.getElementById(c.StageDelegate.canvas_div_name);
  13656. this.canvas.width = c.MainContext.instance.stage.stageWidth;
  13657. this.canvas.height = c.MainContext.instance.stage.stageHeight;
  13658. this.canvas.style.width = a.style.width;
  13659. this.canvas.style.height = a.style.height;
  13660. this._cacheCanvas.width = this.canvas.width;
  13661. this._cacheCanvas.height = this.canvas.height;
  13662. this._cacheCanvasContext.imageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  13663. this._cacheCanvasContext.webkitImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  13664. this._cacheCanvasContext.mozImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled;
  13665. this._cacheCanvasContext.msImageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled
  13666. }
  13667. };
  13668. b.prototype.clearScreen = function() {
  13669. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, e = a.length; b < e; b++) {
  13670. var f = a[b];
  13671. this.clearRect(f.x, f.y, f.width, f.height)
  13672. }
  13673. a = c.MainContext.instance.stage;
  13674. this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  13675. this.renderCost = 0
  13676. };
  13677. b.prototype.clearRect = function(a, b, c, e) {
  13678. this.canvasContext.clearRect(a, b, c, e)
  13679. };
  13680. b.prototype.drawImage = function(a, b, s, x, q, g, h, k, l, m) {
  13681. void 0 === m && (m = void 0);
  13682. var n = a._bitmapData;
  13683. g += this._transformTx;
  13684. h += this._transformTy;
  13685. var p = c.getTimer();
  13686. void 0 === m ? this._cacheCanvasContext.drawImage(n, b, s, x, q, g, h, k, l) : this.drawRepeatImage(a, b, s, x, q, g, h, k, l, m);
  13687. e.prototype.drawImage.call(this, a, b, s, x, q, g, h, k, l, m);
  13688. this.renderCost += c.getTimer() - p
  13689. };
  13690. b.prototype.drawRepeatImage = function(a, b, e, f, q, g, h, k, l, m) {
  13691. if (void 0 === a.pattern) {
  13692. var n = c.MainContext.instance.rendererContext.texture_scale_factor,
  13693. p = a._bitmapData,
  13694. r = p;
  13695. if (p.width != f || p.height != q || 1 != n) r = document.createElement("canvas"), r.width = f * n, r.height = q * n, r.getContext("2d").drawImage(p, b, e, f, q, 0, 0, f * n, q * n);
  13696. b = this._cacheCanvasContext.createPattern(r, m);
  13697. a.pattern = b
  13698. }
  13699. this._cacheCanvasContext.fillStyle = a.pattern;
  13700. this._cacheCanvasContext.translate(g, h);
  13701. this._cacheCanvasContext.fillRect(0, 0, k, l);
  13702. this._cacheCanvasContext.translate(-g, -h)
  13703. };
  13704. b.prototype.setTransform = function(a) {
  13705. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this._cacheCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  13706. };
  13707. b.prototype.setAlpha = function(a, b) {
  13708. a != this.globalAlpha && (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  13709. b ? (this.blendValue = this.blendModes[b], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = this.blendModes[c.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  13710. };
  13711. b.prototype.initBlendMode = function() {
  13712. this.blendModes = {};
  13713. this.blendModes[c.BlendMode.NORMAL] = "source-over";
  13714. this.blendModes[c.BlendMode.ADD] = "lighter"
  13715. };
  13716. b.prototype.setupFont = function(a, b) {
  13717. void 0 === b && (b = null);
  13718. b = b || {};
  13719. var c = null == b.size ? a._size : b.size,
  13720. e = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  13721. f = this._cacheCanvasContext,
  13722. g = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  13723. g = g + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  13724. f.font = g + (c + "px " + e);
  13725. f.textAlign = "left";
  13726. f.textBaseline = "middle"
  13727. };
  13728. b.prototype.measureText = function(a) {
  13729. return this._cacheCanvasContext.measureText(a).width
  13730. };
  13731. b.prototype.drawText = function(a, b, s, x, q, g) {
  13732. void 0 === g && (g = null);
  13733. this.setupFont(a, g);
  13734. g = g || {};
  13735. var h;
  13736. h = null != g.textColor ? c.toColorString(g.textColor) : a._textColorString;
  13737. var k;
  13738. k = null != g.strokeColor ? c.toColorString(g.strokeColor) : a._strokeColorString;
  13739. var l;
  13740. l = null != g.stroke ? g.stroke : a._stroke;
  13741. var m = this._cacheCanvasContext;
  13742. m.fillStyle = h;
  13743. m.strokeStyle = k;
  13744. l && (m.lineWidth = 2 * l, m.strokeText(b, s + this._transformTx, x + this._transformTy, q || 65535));
  13745. m.fillText(b, s + this._transformTx, x + this._transformTy, q || 65535);
  13746. e.prototype.drawText.call(this, a, b, s, x, q, g)
  13747. };
  13748. b.prototype.strokeRect = function(a, b, c, e, f) {
  13749. this._cacheCanvasContext.strokeStyle = f;
  13750. this._cacheCanvasContext.strokeRect(a, b, c, e)
  13751. };
  13752. b.prototype.pushMask = function(a) {
  13753. this._cacheCanvasContext.save();
  13754. this._cacheCanvasContext.beginPath();
  13755. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  13756. this._cacheCanvasContext.clip();
  13757. this._cacheCanvasContext.closePath()
  13758. };
  13759. b.prototype.popMask = function() {
  13760. this._cacheCanvasContext.restore();
  13761. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  13762. };
  13763. b.prototype.onRenderStart = function() {
  13764. this._cacheCanvasContext.save()
  13765. };
  13766. b.prototype.onRenderFinish = function() {
  13767. this._cacheCanvasContext.restore();
  13768. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  13769. for (var a = this._cacheCanvas.width, b = this._cacheCanvas.height, e = c.RenderFilter.getInstance().getDrawAreaList(), f = 0, q = e.length; f < q; f++) {
  13770. var g = e[f],
  13771. h = g.x,
  13772. k = g.y,
  13773. l = g.width,
  13774. g = g.height;
  13775. h + l > a && (l = a - h);
  13776. k + g > b && (g = b - k);
  13777. 0 < l && 0 < g && this.canvasContext.drawImage(this._cacheCanvas, h, k, l, g, h, k, l, g)
  13778. }
  13779. };
  13780. return b
  13781. }(c.RendererContext);
  13782. c.HTML5CanvasRenderer = e;
  13783. e.prototype.__class__ = "egret.HTML5CanvasRenderer"
  13784. })(egret || (egret = {}));
  13785. var egret_h5_graphics;
  13786. (function(c) {
  13787. c.beginFill = function(c, b) {
  13788. void 0 === b && (b = 1);
  13789. var a = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + b + ")";
  13790. this.fillStyleColor = a;
  13791. this.commandQueue.push(new e(this._setStyle, this, [a]))
  13792. };
  13793. c.drawRect = function(c, b, a, d) {
  13794. this.commandQueue.push(new e(function(a, b, d, c) {
  13795. var e = this.renderContext;
  13796. this.canvasContext.beginPath();
  13797. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, d, c);
  13798. this.canvasContext.closePath()
  13799. }, this, [c, b, a, d]));
  13800. this._fill()
  13801. };
  13802. c.drawCircle = function(c, b, a) {
  13803. this.commandQueue.push(new e(function(a, b, c) {
  13804. var e = this.renderContext;
  13805. this.canvasContext.beginPath();
  13806. this.canvasContext.arc(e._transformTx + a, e._transformTy + b, c, 0, 2 * Math.PI);
  13807. this.canvasContext.closePath()
  13808. }, this, [c, b, a]));
  13809. this._fill()
  13810. };
  13811. c.drawRoundRect = function(c, b, a, d, s, x) {
  13812. this.commandQueue.push(new e(function(a, b, d, c, e, f) {
  13813. var s = this.renderContext;
  13814. a = s._transformTx + a;
  13815. b = s._transformTy + b;
  13816. e /= 2;
  13817. f = f ? f / 2 : e;
  13818. d = a + d;
  13819. c = b + c;
  13820. s = c - f;
  13821. this.canvasContext.beginPath();
  13822. this.canvasContext.moveTo(d, s);
  13823. this.canvasContext.quadraticCurveTo(d, c, d - e, c);
  13824. this.canvasContext.lineTo(a + e, c);
  13825. this.canvasContext.quadraticCurveTo(a, c, a, c - f);
  13826. this.canvasContext.lineTo(a, b + f);
  13827. this.canvasContext.quadraticCurveTo(a, b, a + e, b);
  13828. this.canvasContext.lineTo(d - e, b);
  13829. this.canvasContext.quadraticCurveTo(d, b, d, b + f);
  13830. this.canvasContext.lineTo(d, s);
  13831. this.canvasContext.closePath()
  13832. }, this, [c, b, a, d, s, x]));
  13833. this._fill()
  13834. };
  13835. c.drawEllipse = function(c, b, a, d) {
  13836. this.commandQueue.push(new e(function(a, b, d, c) {
  13837. var e = this.renderContext;
  13838. this.canvasContext.save();
  13839. a = e._transformTx + a;
  13840. b = e._transformTy + b;
  13841. var e = d > c ? d : c,
  13842. f = d / e;
  13843. c /= e;
  13844. this.canvasContext.scale(f, c);
  13845. this.canvasContext.beginPath();
  13846. this.canvasContext.moveTo((a + d) / f, b / c);
  13847. this.canvasContext.arc(a / f, b / c, e, 0, 2 * Math.PI);
  13848. this.canvasContext.closePath();
  13849. this.canvasContext.restore();
  13850. this.canvasContext.stroke()
  13851. }, this, [c, b, a, d]));
  13852. this._fill()
  13853. };
  13854. c.lineStyle = function(c, b, a, d, s, x, q, g) {
  13855. void 0 === c && (c = NaN);
  13856. void 0 === b && (b = 0);
  13857. void 0 === a && (a = 1);
  13858. void 0 === d && (d = !1);
  13859. void 0 === s && (s = "normal");
  13860. void 0 === x && (x = null);
  13861. void 0 === q && (q = null);
  13862. void 0 === g && (g = 3);
  13863. this.strokeStyleColor && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  13864. this.strokeStyleColor = b = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  13865. this.commandQueue.push(new e(function(a, b) {
  13866. this.canvasContext.lineWidth = a;
  13867. this.canvasContext.strokeStyle = b;
  13868. this.canvasContext.beginPath()
  13869. }, this, [c, b]));
  13870. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  13871. this.moveTo(this.lineX, this.lineY)
  13872. };
  13873. c.lineTo = function(c, b) {
  13874. this.commandQueue.push(new e(function(a, b) {
  13875. var c = this.renderContext;
  13876. this.canvasContext.lineTo(c._transformTx + a, c._transformTy + b)
  13877. }, this, [c, b]));
  13878. this.lineX = c;
  13879. this.lineY = b
  13880. };
  13881. c.curveTo = function(c, b, a, d) {
  13882. this.commandQueue.push(new e(function(a, b, d, c) {
  13883. var e = this.renderContext;
  13884. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, e._transformTx + d, e._transformTy + c)
  13885. }, this, [c, b, a, d]));
  13886. this.lineX = a;
  13887. this.lineY = d
  13888. };
  13889. c.moveTo = function(c, b) {
  13890. this.commandQueue.push(new e(function(a, b) {
  13891. var c = this.renderContext;
  13892. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  13893. }, this, [c, b]))
  13894. };
  13895. c.clear = function() {
  13896. this.lineY = this.lineX = this.commandQueue.length = 0;
  13897. this.fillStyleColor = this.strokeStyleColor = null
  13898. };
  13899. c.createEndFillCommand = function() {
  13900. this.endFillCommand || (this.endFillCommand = new e(function() {
  13901. this.canvasContext.fill();
  13902. this.canvasContext.closePath()
  13903. }, this, null))
  13904. };
  13905. c.endFill = function() {
  13906. null != this.fillStyleColor && this._fill();
  13907. this.fillStyleColor = null
  13908. };
  13909. c._fill = function() {
  13910. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  13911. };
  13912. c.createEndLineCommand = function() {
  13913. this.endLineCommand || (this.endLineCommand = new e(function() {
  13914. this.canvasContext.stroke();
  13915. this.canvasContext.closePath()
  13916. }, this, null))
  13917. };
  13918. c._draw = function(c) {
  13919. var b = this.commandQueue.length;
  13920. if (0 != b) {
  13921. this.renderContext = c;
  13922. c = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  13923. c.save();
  13924. this.strokeStyleColor && 0 < b && this.commandQueue[b - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), b = this.commandQueue.length);
  13925. for (var a = 0; a < b; a++) {
  13926. var d = this.commandQueue[a];
  13927. d.method.apply(d.thisObject, d.args)
  13928. }
  13929. c.restore()
  13930. }
  13931. };
  13932. var e = function() {
  13933. return function(c, b, a) {
  13934. this.method = c;
  13935. this.thisObject = b;
  13936. this.args = a
  13937. }
  13938. }();
  13939. e.prototype.__class__ = "egret_h5_graphics.Command";
  13940. c._setStyle = function(c) {
  13941. this.canvasContext.fillStyle = c;
  13942. this.canvasContext.beginPath()
  13943. };
  13944. c.init = function() {
  13945. for (var e in c) egret.Graphics.prototype[e] = c[e];
  13946. egret.RendererContext.createRendererContext = function(b) {
  13947. return new egret.HTML5CanvasRenderer(b)
  13948. }
  13949. }
  13950. })(egret_h5_graphics || (egret_h5_graphics = {}));
  13951. egret_h5_graphics.init();
  13952. __extends = this.__extends || function(c, e) {
  13953. function f() {
  13954. this.constructor = c
  13955. }
  13956. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  13957. f.prototype = e.prototype;
  13958. c.prototype = new f
  13959. };
  13960. (function(c) {
  13961. var e = function(e) {
  13962. function b(a) {
  13963. e.call(this);
  13964. this.size = 2E3;
  13965. this.vertSize = 5;
  13966. this.contextLost = !1;
  13967. this.glContextId = 0;
  13968. this.currentBlendMode = "";
  13969. this.currentBaseTexture = null;
  13970. this.currentBatchSize = 0;
  13971. this.maskList = [];
  13972. this.maskDataFreeList = [];
  13973. this.canvasContext = document.createElement("canvas").getContext("2d");
  13974. console.log("使用WebGL模式");
  13975. this.canvas = a || this.createCanvas();
  13976. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  13977. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  13978. this.onResize();
  13979. this.projectionX = this.canvas.width / 2;
  13980. this.projectionY = -this.canvas.height / 2;
  13981. a = 6 * this.size;
  13982. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  13983. this.indices = new Uint16Array(a);
  13984. for (var b = 0, s = 0; b < a; b += 6, s += 4) this.indices[b + 0] = s + 0, this.indices[b + 1] = s + 1, this.indices[b + 2] = s + 2, this.indices[b + 3] = s + 0, this.indices[b + 4] = s + 2, this.indices[b + 5] = s + 3;
  13985. this.initWebGL();
  13986. this.shaderManager = new c.WebGLShaderManager(this.gl);
  13987. this.worldTransform = new c.Matrix;
  13988. this.initBlendMode();
  13989. c.MainContext.instance.addEventListener(c.Event.FINISH_RENDER, this._draw, this);
  13990. c.TextField.prototype._draw = function(a) {
  13991. this.getDirty() && (this.cacheAsBitmap = !0);
  13992. c.DisplayObject.prototype._draw.call(this, a)
  13993. }
  13994. }
  13995. __extends(b, e);
  13996. b.prototype.createCanvas = function() {
  13997. var a = c.Browser.getInstance().$("#egretCanvas");
  13998. if (!a) {
  13999. var b = document.getElementById(c.StageDelegate.canvas_div_name),
  14000. a = c.Browser.getInstance().$new("canvas");
  14001. a.id = "egretCanvas";
  14002. b.appendChild(a)
  14003. }
  14004. c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
  14005. return a
  14006. };
  14007. b.prototype.onResize = function() {
  14008. if (this.canvas) {
  14009. var a = document.getElementById(c.StageDelegate.canvas_div_name);
  14010. this.canvas.width = c.MainContext.instance.stage.stageWidth;
  14011. this.canvas.height = c.MainContext.instance.stage.stageHeight;
  14012. this.canvas.style.width = a.style.width;
  14013. this.canvas.style.height = a.style.height;
  14014. this.projectionX = this.canvas.width / 2;
  14015. this.projectionY = -this.canvas.height / 2
  14016. }
  14017. };
  14018. b.prototype.handleContextLost = function() {
  14019. this.contextLost = !0
  14020. };
  14021. b.prototype.handleContextRestored = function() {
  14022. this.initWebGL();
  14023. this.shaderManager.setContext(this.gl);
  14024. this.contextLost = !1
  14025. };
  14026. b.prototype.initWebGL = function() {
  14027. for (var a = {
  14028. stencil: !0
  14029. }, b, c = ["experimental-webgl", "webgl"], e = 0; e < c.length; e++) {
  14030. try {
  14031. b = this.canvas.getContext(c[e], a)
  14032. } catch (f) {}
  14033. if (b) break
  14034. }
  14035. if (!b) throw Error("当前浏览器不支持webgl");
  14036. this.setContext(b)
  14037. };
  14038. b.prototype.setContext = function(a) {
  14039. this.gl = a;
  14040. a.id = this.glContextId++;
  14041. this.vertexBuffer = a.createBuffer();
  14042. this.indexBuffer = a.createBuffer();
  14043. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  14044. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  14045. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  14046. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  14047. a.disable(a.DEPTH_TEST);
  14048. a.disable(a.CULL_FACE);
  14049. a.enable(a.BLEND);
  14050. a.colorMask(!0, !0, !0, !0)
  14051. };
  14052. b.prototype.initBlendMode = function() {
  14053. this.blendModesWebGL = {};
  14054. this.blendModesWebGL[c.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  14055. this.blendModesWebGL[c.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  14056. };
  14057. b.prototype.start = function() {
  14058. if (!this.contextLost) {
  14059. var a = this.gl;
  14060. a.activeTexture(a.TEXTURE0);
  14061. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  14062. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  14063. var b;
  14064. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  14065. this.shaderManager.activateShader(b);
  14066. b.syncUniforms();
  14067. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  14068. var c = 4 * this.vertSize;
  14069. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  14070. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  14071. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  14072. }
  14073. };
  14074. b.prototype.clearScreen = function() {
  14075. var a = this.gl;
  14076. a.colorMask(!0, !0, !0, !0);
  14077. for (var b = c.RenderFilter.getInstance().getDrawAreaList(), e = 0, f = b.length; e < f; e++) {
  14078. var q = b[e];
  14079. a.viewport(q.x, q.y, q.width, q.height);
  14080. a.bindFramebuffer(a.FRAMEBUFFER, null);
  14081. a.clearColor(0, 0, 0, 0);
  14082. a.clear(a.COLOR_BUFFER_BIT)
  14083. }
  14084. b = c.MainContext.instance.stage;
  14085. a.viewport(0, 0, b.stageWidth, b.stageHeight);
  14086. this.renderCost = 0
  14087. };
  14088. b.prototype.setBlendMode = function(a) {
  14089. a || (a = c.BlendMode.NORMAL);
  14090. if (this.currentBlendMode != a) {
  14091. var b = this.blendModesWebGL[a];
  14092. b && (this._draw(), this.gl.blendFunc(b[0], b[1]), this.currentBlendMode = a)
  14093. }
  14094. };
  14095. b.prototype.drawRepeatImage = function(a, b, e, f, q, g, h, k, l, m) {
  14096. m = c.MainContext.instance.rendererContext.texture_scale_factor;
  14097. f *= m;
  14098. for (q *= m; g < k; g += f)
  14099. for (var n = h; n < l; n += q) {
  14100. var p = Math.min(f, k - g),
  14101. r = Math.min(q, l - n);
  14102. this.drawImage(a, b, e, p / m, r / m, g, n, p, r)
  14103. }
  14104. };
  14105. b.prototype.drawImage = function(a, b, c, e, f, g, h, k, l, m) {
  14106. void 0 === m && (m = void 0);
  14107. if (!this.contextLost)
  14108. if (void 0 !== m) this.drawRepeatImage(a, b, c, e, f, g, h, k, l, m);
  14109. else {
  14110. this.createWebGLTexture(a);
  14111. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(), this.currentBaseTexture = a.webGLTexture;
  14112. var n = this.worldTransform,
  14113. p = n.a,
  14114. r = n.b,
  14115. w = n.c,
  14116. A = n.d,
  14117. u = n.tx,
  14118. y = n.ty;
  14119. 0 == g && 0 == h || n.append(1, 0, 0, 1, g, h);
  14120. 1 == e / k && 1 == f / l || n.append(k / e, 0, 0, l / f, 0, 0);
  14121. g = n.a;
  14122. h = n.b;
  14123. k = n.c;
  14124. l = n.d;
  14125. m = n.tx;
  14126. var v = n.ty;
  14127. n.a = p;
  14128. n.b = r;
  14129. n.c = w;
  14130. n.d = A;
  14131. n.tx = u;
  14132. n.ty = y;
  14133. p = a._sourceWidth;
  14134. r = a._sourceHeight;
  14135. a = e;
  14136. n = f;
  14137. b /= p;
  14138. c /= r;
  14139. e /= p;
  14140. f /= r;
  14141. p = this.vertices;
  14142. r = 4 * this.currentBatchSize * this.vertSize;
  14143. w = this.worldAlpha;
  14144. p[r++] = m;
  14145. p[r++] = v;
  14146. p[r++] = b;
  14147. p[r++] = c;
  14148. p[r++] = w;
  14149. p[r++] = g * a + m;
  14150. p[r++] = h * a + v;
  14151. p[r++] = e + b;
  14152. p[r++] = c;
  14153. p[r++] = w;
  14154. p[r++] = g * a + k * n + m;
  14155. p[r++] = l * n + h * a + v;
  14156. p[r++] = e + b;
  14157. p[r++] = f + c;
  14158. p[r++] = w;
  14159. p[r++] = k * n + m;
  14160. p[r++] = l * n + v;
  14161. p[r++] = b;
  14162. p[r++] = f + c;
  14163. p[r++] = w;
  14164. this.currentBatchSize++
  14165. }
  14166. };
  14167. b.prototype._draw = function() {
  14168. if (0 != this.currentBatchSize && !this.contextLost) {
  14169. var a = c.getTimer();
  14170. this.start();
  14171. var b = this.gl;
  14172. b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
  14173. var e = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  14174. b.bufferSubData(b.ARRAY_BUFFER, 0, e);
  14175. b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
  14176. this.currentBatchSize = 0;
  14177. this.renderCost += c.getTimer() - a;
  14178. c.Profiler.getInstance().onDrawImage()
  14179. }
  14180. };
  14181. b.prototype.setTransform = function(a) {
  14182. var b = this.worldTransform;
  14183. b.a = a.a;
  14184. b.b = a.b;
  14185. b.c = a.c;
  14186. b.d = a.d;
  14187. b.tx = a.tx;
  14188. b.ty = a.ty
  14189. };
  14190. b.prototype.setAlpha = function(a, b) {
  14191. this.worldAlpha = a;
  14192. this.setBlendMode(b)
  14193. };
  14194. b.prototype.createWebGLTexture = function(a) {
  14195. if (!a.webGLTexture) {
  14196. var b = this.gl;
  14197. a.webGLTexture = b.createTexture();
  14198. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  14199. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  14200. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  14201. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  14202. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  14203. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  14204. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  14205. b.bindTexture(b.TEXTURE_2D, null)
  14206. }
  14207. };
  14208. b.prototype.pushMask = function(a) {
  14209. this._draw();
  14210. var b = this.gl;
  14211. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  14212. var c = this.maskDataFreeList.pop();
  14213. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  14214. x: a.x,
  14215. y: a.y,
  14216. w: a.width,
  14217. h: a.height
  14218. };
  14219. this.maskList.push(c);
  14220. b.colorMask(!1, !1, !1, !1);
  14221. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  14222. this.renderGraphics(c);
  14223. b.colorMask(!0, !0, !0, !0);
  14224. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  14225. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  14226. };
  14227. b.prototype.popMask = function() {
  14228. this._draw();
  14229. var a = this.gl,
  14230. b = this.maskList.pop();
  14231. 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));
  14232. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  14233. };
  14234. b.prototype.setGlobalColorTransform = function(a) {
  14235. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  14236. a = a.concat();
  14237. var b = this.shaderManager.colorTransformShader;
  14238. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  14239. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  14240. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  14241. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  14242. b.uniforms.matrix.value = a
  14243. }
  14244. };
  14245. b.prototype.setupFont = function(a, b) {
  14246. var c = this.canvasContext,
  14247. e = a.italic ? "italic " : "normal ",
  14248. e = e + (a.bold ? "bold " : "normal "),
  14249. e = e + (a.size + "px " + a.fontFamily);
  14250. c.font = e;
  14251. c.textAlign = "left";
  14252. c.textBaseline = "middle"
  14253. };
  14254. b.prototype.measureText = function(a) {
  14255. return this.canvasContext.measureText(a).width
  14256. };
  14257. b.prototype.renderGraphics = function(a) {
  14258. var b = this.gl,
  14259. c = this.shaderManager.primitiveShader;
  14260. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  14261. this.updateGraphics(a);
  14262. this.shaderManager.activateShader(c);
  14263. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  14264. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  14265. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  14266. b.uniform2f(c.offsetVector, 0, 0);
  14267. b.uniform3fv(c.tintColor, [1, 1, 1]);
  14268. b.uniform1f(c.alpha, this.worldAlpha);
  14269. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  14270. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  14271. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  14272. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  14273. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  14274. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  14275. };
  14276. b.prototype.updateGraphics = function(a) {
  14277. var b = this.gl;
  14278. this.buildRectangle(a);
  14279. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  14280. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  14281. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  14282. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  14283. };
  14284. b.prototype.buildRectangle = function(a) {
  14285. var b = a.x,
  14286. c = a.y,
  14287. e = a.w;
  14288. a = a.h;
  14289. var f = this.graphicsPoints,
  14290. g = this.graphicsIndices,
  14291. h = f.length / 6;
  14292. f.push(b, c);
  14293. f.push(0, 0, 0, 1);
  14294. f.push(b + e, c);
  14295. f.push(0, 0, 0, 1);
  14296. f.push(b, c + a);
  14297. f.push(0, 0, 0, 1);
  14298. f.push(b + e, c + a);
  14299. f.push(0, 0, 0, 1);
  14300. g.push(h, h, h + 1, h + 2, h + 3, h + 3)
  14301. };
  14302. return b
  14303. }(c.RendererContext);
  14304. c.WebGLRenderer = e;
  14305. e.prototype.__class__ = "egret.WebGLRenderer"
  14306. })(egret || (egret = {}));
  14307. (function(c) {
  14308. var e = function() {
  14309. function c() {}
  14310. c.compileProgram = function(b, a, d) {
  14311. d = c.compileFragmentShader(b, d);
  14312. a = c.compileVertexShader(b, a);
  14313. var e = b.createProgram();
  14314. b.attachShader(e, a);
  14315. b.attachShader(e, d);
  14316. b.linkProgram(e);
  14317. b.getProgramParameter(e, b.LINK_STATUS) || console.log("无法初始化着色器");
  14318. return e
  14319. };
  14320. c.compileFragmentShader = function(b, a) {
  14321. return c._compileShader(b, a, b.FRAGMENT_SHADER)
  14322. };
  14323. c.compileVertexShader = function(b, a) {
  14324. return c._compileShader(b, a, b.VERTEX_SHADER)
  14325. };
  14326. c._compileShader = function(b, a, d) {
  14327. d = b.createShader(d);
  14328. b.shaderSource(d, a);
  14329. b.compileShader(d);
  14330. return b.getShaderParameter(d, b.COMPILE_STATUS) ? d : (console.log(b.getShaderInfoLog(d)), null)
  14331. };
  14332. c.checkCanUseWebGL = function() {
  14333. if (void 0 == c.canUseWebGL) try {
  14334. var b = document.createElement("canvas");
  14335. c.canUseWebGL = !! window.WebGLRenderingContext && !(!b.getContext("webgl") && !b.getContext("experimental-webgl"))
  14336. } catch (a) {
  14337. c.canUseWebGL = !1
  14338. }
  14339. return c.canUseWebGL
  14340. };
  14341. return c
  14342. }();
  14343. c.WebGLUtils = e;
  14344. e.prototype.__class__ = "egret.WebGLUtils"
  14345. })(egret || (egret = {}));
  14346. __extends = this.__extends || function(c, e) {
  14347. function f() {
  14348. this.constructor = c
  14349. }
  14350. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14351. f.prototype = e.prototype;
  14352. c.prototype = new f
  14353. };
  14354. (function(c) {
  14355. var e = function() {
  14356. function d(a) {
  14357. this.maxAttibs = 10;
  14358. this.attribState = [];
  14359. this.tempAttribState = [];
  14360. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  14361. this.setContext(a)
  14362. }
  14363. d.prototype.setContext = function(d) {
  14364. this.gl = d;
  14365. this.primitiveShader = new a(d);
  14366. this.defaultShader = new f(d);
  14367. this.colorTransformShader = new b(d);
  14368. this.activateShader(this.defaultShader)
  14369. };
  14370. d.prototype.activateShader = function(a) {
  14371. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader = a)
  14372. };
  14373. d.prototype.setAttribs = function(a) {
  14374. var b, d;
  14375. d = this.tempAttribState.length;
  14376. for (b = 0; b < d; b++) this.tempAttribState[b] = !1;
  14377. d = a.length;
  14378. for (b = 0; b < d; b++) this.tempAttribState[a[b]] = !0;
  14379. a = this.gl;
  14380. d = this.attribState.length;
  14381. for (b = 0; b < d; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  14382. };
  14383. return d
  14384. }();
  14385. c.WebGLShaderManager = e;
  14386. e.prototype.__class__ = "egret.WebGLShaderManager";
  14387. var f = function() {
  14388. function a(b) {
  14389. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  14390. this.program = null;
  14391. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  14392. this.gl = b;
  14393. this.init()
  14394. }
  14395. a.prototype.init = function() {
  14396. var a = this.gl,
  14397. b = c.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  14398. a.useProgram(b);
  14399. this.uSampler = a.getUniformLocation(b, "uSampler");
  14400. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  14401. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  14402. this.dimensions = a.getUniformLocation(b, "dimensions");
  14403. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  14404. this.aTextureCoord = a.getAttribLocation(b, "aTextureCoord");
  14405. this.colorAttribute = a.getAttribLocation(b, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  14406. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  14407. for (var d in this.uniforms) this.uniforms[d].uniformLocation = a.getUniformLocation(b, d);
  14408. this.initUniforms();
  14409. this.program = b
  14410. };
  14411. a.prototype.initUniforms = function() {
  14412. if (this.uniforms) {
  14413. var a = this.gl,
  14414. b, d;
  14415. for (d in this.uniforms) {
  14416. b = this.uniforms[d];
  14417. var c = b.type;
  14418. "mat2" === c || "mat3" === c || "mat4" === c ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === c ? b.glFunc = a.uniformMatrix2fv : "mat3" === c ? b.glFunc = a.uniformMatrix3fv : "mat4" === c && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + c], b.glValueLength = "2f" === c || "2i" === c ? 2 : "3f" === c || "3i" === c ? 3 : "4f" === c || "4i" === c ? 4 : 1)
  14419. }
  14420. }
  14421. };
  14422. a.prototype.syncUniforms = function() {
  14423. if (this.uniforms) {
  14424. var a, b = this.gl,
  14425. d;
  14426. for (d in this.uniforms) a = this.uniforms[d], 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  14427. }
  14428. };
  14429. return a
  14430. }();
  14431. c.EgretShader = f;
  14432. f.prototype.__class__ = "egret.EgretShader";
  14433. var b = function(a) {
  14434. function b(c) {
  14435. a.call(this, c);
  14436. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  14437. this.uniforms = {
  14438. matrix: {
  14439. type: "mat4",
  14440. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  14441. },
  14442. colorAdd: {
  14443. type: "4f",
  14444. value: {
  14445. x: 0,
  14446. y: 0,
  14447. z: 0,
  14448. w: 0
  14449. }
  14450. }
  14451. };
  14452. this.init()
  14453. }
  14454. __extends(b, a);
  14455. return b
  14456. }(f);
  14457. c.ColorTransformShader = b;
  14458. b.prototype.__class__ = "egret.ColorTransformShader";
  14459. var a = function() {
  14460. function a(b) {
  14461. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  14462. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  14463. 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}";
  14464. this.gl = b;
  14465. this.init()
  14466. }
  14467. a.prototype.init = function() {
  14468. var a = this.gl,
  14469. b = c.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  14470. a.useProgram(b);
  14471. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  14472. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  14473. this.tintColor = a.getUniformLocation(b, "tint");
  14474. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  14475. this.colorAttribute = a.getAttribLocation(b, "aColor");
  14476. this.attributes = [this.aVertexPosition, this.colorAttribute];
  14477. this.translationMatrix = a.getUniformLocation(b, "translationMatrix");
  14478. this.alpha = a.getUniformLocation(b, "alpha");
  14479. this.program = b
  14480. };
  14481. return a
  14482. }();
  14483. c.PrimitiveShader = a;
  14484. a.prototype.__class__ = "egret.PrimitiveShader"
  14485. })(egret || (egret = {}));
  14486. __extends = this.__extends || function(c, e) {
  14487. function f() {
  14488. this.constructor = c
  14489. }
  14490. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14491. f.prototype = e.prototype;
  14492. c.prototype = new f
  14493. };
  14494. (function(c) {
  14495. var e = function(e) {
  14496. function b() {
  14497. e.call(this)
  14498. }
  14499. __extends(b, e);
  14500. b.prototype.proceed = function(a) {
  14501. function b() {
  14502. if (4 == f.readyState)
  14503. if (f.status != a._status && (a._status = f.status, c.HTTPStatusEvent.dispatchHTTPStatusEvent(a, f.status)), 400 <= f.status || 0 == f.status) c.IOErrorEvent.dispatchIOErrorEvent(a);
  14504. else {
  14505. switch (a.dataFormat) {
  14506. case c.URLLoaderDataFormat.TEXT:
  14507. a.data = f.responseText;
  14508. break;
  14509. case c.URLLoaderDataFormat.VARIABLES:
  14510. a.data = new c.URLVariables(f.responseText);
  14511. break;
  14512. case c.URLLoaderDataFormat.BINARY:
  14513. a.data = f.response;
  14514. break;
  14515. default:
  14516. a.data = f.responseText
  14517. }
  14518. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  14519. }
  14520. }
  14521. if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  14522. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  14523. else {
  14524. var e = a._request,
  14525. f = this.getXHR();
  14526. f.onreadystatechange = b;
  14527. var q = c.NetContext._getUrl(e);
  14528. f.open(e.method, q, !0);
  14529. this.setResponseType(f, a.dataFormat);
  14530. e.method != c.URLRequestMethod.GET && e.data ? e.data instanceof c.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()
  14531. }
  14532. };
  14533. b.prototype.loadSound = function(a) {
  14534. function b(q) {
  14535. window.clearTimeout(f.__timeoutId);
  14536. f.removeEventListener("canplaythrough", b, !1);
  14537. f.removeEventListener("error", e, !1);
  14538. q = new c.Sound;
  14539. q._setAudio(f);
  14540. a.data = q;
  14541. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  14542. }
  14543. function e(q) {
  14544. window.clearTimeout(f.__timeoutId);
  14545. f.removeEventListener("canplaythrough", b, !1);
  14546. f.removeEventListener("error", e, !1);
  14547. c.IOErrorEvent.dispatchIOErrorEvent(a)
  14548. }
  14549. var f = new Audio(a._request.url);
  14550. f.__timeoutId = window.setTimeout(b, 100);
  14551. f.addEventListener("canplaythrough", b, !1);
  14552. f.addEventListener("error", e, !1);
  14553. f.load()
  14554. };
  14555. b.prototype.getXHR = function() {
  14556. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  14557. };
  14558. b.prototype.setResponseType = function(a, b) {
  14559. switch (b) {
  14560. case c.URLLoaderDataFormat.TEXT:
  14561. case c.URLLoaderDataFormat.VARIABLES:
  14562. a.responseType = c.URLLoaderDataFormat.TEXT;
  14563. break;
  14564. case c.URLLoaderDataFormat.BINARY:
  14565. a.responseType = "arraybuffer";
  14566. break;
  14567. default:
  14568. a.responseType = b
  14569. }
  14570. };
  14571. b.prototype.loadTexture = function(a) {
  14572. var b = a._request,
  14573. e = new Image;
  14574. e.onload = function(b) {
  14575. e.onerror = null;
  14576. e.onload = null;
  14577. b = new c.Texture;
  14578. b._setBitmapData(e);
  14579. a.data = b;
  14580. c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  14581. };
  14582. e.onerror = function(b) {
  14583. e.onerror = null;
  14584. e.onload = null;
  14585. c.IOErrorEvent.dispatchIOErrorEvent(a)
  14586. };
  14587. e.src = b.url
  14588. };
  14589. return b
  14590. }(c.NetContext);
  14591. c.HTML5NetContext = e;
  14592. e.prototype.__class__ = "egret.HTML5NetContext"
  14593. })(egret || (egret = {}));
  14594. __extends = this.__extends || function(c, e) {
  14595. function f() {
  14596. this.constructor = c
  14597. }
  14598. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14599. f.prototype = e.prototype;
  14600. c.prototype = new f
  14601. };
  14602. (function(c) {
  14603. var e = function(e) {
  14604. function b() {
  14605. e.call(this);
  14606. this._isTouchDown = !1;
  14607. this.rootDiv = document.getElementById(c.StageDelegate.canvas_div_name)
  14608. }
  14609. __extends(b, e);
  14610. b.prototype.prevent = function(a) {
  14611. a.stopPropagation();
  14612. !0 != a.isScroll && a.preventDefault()
  14613. };
  14614. b.prototype.run = function() {
  14615. var a = this;
  14616. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  14617. a._onTouchBegin(b);
  14618. a.prevent(b)
  14619. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  14620. a._onTouchMove(b);
  14621. a.prevent(b)
  14622. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  14623. a._onTouchEnd(b);
  14624. a.prevent(b)
  14625. }, !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  14626. window.addEventListener("mousedown", function(b) {
  14627. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  14628. });
  14629. window.addEventListener("mouseup", function(b) {
  14630. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  14631. a._isTouchDown = !1
  14632. })
  14633. };
  14634. b.prototype.addMouseListener = function() {
  14635. var a = this;
  14636. this.rootDiv.addEventListener("mousedown", function(b) {
  14637. a._onTouchBegin(b)
  14638. });
  14639. this.rootDiv.addEventListener("mousemove", function(b) {
  14640. a._onTouchMove(b)
  14641. });
  14642. this.rootDiv.addEventListener("mouseup", function(b) {
  14643. a._onTouchEnd(b)
  14644. })
  14645. };
  14646. b.prototype.addTouchListener = function() {
  14647. var a = this;
  14648. this.rootDiv.addEventListener("touchstart", function(b) {
  14649. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchBegin(b.changedTouches[e]);
  14650. a.prevent(b)
  14651. }, !1);
  14652. this.rootDiv.addEventListener("touchmove", function(b) {
  14653. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchMove(b.changedTouches[e]);
  14654. a.prevent(b)
  14655. }, !1);
  14656. this.rootDiv.addEventListener("touchend", function(b) {
  14657. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchEnd(b.changedTouches[e]);
  14658. a.prevent(b)
  14659. }, !1);
  14660. this.rootDiv.addEventListener("touchcancel", function(b) {
  14661. for (var c = b.changedTouches.length, e = 0; e < c; e++) a._onTouchEnd(b.changedTouches[e]);
  14662. a.prevent(b)
  14663. }, !1)
  14664. };
  14665. b.prototype.inOutOfCanvas = function(a) {
  14666. var b = this.getLocation(this.rootDiv, a);
  14667. a = b.x;
  14668. var b = b.y,
  14669. e = c.MainContext.instance.stage;
  14670. return 0 > a || 0 > b || a > e.stageWidth || b > e.stageHeight ? !0 : !1
  14671. };
  14672. b.prototype.dispatchLeaveStageEvent = function() {
  14673. this.touchingIdentifiers.length = 0;
  14674. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  14675. };
  14676. b.prototype._onTouchBegin = function(a) {
  14677. var b = this.getLocation(this.rootDiv, a),
  14678. c = -1;
  14679. a.hasOwnProperty("identifier") && (c = a.identifier);
  14680. this.onTouchBegan(b.x, b.y, c)
  14681. };
  14682. b.prototype._onTouchMove = function(a) {
  14683. var b = this.getLocation(this.rootDiv, a),
  14684. c = -1;
  14685. a.hasOwnProperty("identifier") && (c = a.identifier);
  14686. this.onTouchMove(b.x, b.y, c)
  14687. };
  14688. b.prototype._onTouchEnd = function(a) {
  14689. var b = this.getLocation(this.rootDiv, a),
  14690. c = -1;
  14691. a.hasOwnProperty("identifier") && (c = a.identifier);
  14692. this.onTouchEnd(b.x, b.y, c)
  14693. };
  14694. b.prototype.getLocation = function(a, b) {
  14695. var e = document.documentElement,
  14696. f = window,
  14697. q, g;
  14698. "function" === typeof a.getBoundingClientRect ? (g = a.getBoundingClientRect(), q = g.left, g = g.top) : g = q = 0;
  14699. q += f.pageXOffset - e.clientLeft;
  14700. g += f.pageYOffset - e.clientTop;
  14701. null != b.pageX ? (e = b.pageX, f = b.pageY) : (q -= document.body.scrollLeft, g -= document.body.scrollTop, e = b.clientX, f = b.clientY);
  14702. var h = c.Point.identity;
  14703. h.x = (e - q) / c.StageDelegate.getInstance().getScaleX();
  14704. h.y = (f - g) / c.StageDelegate.getInstance().getScaleY();
  14705. return h
  14706. };
  14707. return b
  14708. }(c.TouchContext);
  14709. c.HTML5TouchContext = e;
  14710. e.prototype.__class__ = "egret.HTML5TouchContext"
  14711. })(egret || (egret = {}));
  14712. __extends = this.__extends || function(c, e) {
  14713. function f() {
  14714. this.constructor = c
  14715. }
  14716. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14717. f.prototype = e.prototype;
  14718. c.prototype = new f
  14719. };
  14720. (function(c) {
  14721. var e = function(e) {
  14722. function b() {
  14723. e.call(this);
  14724. this._hasListeners = !1;
  14725. this._inputType = "";
  14726. this._isShow = !1;
  14727. this.textValue = "";
  14728. this._height = this._width = 0;
  14729. this._styleInfoes = {};
  14730. var a = c.StageDelegate.getInstance().getScaleX(),
  14731. b = c.StageDelegate.getInstance().getScaleY(),
  14732. s = c.Browser.getInstance().$new("div");
  14733. s.position.x = 0;
  14734. s.position.y = 0;
  14735. s.scale.x = a;
  14736. s.scale.y = b;
  14737. s.transforms();
  14738. s.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  14739. this.div = s;
  14740. b = c.MainContext.instance.stage;
  14741. a = b.stageWidth;
  14742. b = b.stageHeight;
  14743. s = new c.Shape;
  14744. s.width = a;
  14745. s.height = b;
  14746. s.touchEnabled = !0;
  14747. this._shape = s;
  14748. this.getStageDelegateDiv().appendChild(this.div)
  14749. }
  14750. __extends(b, e);
  14751. b.prototype.getStageDelegateDiv = function() {
  14752. var a = c.Browser.getInstance().$("#StageDelegateDiv");
  14753. a || (a = c.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  14754. return a
  14755. };
  14756. b.prototype._setMultiline = function(a) {
  14757. e.prototype._setMultiline.call(this, a);
  14758. this.createInput()
  14759. };
  14760. b.prototype.callHandler = function(a) {
  14761. a.stopPropagation()
  14762. };
  14763. b.prototype._add = function() {
  14764. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  14765. };
  14766. b.prototype._remove = function() {
  14767. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  14768. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  14769. };
  14770. b.prototype._addListeners = function() {
  14771. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart", this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  14772. };
  14773. b.prototype._removeListeners = function() {
  14774. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  14775. };
  14776. b.prototype.createInput = function() {
  14777. var a = this._multiline ? "textarea" : "input";
  14778. this._inputType != a && (this._inputType = a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {}, a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  14779. };
  14780. b.prototype._open = function(a, b, c, e) {};
  14781. b.prototype._setScale = function(a, b) {
  14782. e.prototype._setScale.call(this, a, b);
  14783. var s = c.StageDelegate.getInstance().getScaleX(),
  14784. x = c.StageDelegate.getInstance().getScaleY();
  14785. this.div.scale.x = s * a;
  14786. this.div.scale.y = x * b;
  14787. this.div.transforms()
  14788. };
  14789. b.prototype.changePosition = function(a, b) {
  14790. var e = c.StageDelegate.getInstance().getScaleX(),
  14791. f = c.StageDelegate.getInstance().getScaleY();
  14792. this.div.position.x = a * e;
  14793. this.div.position.y = b * f;
  14794. this.div.transforms()
  14795. };
  14796. b.prototype.setStyles = function() {
  14797. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  14798. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  14799. this.setElementStyle("textAlign", this._textAlign);
  14800. this.setElementStyle("fontSize", this._size + "px");
  14801. this.setElementStyle("color", "#000000");
  14802. this.setElementStyle("width", this._width + "px");
  14803. this.setElementStyle("height", this._height + "px");
  14804. this.setElementStyle("border", "1px solid red");
  14805. this.setElementStyle("display", "block")
  14806. };
  14807. b.prototype._show = function() {
  14808. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  14809. this._isShow = !0;
  14810. var a = this._getText();
  14811. this.inputElement.value = a;
  14812. var b = this;
  14813. this.inputElement.oninput = function() {
  14814. b.textValue = b.inputElement.value;
  14815. b.dispatchEvent(new c.Event("updateText"))
  14816. };
  14817. this.setStyles();
  14818. this.inputElement.focus();
  14819. this.inputElement.selectionStart = a.length;
  14820. this.inputElement.selectionEnd = a.length;
  14821. this._shape && null == this._shape.parent && c.MainContext.instance.stage.addChild(this._shape)
  14822. };
  14823. b.prototype._hide = function() {
  14824. if (null != this.inputElement) {
  14825. this._isShow = !1;
  14826. this.inputElement.oninput = function() {};
  14827. this.setElementStyle("border", "none");
  14828. this.setElementStyle("display", "none");
  14829. this.inputElement.value = "";
  14830. this.setElementStyle("width", "0px");
  14831. window.scrollTo(0, 0);
  14832. var a = this;
  14833. c.setTimeout(function() {
  14834. a.inputElement.blur();
  14835. window.scrollTo(0, 0)
  14836. }, this, 50);
  14837. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  14838. }
  14839. };
  14840. b.prototype._getText = function() {
  14841. this.textValue || (this.textValue = "");
  14842. return this.textValue
  14843. };
  14844. b.prototype._setText = function(a) {
  14845. this.textValue = a;
  14846. this.resetText()
  14847. };
  14848. b.prototype.resetText = function() {
  14849. this.inputElement && (this.inputElement.value = this.textValue)
  14850. };
  14851. b.prototype._setWidth = function(a) {
  14852. this._width = a
  14853. };
  14854. b.prototype._setHeight = function(a) {
  14855. this._height = a
  14856. };
  14857. b.prototype.setElementStyle = function(a, b) {
  14858. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  14859. };
  14860. return b
  14861. }(c.StageText);
  14862. c.HTML5StageText = e;
  14863. e.prototype.__class__ = "egret.HTML5StageText"
  14864. })(egret || (egret = {}));
  14865. egret.StageText.create = function() {
  14866. return new egret.HTML5StageText
  14867. };
  14868. var __extends = this.__extends || function(c, e) {
  14869. function f() {
  14870. this.constructor = c
  14871. }
  14872. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14873. f.prototype = e.prototype;
  14874. c.prototype = new f
  14875. }, GuiContainer = function(c) {
  14876. function e() {
  14877. c.call(this)
  14878. }
  14879. __extends(e, c);
  14880. e.prototype.dispose = function() {};
  14881. e.prototype.onAdded = function(c) {};
  14882. return e
  14883. }(egret.gui.SkinnableComponent);
  14884. GuiContainer.prototype.__class__ = "GuiContainer";
  14885. var __extends = this.__extends || function(c, e) {
  14886. function f() {
  14887. this.constructor = c
  14888. }
  14889. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14890. f.prototype = e.prototype;
  14891. c.prototype = new f
  14892. }, MyImg = function(c) {
  14893. function e() {
  14894. c.call(this)
  14895. }
  14896. __extends(e, c);
  14897. e.prototype.setUrl = function(c) {
  14898. c = new egret.gui.UIAsset(c);
  14899. this.addElement(c)
  14900. };
  14901. return e
  14902. }(egret.gui.Group);
  14903. MyImg.prototype.__class__ = "MyImg";
  14904. var __extends = this.__extends || function(c, e) {
  14905. function f() {
  14906. this.constructor = c
  14907. }
  14908. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14909. f.prototype = e.prototype;
  14910. c.prototype = new f
  14911. }, Enemy = function(c) {
  14912. function e() {
  14913. c.call(this);
  14914. this.initEnemy()
  14915. }
  14916. __extends(e, c);
  14917. e.prototype.initEnemy = function() {
  14918. var c = "",
  14919. c = 0.5 > Math.random() ? "emeny_png" : "enemy1_png";
  14920. this.addElement(new egret.gui.UIAsset(c))
  14921. };
  14922. return e
  14923. }(egret.gui.Group);
  14924. Enemy.prototype.__class__ = "Enemy";
  14925. var GameUtils = function() {
  14926. function c() {}
  14927. c.debug = function(c) {
  14928. console.debug(c)
  14929. };
  14930. c.hitTest = function(c, f) {
  14931. var b = c.getBounds(),
  14932. a = f.getBounds();
  14933. b.x = c.x;
  14934. b.y = c.y;
  14935. a.x = f.x;
  14936. a.y = f.y;
  14937. return b.intersects(a)
  14938. };
  14939. return c
  14940. }();
  14941. GameUtils.prototype.__class__ = "GameUtils";
  14942. var Caches = function() {
  14943. function c() {}
  14944. c.GetEnemyBullet = function() {
  14945. return c.cacheEnemyBullet.length ? c.cacheEnemyBullet.shift() : new egret.gui.UIAsset("enemyBullet_png")
  14946. };
  14947. c.GetEmeny = function() {
  14948. return c.cacheEmeny.length ? c.cacheEmeny.shift() : new Enemy
  14949. };
  14950. c.cacheEnemyBullet = [];
  14951. c.cacheEmeny = [];
  14952. return c
  14953. }();
  14954. Caches.prototype.__class__ = "Caches";
  14955. var __extends = this.__extends || function(c, e) {
  14956. function f() {
  14957. this.constructor = c
  14958. }
  14959. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  14960. f.prototype = e.prototype;
  14961. c.prototype = new f
  14962. }, EnemyBulletGroup = function(c) {
  14963. function e() {
  14964. c.call(this);
  14965. this.enemyBullets = [];
  14966. this.timeInterval = 60;
  14967. this.temp_i = this.loopCount = 0
  14968. }
  14969. __extends(e, c);
  14970. e.prototype.create = function(c, b) {
  14971. this.temp_bullet = Caches.GetEnemyBullet();
  14972. this.temp_bullet.x = c - this.temp_bullet.width / 2;
  14973. this.temp_bullet.y = b;
  14974. this.addElement(this.temp_bullet);
  14975. this.enemyBullets.push(this.temp_bullet)
  14976. };
  14977. e.prototype.updata = function() {
  14978. for (this.temp_i = this.enemyBullets.length - 1; 0 <= this.temp_i; this.temp_i--) this.temp_bullet = this.enemyBullets[this.temp_i], this.temp_bullet.y += 6, this.temp_bullet.y > Main.main.stage.stageHeight && this.clearItem(this.temp_i)
  14979. };
  14980. e.prototype.clears = function() {
  14981. for (this.removeAllElements(); this.enemyBullets.length;) this.temp_bullet = this.enemyBullets.shift(), Caches.cacheEnemyBullet.push(this.temp_bullet)
  14982. };
  14983. e.prototype.clearItem = function(c) {
  14984. void 0 === c && (c = -1); - 1 != c && (this.temp_bullet = this.enemyBullets[c], this.removeElement(this.temp_bullet), this.enemyBullets.splice(c, 1), Caches.cacheEnemyBullet.push(this.temp_bullet))
  14985. };
  14986. return e
  14987. }(egret.gui.Group);
  14988. EnemyBulletGroup.prototype.__class__ = "EnemyBulletGroup";
  14989. var VPlayUtil = function() {
  14990. function c() {}
  14991. c.GetBullet = function() {
  14992. if (c.cacheBullet.length) return c.cacheBullet.shift();
  14993. var e = new egret.gui.UIAsset("bullet_png");
  14994. e.anchorX = 0.5;
  14995. return e
  14996. };
  14997. c.GetBigEmeny = function() {
  14998. var e;
  14999. if (c.cacheBigEmeny.length) return e = c.cacheBigEmeny.shift(), e.life = 8, e;
  15000. e = new MyImg;
  15001. e.setUrl("bigEmeny_png");
  15002. e.life = 8;
  15003. return e
  15004. };
  15005. c.SetImgNum = function(e, f, b) {
  15006. void 0 === b && (b = 1);
  15007. e.removeAllElements();
  15008. f = f.toString().split("");
  15009. for (var a = 0, d = 0; d < f.length; d++) a = parseInt(f[d]), a = c.GetImgByNum(a), a.scaleX = b, a.scaleY = b, e.addElement(a)
  15010. };
  15011. c.GetImgByNum = function(e) {
  15012. if (c.cacheImgNum[e]) return c.cacheImgNum[e];
  15013. var f = new egret.gui.UIAsset("imgFont" + e);
  15014. return c[e] = f
  15015. };
  15016. c.cacheBullet = [];
  15017. c.cacheBigEmeny = [];
  15018. c.cacheImgNum = [];
  15019. return c
  15020. }();
  15021. VPlayUtil.prototype.__class__ = "VPlayUtil";
  15022. var __extends = this.__extends || function(c, e) {
  15023. function f() {
  15024. this.constructor = c
  15025. }
  15026. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15027. f.prototype = e.prototype;
  15028. c.prototype = new f
  15029. }, VStart = function(c) {
  15030. function e() {
  15031. c.call(this);
  15032. this.skinName = "skins.coustom.StartViewSkin"
  15033. }
  15034. __extends(e, c);
  15035. e.prototype.partAdded = function(e, b) {
  15036. c.prototype.partAdded.call(this, e, b);
  15037. switch (b) {
  15038. case this.startGameBtn:
  15039. this.startGameBtn.touchEnabled = !0;
  15040. this.startGameBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapStartGameBtn, this);
  15041. break;
  15042. case this.playIntroduce:
  15043. this.playIntroduce.touchEnabled = !0;
  15044. this.playIntroduce.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapplayIntroduceBtn, this);
  15045. break;
  15046. case this.introducer:
  15047. this.introducer.visible = !1;
  15048. break;
  15049. case this.iReturn:
  15050. this.iReturn.touchEnabled = !0;
  15051. this.iReturn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapIReturn, this);
  15052. break;
  15053. case this.iStart:
  15054. this.iStart.touchEnabled = !0, this.iStart.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapStartGameBtn, this)
  15055. }
  15056. };
  15057. e.prototype.onTouchTapIReturn = function(c) {
  15058. this.introducer.visible = !1
  15059. };
  15060. e.prototype.onTouchTapStartGameBtn = function(c) {
  15061. this.touchEnabled = this.touchChildren = !1;
  15062. c = Main.panelLayer.hasVplay;
  15063. var b = Main.panelLayer.vplay;
  15064. b.touchChildren = !0;
  15065. Main.panelLayer.addPanel(b, c)
  15066. };
  15067. e.prototype.onTouchTapplayIntroduceBtn = function(c) {
  15068. this.introducer.visible = !this.introducer.visible
  15069. };
  15070. return e
  15071. }(GuiContainer);
  15072. VStart.prototype.__class__ = "VStart";
  15073. var __extends = this.__extends || function(c, e) {
  15074. function f() {
  15075. this.constructor = c
  15076. }
  15077. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15078. f.prototype = e.prototype;
  15079. c.prototype = new f
  15080. }, skins;
  15081. (function(c) {
  15082. (function(c) {
  15083. var f = function(b) {
  15084. function a() {
  15085. b.call(this);
  15086. this.__s = egret.gui.setProperties;
  15087. this.elementsContent = [this.__4_i()];
  15088. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", []), new egret.gui.State("disabled", [])]
  15089. }
  15090. __extends(a, b);
  15091. a.prototype.__4_i = function() {
  15092. var a = new egret.gui.UIAsset;
  15093. this.__s(a, ["fillMode", "height", "source", "verticalCenter", "percentWidth"], ["scale", 10, "hscrollbtn_png", 0, 100]);
  15094. return a
  15095. };
  15096. return a
  15097. }(egret.gui.Skin);
  15098. c.HScrollBarThumbSkin = f;
  15099. f.prototype.__class__ = "skins.simple.HScrollBarThumbSkin"
  15100. })(c.simple || (c.simple = {}))
  15101. })(skins || (skins = {}));
  15102. __extends = this.__extends || function(c, e) {
  15103. function f() {
  15104. this.constructor = c
  15105. }
  15106. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15107. f.prototype = e.prototype;
  15108. c.prototype = new f
  15109. };
  15110. (function(c) {
  15111. (function(c) {
  15112. var f = function(b) {
  15113. function a() {
  15114. b.call(this);
  15115. this.__s = egret.gui.setProperties;
  15116. this.minHeight = 22;
  15117. this.elementsContent = [this.__7_i()];
  15118. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__7", "source", "tree_btndown_png")]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__7", "source", "tree_btndisabled_png")]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__7", "source", "tree_btnupselect_png")]), new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__7", "source", "tree_btndownselect_png")]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__7", "source", "tree_btndisabledselect_png")])]
  15119. }
  15120. __extends(a, b);
  15121. a.prototype.__7_i = function() {
  15122. var a = new egret.gui.UIAsset;
  15123. this.__7 = a;
  15124. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "tree_btnup_png", 100]);
  15125. return a
  15126. };
  15127. return a
  15128. }(egret.gui.Skin);
  15129. c.TreeDisclosureButtonSkin = f;
  15130. f.prototype.__class__ = "skins.simple.TreeDisclosureButtonSkin"
  15131. })(c.simple || (c.simple = {}))
  15132. })(skins || (skins = {}));
  15133. __extends = this.__extends || function(c, e) {
  15134. function f() {
  15135. this.constructor = c
  15136. }
  15137. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15138. f.prototype = e.prototype;
  15139. c.prototype = new f
  15140. };
  15141. (function(c) {
  15142. (function(c) {
  15143. var f = function(b) {
  15144. function a() {
  15145. b.call(this);
  15146. this.__s = egret.gui.setProperties;
  15147. this.elementsContent = [this.__4_i()];
  15148. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", []), new egret.gui.State("disabled", [])]
  15149. }
  15150. __extends(a, b);
  15151. a.prototype.__4_i = function() {
  15152. var a = new egret.gui.UIAsset;
  15153. this.__s(a, ["fillMode", "percentHeight", "horizontalCenter", "source", "width"], ["scale", 100, 0, "vscrollbtn_png", 10]);
  15154. return a
  15155. };
  15156. return a
  15157. }(egret.gui.Skin);
  15158. c.VScrollBarThumbSkin = f;
  15159. f.prototype.__class__ = "skins.simple.VScrollBarThumbSkin"
  15160. })(c.simple || (c.simple = {}))
  15161. })(skins || (skins = {}));
  15162. var __extends = this.__extends || function(c, e) {
  15163. function f() {
  15164. this.constructor = c
  15165. }
  15166. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15167. f.prototype = e.prototype;
  15168. c.prototype = new f
  15169. }, VPlay = function(c) {
  15170. function e() {
  15171. c.call(this);
  15172. this.speedOffset = 0;
  15173. this._lastTime = -1;
  15174. this.bg = null;
  15175. this.currentScore = 0;
  15176. this.currentLife = 10;
  15177. this.currentBom = 0;
  15178. this.isMoveFinishedByPlayer = !1;
  15179. this.enemyBulletGroup = null;
  15180. this.temp_i = 0;
  15181. this.temp_enemy = null;
  15182. this.emenies = [];
  15183. this.temp_enemyBullet = null;
  15184. this.emenyCreatedNum = this.EFIndex = 0;
  15185. this.emenyCreateTime = 60;
  15186. this.sts = [];
  15187. this.bts = [];
  15188. this.fullBomIndex = 0;
  15189. this.bigEnemies = [];
  15190. this.skinName = "skins.coustom.PlayViewSkin";
  15191. this.touchEnabled = !1;
  15192. this.bg = new PlayBg;
  15193. this.bg.start();
  15194. Main.main.gameLayer.addChild(this.bg)
  15195. }
  15196. __extends(e, c);
  15197. e.prototype.onAdded = function(c) {
  15198. c || this.goOnGame()
  15199. };
  15200. e.prototype.partAdded = function(e, b) {
  15201. c.prototype.partAdded.call(this, e, b);
  15202. switch (b) {
  15203. case this.pauseBtn:
  15204. this.pauseBtn.touchEnabled = !0;
  15205. this.pauseBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapPauseBtn, this);
  15206. break;
  15207. case this.player:
  15208. this.player.touchEnabled = !0;
  15209. egret.Tween.get(this.player).wait(1E3).to({
  15210. y: 614
  15211. }, 1E3);
  15212. this.player.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBeginPlayer, this);
  15213. this.player.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEndPlayer, this);
  15214. break;
  15215. case this.menuGroup:
  15216. this.menuGroup.visible = !1;
  15217. this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  15218. break;
  15219. case this.gameoverGroup:
  15220. this.gameoverGroup.visible = !1;
  15221. break;
  15222. case this.goOnBtn:
  15223. this.goOnBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
  15224. break;
  15225. case this.reStartBtn:
  15226. this.reStartBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
  15227. break;
  15228. case this.restartBtn2:
  15229. this.restartBtn2.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
  15230. break;
  15231. case this.fullBomGroup:
  15232. this.fullBomGroup.touchChildren = !1;
  15233. this.fullBomGroup.touchEnabled = !0;
  15234. this.fullBomGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
  15235. break;
  15236. case this.shareToFacebookBtn:
  15237. this.shareToFacebookBtn.touchEnabled = !0;
  15238. this.shareToFacebookBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTapShare, this);
  15239. break;
  15240. case this.enemyBulletGp:
  15241. this.enemyBulletGroup = new EnemyBulletGroup, this.enemyBulletGp.addElement(this.enemyBulletGroup)
  15242. }
  15243. };
  15244. e.prototype.onTouchTapShare = function(c) {
  15245. // play68_submitScore(window.score);
  15246. };
  15247. e.prototype.onTouchTapPauseBtn = function(c) {
  15248. this.gameoverGroup.visible || (this.menuGroup.visible ? this.goOnGame() : this.pauseGame(), this.menuGroup.visible = !this.menuGroup.visible)
  15249. };
  15250. e.prototype.onTouchBeginPlayer = function(c) {
  15251. this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoveThis, this)
  15252. };
  15253. e.prototype.onTouchEndPlayer = function(c) {
  15254. this.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoveThis, this)
  15255. };
  15256. e.prototype.onTouchMoveThis = function(c) {
  15257. var b = c.stageX - this.player.width / 2,
  15258. a = c.stageY - this.player.height / 2;
  15259. 0 < b && b < this.width - this.player.width && (this.player.x = b);
  15260. 0 < a && a < this.height - this.player.height && (this.player.y = c.stageY - this.player.height / 2)
  15261. };
  15262. e.prototype.onEnterFrame = function(c) {
  15263. this.EFIndex++;
  15264. if (this.getPlayerMoveState())
  15265. if (this.bg.loop(), -1 == this._lastTime) this._lastTime = egret.getTimer();
  15266. else {
  15267. var b;
  15268. c = 0;
  15269. this.enemyBulletGroup && this.enemyBulletGroup.updata();
  15270. for (c = this.bts.length - 1; 0 <= c; c--) b = this.bts[c], b.y -= 10, Math.abs(b.y) > this.height && (this.bts.splice(c, 1), this.bulletsGroup.removeElement(b), VPlayUtil.cacheBullet.push(b));
  15271. this.emenyGroup && 0 == this.EFIndex % this.emenyCreateTime && (this.emenyCreatedNum++, 0 == this.emenyCreatedNum % 60 && (this.emenyCreateTime -= 2), this.temp_enemy = Caches.GetEmeny(), this.temp_enemy.x = Math.random() * (this.width - this.temp_enemy.width), this.temp_enemy.y = -this.temp_enemy.height, this.emenyGroup.addElement(this.temp_enemy), this.emenies.push(this.temp_enemy));
  15272. for (c = this.emenies.length - 1; 0 <= c; c--) this.temp_enemy = this.emenies[c], this.temp_enemy.y += 5, Math.abs(this.temp_enemy.y) > this.height && (this.emenies.splice(c, 1), this.temp_enemy.parent && (this.emenyGroup.removeElement(this.temp_enemy), Caches.cacheEmeny.push(this.temp_enemy)));
  15273. if (0 == this.EFIndex % 2) this._createEnemyBullet(), this.addBigEnemy(), this.bulletsGroup && 0 == this.EFIndex % 10 && (b = VPlayUtil.GetBullet(), b.x = this.player.x + this.player.width / 2, b.y = this.player.y - b.height, this.bulletsGroup.addElement(b), this.bts.push(b));
  15274. else {
  15275. this.checkHit();
  15276. this._checkHitPlayerWithEnemyBullet();
  15277. for (c = this.emenies.length - 1; 0 <= c; c--)
  15278. if (this.temp_enemy = this.emenies[c], GameUtils.hitTest(this.player, this.temp_enemy)) this.emenies.splice(c, 1), this.temp_enemy.parent && this.emenyGroup.removeElement(this.temp_enemy), Caches.cacheEmeny.push(this.temp_enemy), Main.main.showBom(this.temp_enemy.x + this.temp_enemy.width / 2, this.temp_enemy.y + this.temp_enemy.height / 2, 0.8), this._updataLife("hit");
  15279. else
  15280. for (b = this.bts.length - 1; 0 <= b; b--) {
  15281. var a = this.bts[b];
  15282. GameUtils.hitTest(this.temp_enemy, a) && (this.emenies.splice(c, 1), this.temp_enemy.parent && this.emenyGroup.removeElement(this.temp_enemy), Caches.cacheEmeny.push(this.temp_enemy), Main.main.showBom(this.temp_enemy.x + this.temp_enemy.width / 2, this.temp_enemy.y + this.temp_enemy.height / 2, 0.8), this.bts.splice(b, 1), this.bulletsGroup.removeElement(a), VPlayUtil.cacheBullet.push(a), this.addScore(100))
  15283. }
  15284. if (this.boss && this.boss.parent) {
  15285. for (c = this.bts.length - 1; 0 <= c; c--)
  15286. if (b = this.bts[c], GameUtils.hitTest(b, this.boss) && (this.bts.splice(c, 1), this.bulletsGroup.removeElement(b), VPlayUtil.cacheBullet.push(b), this.boss.life--, 1 > this.boss.life)) {
  15287. Main.main.showBom(this.boss.x, this.boss.y, 1.6);
  15288. this.emenyGroup.removeElement(this.boss);
  15289. this.boss = null;
  15290. this.addScore(1E3);
  15291. 0 == ++this.fullBomIndex % 3 && (this.currentBom++, VPlayUtil.SetImgNum(this.fullBomLabelGroup, this.currentBom, 0.3));
  15292. break
  15293. }
  15294. this.boss && GameUtils.hitTest(this.player, this.boss) && (Main.main.showBom(this.boss.x, this.boss.y, 1.6), this.emenyGroup.removeElement(this.boss), this.boss = null, this.addScore(1E3), 0 == ++this.fullBomIndex % 3 && (this.currentBom++, VPlayUtil.SetImgNum(this.fullBomLabelGroup, this.currentBom, 0.3)), this._updataLife("hit"))
  15295. }
  15296. }
  15297. }
  15298. };
  15299. e.prototype.onTouchTap = function(c) {
  15300. switch (c.target) {
  15301. case this.goOnBtn:
  15302. this.menuGroup.visible = !1;
  15303. this.goOnGame();
  15304. break;
  15305. case this.reStartBtn:
  15306. this.menuGroup.visible = !1;
  15307. this.reStartGame();
  15308. break;
  15309. case this.restartBtn2:
  15310. this.gameoverGroup.visible = !1;
  15311. this.reStartGame();
  15312. break;
  15313. case this.fullBomGroup:
  15314. if (0 < this.currentBom) {
  15315. this.currentBom--;
  15316. for (c = this.emenies.length - 1; 0 <= c; c--) {
  15317. var b = this.emenies[c];
  15318. Main.main.showBom(b.x, b.y, -0.8);
  15319. this.emenies.splice(c, 1);
  15320. b.parent && this.emenyGroup.removeElement(b);
  15321. Caches.cacheEmeny.push(b);
  15322. this.addScore(100)
  15323. }
  15324. for (c = this.bigEnemies.length - 1; 0 <= c; c--) this.bigEnemy = this.bigEnemies[c], Main.main.showBom(this.bigEnemy.x + this.bigEnemy.width / 2, this.bigEnemy.y + this.bigEnemy.height / 2, 1.6), this.bigEnemies.splice(c, 1), this.bigEnemy.parent && (this.bigEnemy.parent.removeElement(this.bigEnemy), VPlayUtil.cacheBigEmeny.push(this.bigEnemy)), this.addScore(1E3), 0 == ++this.fullBomIndex % 3 && this.currentBom++;
  15325. VPlayUtil.SetImgNum(this.lifeGroup, this.currentBom, 0.3)
  15326. }
  15327. }
  15328. };
  15329. e.prototype.onTouchTapReStart = function(c) {
  15330. this.reStartGame()
  15331. };
  15332. e.prototype.onTouchTapQuitBtn = function(c) {
  15333. this.quitGame()
  15334. };
  15335. e.prototype.overGame = function() {
  15336. this.pauseGame();
  15337. this.touchEnabled = !1
  15338. };
  15339. e.prototype.pauseGame = function() {
  15340. this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  15341. this.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoveThis, this);
  15342. this.player.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBeginPlayer, this);
  15343. this.player.removeEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEndPlayer, this);
  15344. this.pauseBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.pauseGame, this)
  15345. };
  15346. e.prototype.goOnGame = function() {
  15347. this.player.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBeginPlayer, this);
  15348. this.player.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEndPlayer, this);
  15349. this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onTouchMoveThis, this);
  15350. this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  15351. this.pauseBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.pauseGame, this)
  15352. };
  15353. e.prototype.reStartGame = function() {
  15354. this.fullBoms();
  15355. this._createEnemyBullet();
  15356. this.touchChildren = !1;
  15357. var c = Main.panelLayer.vstart;
  15358. c.touchChildren = !0;
  15359. Main.panelLayer.addPanel(c);
  15360. this.currentLife = 10;
  15361. this.currentBom = this.currentScore = 0;
  15362. VPlayUtil.SetImgNum(this.scoreGroup, this.currentScore, 0.3);
  15363. this.lifeBar.scaleX = this.currentLife / 3;
  15364. VPlayUtil.SetImgNum(this.fullBomLabelGroup, this.currentBom, 0.3)
  15365. };
  15366. e.prototype.quitGame = function() {
  15367. this.reStartGame()
  15368. };
  15369. e.prototype.addScore = function(c) {
  15370. this.currentScore += c;
  15371. VPlayUtil.SetImgNum(this.scoreGroup, this.currentScore, 0.3)
  15372. };
  15373. e.prototype.getPlayerMoveState = function() {
  15374. 120 != this.EFIndex || this.isMoveFinishedByPlayer || (this.isMoveFinishedByPlayer = !0, this.EFIndex = 1);
  15375. return this.isMoveFinishedByPlayer ? !0 : !1
  15376. };
  15377. e.prototype.checkHit = function() {
  15378. var c,
  15379. b, a;
  15380. for (b = this.bts.length - 1; 0 <= b; b--)
  15381. for (c = this.bts[b], a = this.bigEnemies.length - 1; 0 <= a; a--) this.bigEnemy = this.bigEnemies[a], GameUtils.hitTest(c, this.bigEnemy) && (this.bts.splice(b, 1), this.bulletsGroup.removeElement(c), VPlayUtil.cacheBullet.push(c), this.bigEnemy.life--, 0 >= this.bigEnemy.life && (this.bigEnemies.splice(a, 1), this.bigEmenyGroup.removeElement(this.bigEnemy), VPlayUtil.cacheBigEmeny.push(this.bigEnemy), Main.main.showBom(this.bigEnemy.x + this.bigEnemy.width / 2, this.bigEnemy.y + this.bigEnemy.height / 2, 0.8), this.addScore(1E3), 0 == ++this.fullBomIndex % 3 && (this.currentBom++, VPlayUtil.SetImgNum(this.fullBomLabelGroup, this.currentBom, 0.3))));
  15382. for (b = this.bigEnemies.length - 1; 0 <= b; b--) this.bigEnemy = this.bigEnemies[b], GameUtils.hitTest(this.player, this.bigEnemy) && (this._updataLife("hit"), this.bigEnemies.splice(a, 1), this.bigEmenyGroup.removeElement(this.bigEnemy), VPlayUtil.cacheBigEmeny.push(this.bigEnemy), Main.main.showBom(this.bigEnemy.x + this.bigEnemy.width / 2, this.bigEnemy.y + this.bigEnemy.height / 2, 0.8), this.addScore(1E3), 0 == ++this.fullBomIndex % 3 && (this.currentBom++, VPlayUtil.SetImgNum(this.fullBomLabelGroup, this.currentBom, 0.3)))
  15383. };
  15384. e.prototype.addBigEnemy = function() {
  15385. this.bigEmenyGroup && (0 == this.EFIndex % 500 && (this.bigEnemy = VPlayUtil.GetBigEmeny(), this.bigEnemy.x = Math.random() * (this.width - this.bigEnemy.width), this.bigEnemy.y = -this.bigEnemy.height, this.bigEmenyGroup.addElement(this.bigEnemy), this.bigEnemies.push(this.bigEnemy)), this.moveBigEnemy())
  15386. };
  15387. e.prototype.moveBigEnemy = function() {
  15388. for (var c = 0; c < this.bigEnemies.length; c++) this.bigEnemy = this.bigEnemies[c], this.bigEnemy.y += 2, this.bigEnemy.y > this.height && (this.bigEnemies.splice(c, 1), this.bigEmenyGroup.removeElement(this.bigEnemy), VPlayUtil.cacheBigEmeny.push(this.bigEnemy))
  15389. };
  15390. e.prototype.fullBoms = function() {
  15391. for (var c = this.emenies.length - 1; 0 <= c; c--) {
  15392. var b = this.emenies[c];
  15393. this.emenies.splice(c, 1);
  15394. this.emenyGroup.removeElement(b);
  15395. Caches.cacheEmeny.push(b);
  15396. this.addScore(100)
  15397. }
  15398. for (c = this.bigEnemies.length - 1; 0 <= c; c--) this.bigEnemy = this.bigEnemies[c],
  15399. this.bigEnemies.splice(c, 1), this.bigEmenyGroup.removeElement(this.bigEnemy), VPlayUtil.cacheBigEmeny.push(this.bigEnemy), this.addScore(1E3)
  15400. };
  15401. e.prototype._createEnemyBullet = function() {
  15402. if (0 == this.EFIndex % 60)
  15403. for (this.temp_i = this.bigEnemies.length - 1; 0 <= this.temp_i; this.temp_i--) this.bigEnemy = this.bigEnemies[this.temp_i], this.enemyBulletGroup.create(this.bigEnemy.x + this.bigEnemy.width / 2, this.bigEnemy.y + this.bigEnemy.height);
  15404. if (0 == this.EFIndex % 120) {
  15405. var c = this.emenies.length;
  15406. c && (this.temp_enemy = this.emenies[Math.floor(Math.random() * c)], this.enemyBulletGroup.create(this.temp_enemy.x + this.temp_enemy.width / 2, this.temp_enemy.y + this.temp_enemy.height))
  15407. }
  15408. };
  15409. e.prototype._checkHitPlayerWithEnemyBullet = function() {
  15410. var c = this.enemyBulletGroup.enemyBullets;
  15411. for (this.temp_i = c.length - 1; 0 <= this.temp_i; this.temp_i--) this.temp_enemyBullet = c[this.temp_i], GameUtils.hitTest(this.player, this.temp_enemyBullet) && (this.enemyBulletGroup.clearItem(this.temp_i), this._updataLife("hit"))
  15412. };
  15413. e.prototype._updataLife = function(c) {
  15414. "hit" == c && (0 < this.currentLife && this.currentLife--, 0 == this.currentLife && (this.gameoverGroup.visible = !0,submit_score(this.currentScore), VPlayUtil.SetImgNum(this.gameoverScoreGroup, this.currentScore, 0.3), this.overGame()), this.lifeBar.scaleX = this.currentLife / 3)
  15415. };
  15416. e.prototype.tikerHandler = function() {
  15417. GameUtils.debug("tiker")
  15418. };
  15419. return e
  15420. }(GuiContainer);
  15421. VPlay.prototype.__class__ = "VPlay";
  15422. var AssetAdapter = function() {
  15423. function c() {}
  15424. c.prototype.getAsset = function(c, f, b, a) {
  15425. function d(a) {
  15426. f.call(b, a, c)
  15427. }
  15428. a = c;
  15429. c.prototype && (a = new c);
  15430. a instanceof egret.DisplayObject || a instanceof egret.Texture ? f.call(b, a, c) : "string" == typeof c ? RES.hasRes(c) ? RES.getResAsync(c, d, this) : RES.getResByUrl(c, d, this) : f.call(b, a, c)
  15431. };
  15432. return c
  15433. }();
  15434. AssetAdapter.prototype.__class__ = "AssetAdapter";
  15435. var __extends = this.__extends || function(c, e) {
  15436. function f() {
  15437. this.constructor = c
  15438. }
  15439. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15440. f.prototype = e.prototype;
  15441. c.prototype = new f
  15442. }, LoadingUI = function(c) {
  15443. function e() {
  15444. c.call(this);
  15445. this.createView()
  15446. }
  15447. __extends(e, c);
  15448. e.prototype.createView = function() {
  15449. this.textField = new egret.TextField;
  15450. this.addChild(this.textField);
  15451. this.textField.y = 300;
  15452. this.textField.width = 480;
  15453. this.textField.height = 100;
  15454. this.textField.textAlign = "center"
  15455. };
  15456. e.prototype.setProgress = function(c, b) {
  15457. this.textField.text = "资源加载中..." + c + "/" + b
  15458. };
  15459. return e
  15460. }(egret.Sprite);
  15461. LoadingUI.prototype.__class__ = "LoadingUI";
  15462. var __extends = this.__extends || function(c, e) {
  15463. function f() {
  15464. this.constructor = c
  15465. }
  15466. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15467. f.prototype = e.prototype;
  15468. c.prototype = new f
  15469. }, CBomb = function(c) {
  15470. function e() {
  15471. c.call(this)
  15472. }
  15473. __extends(e, c);
  15474. e.prototype.showbomb = function(c, b, a) {
  15475. var d = RES.getRes(c);
  15476. b = RES.getRes(b);
  15477. this.standmc = new egret.MovieClip(d, b);
  15478. this.standmc.frameRate = 20;
  15479. this.standmc.gotoAndPlay(a);
  15480. this.addChild(this.standmc);
  15481. this.standmc.addEventListener(egret.Event.COMPLETE, this.removeBomb, this);
  15482. this.standmc.frameRate = "tc_json" == c ? 10 : 20
  15483. };
  15484. e.prototype.removeBomb = function(c) {
  15485. this.standmc.removeEventListener(egret.Event.COMPLETE, this.removeBomb, this);
  15486. null != this.standmc && null != this.standmc.parent && (this.standmc.dispose(), this.removeChild(this.standmc), this.standmc = null)
  15487. };
  15488. return e
  15489. }(egret.Sprite);
  15490. CBomb.prototype.__class__ = "CBomb";
  15491. var __extends = this.__extends || function(c, e) {
  15492. function f() {
  15493. this.constructor = c
  15494. }
  15495. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15496. f.prototype = e.prototype;
  15497. c.prototype = new f
  15498. }, PanelLayer = function(c) {
  15499. function e() {
  15500. c.call(this)
  15501. }
  15502. __extends(e, c);
  15503. Object.defineProperty(e.prototype, "vstart", {
  15504. get: function() {
  15505. this._vstart || (this._vstart = new VStart);
  15506. return this._vstart
  15507. },
  15508. enumerable: !0,
  15509. configurable: !0
  15510. });
  15511. Object.defineProperty(e.prototype, "hasVplay", {
  15512. get: function() {
  15513. return this._vplay ? !1 : !0
  15514. },
  15515. enumerable: !0,
  15516. configurable: !0
  15517. });
  15518. Object.defineProperty(e.prototype, "vplay", {
  15519. get: function() {
  15520. this._vplay || (this._vplay = new VPlay);
  15521. return this._vplay
  15522. },
  15523. enumerable: !0,
  15524. configurable: !0
  15525. });
  15526. e.prototype.addPanel = function(c, b) {
  15527. void 0 === b && (b = !1);
  15528. null != c && (this.currentPanel && (this.currentPanel.dispose(), this.removeElement(this.currentPanel)), this.currentPanel = c, this.addElement(c), c.onAdded(b))
  15529. };
  15530. return e
  15531. }(egret.gui.UIStage);
  15532. PanelLayer.prototype.__class__ = "PanelLayer";
  15533. __extends = this.__extends || function(c, e) {
  15534. function f() {
  15535. this.constructor = c
  15536. }
  15537. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15538. f.prototype = e.prototype;
  15539. c.prototype = new f
  15540. };
  15541. (function(c) {
  15542. (function(c) {
  15543. var f = function(b) {
  15544. function a() {
  15545. b.call(this);
  15546. this.__s = egret.gui.setProperties;
  15547. this.elementsContent = [this.__4_i(), this.labelDisplay_i()];
  15548. this.states = [new egret.gui.State("up", [new egret.gui.SetProperty("labelDisplay", "textColor", 1118481)]), new egret.gui.State("down", [new egret.gui.SetProperty("__4", "source", "closebtn_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__4", "source", "closebtn_disabled_png"),
  15549. new egret.gui.SetProperty("labelDisplay", "textColor", 13421772)
  15550. ])]
  15551. }
  15552. __extends(a, b);
  15553. Object.defineProperty(a.prototype, "skinParts", {
  15554. get: function() {
  15555. return a._skinParts
  15556. },
  15557. enumerable: !0,
  15558. configurable: !0
  15559. });
  15560. a.prototype.labelDisplay_i = function() {
  15561. var a = new egret.gui.Label;
  15562. this.labelDisplay = a;
  15563. this.__s(a, "bottom fontFamily left right size textAlign top verticalAlign".split(" "), [12, "Tahoma", 10, 10, 20, "center", 8, "middle"]);
  15564. return a
  15565. };
  15566. a.prototype.__4_i = function() {
  15567. var a = new egret.gui.UIAsset;
  15568. this.__4 = a;
  15569. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "closebtn_up_png", 100]);
  15570. return a
  15571. };
  15572. a._skinParts = ["labelDisplay"];
  15573. return a
  15574. }(egret.gui.Skin);
  15575. c.CloseButtonSkin = f;
  15576. f.prototype.__class__ = "skins.simple.CloseButtonSkin"
  15577. })(c.simple || (c.simple = {}))
  15578. })(skins || (skins = {}));
  15579. __extends = this.__extends || function(c, e) {
  15580. function f() {
  15581. this.constructor = c
  15582. }
  15583. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15584. f.prototype = e.prototype;
  15585. c.prototype = new f
  15586. };
  15587. (function(c) {
  15588. (function(c) {
  15589. var f = function(b) {
  15590. function a() {
  15591. b.call(this);
  15592. this.__s = egret.gui.setProperties;
  15593. this.height = 40;
  15594. this.elementsContent = [this.__4_i(), this.__5_i(), this.labelDisplay_i()];
  15595. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__4", "source", "app_list_item_select_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 15790320)]), new egret.gui.State("disabled", [])]
  15596. }
  15597. __extends(a, b);
  15598. Object.defineProperty(a.prototype, "skinParts", {
  15599. get: function() {
  15600. return a._skinParts
  15601. },
  15602. enumerable: !0,
  15603. configurable: !0
  15604. });
  15605. a.prototype.__5_i = function() {
  15606. var a = new egret.gui.UIAsset;
  15607. this.__s(a, ["height", "source", "percentWidth"], [1, "app_list_item_cutlline_png", 100]);
  15608. return a
  15609. };
  15610. a.prototype.labelDisplay_i = function() {
  15611. var a = new egret.gui.Label;
  15612. this.labelDisplay = a;
  15613. this.__s(a, ["fontFamily", "left", "size", "textColor", "verticalCenter"], ["Tahoma", 32, 24, 1118481, 0]);
  15614. return a
  15615. };
  15616. a.prototype.__4_i = function() {
  15617. var a = new egret.gui.UIAsset;
  15618. this.__4 = a;
  15619. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "app_list_item_up_png",
  15620. 100
  15621. ]);
  15622. return a
  15623. };
  15624. a._skinParts = ["labelDisplay"];
  15625. return a
  15626. }(egret.gui.Skin);
  15627. c.DropDownListItemRendererSkin = f;
  15628. f.prototype.__class__ = "skins.simple.DropDownListItemRendererSkin"
  15629. })(c.simple || (c.simple = {}))
  15630. })(skins || (skins = {}));
  15631. __extends = this.__extends || function(c, e) {
  15632. function f() {
  15633. this.constructor = c
  15634. }
  15635. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15636. f.prototype = e.prototype;
  15637. c.prototype = new f
  15638. };
  15639. (function(c) {
  15640. (function(c) {
  15641. var f = function(b) {
  15642. function a() {
  15643. b.call(this);
  15644. this.__s = egret.gui.setProperties;
  15645. this.__s(this, ["height", "minWidth"], [60, 140]);
  15646. this.elementsContent = [this.__4_i(), this.__5_i()];
  15647. this.states = [new egret.gui.State("up", [new egret.gui.SetProperty("__5", "source", "dropdownlist_arrow_up_png")]), new egret.gui.State("down", [new egret.gui.SetProperty("__4", "source", "DropDownListButtonSkin_down_png"), new egret.gui.SetProperty("__5", "source", "dropdownlist_arrow_down_png")]), new egret.gui.State("disabled", [])]
  15648. }
  15649. __extends(a, b);
  15650. a.prototype.__4_i = function() {
  15651. var a = new egret.gui.UIAsset;
  15652. this.__4 = a;
  15653. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "DropDownListButtonSkin_up_png", 100]);
  15654. return a
  15655. };
  15656. a.prototype.__5_i = function() {
  15657. var a = new egret.gui.UIAsset;
  15658. this.__5 = a;
  15659. this.__s(a, ["right", "verticalCenter"], [4, 0]);
  15660. return a
  15661. };
  15662. return a
  15663. }(egret.gui.Skin);
  15664. c.DropDownListOpenButtonSkin = f;
  15665. f.prototype.__class__ = "skins.simple.DropDownListOpenButtonSkin"
  15666. })(c.simple || (c.simple = {}))
  15667. })(skins || (skins = {}));
  15668. __extends = this.__extends || function(c, e) {
  15669. function f() {
  15670. this.constructor = c
  15671. }
  15672. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15673. f.prototype = e.prototype;
  15674. c.prototype = new f
  15675. };
  15676. (function(c) {
  15677. (function(e) {
  15678. var f = function(b) {
  15679. function a() {
  15680. b.call(this);
  15681. this.__s = egret.gui.setProperties;
  15682. this.__s(this, ["minHeight", "minWidth"], [10, 20]);
  15683. this.elementsContent = [this.track_i(), this.thumb_i()];
  15684. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  15685. }
  15686. __extends(a, b);
  15687. Object.defineProperty(a.prototype, "skinParts", {
  15688. get: function() {
  15689. return a._skinParts
  15690. },
  15691. enumerable: !0,
  15692. configurable: !0
  15693. });
  15694. a.prototype.thumb_i = function() {
  15695. var a = new egret.gui.Button;
  15696. this.thumb = a;
  15697. this.__s(a, ["height", "skinName", "verticalCenter", "width"], [10, c.simple.HScrollBarThumbSkin, 0, 24]);
  15698. return a
  15699. };
  15700. a.prototype.track_i = function() {
  15701. var a = new egret.gui.UIAsset;
  15702. this.track = a;
  15703. this.__s(a, "height left right source verticalCenter percentWidth".split(" "), [10, 10, 10, "hscrolltrack_png", 0, 100]);
  15704. return a
  15705. };
  15706. a._skinParts = ["track", "thumb"];
  15707. return a
  15708. }(egret.gui.Skin);
  15709. e.HScrollBarSkin = f;
  15710. f.prototype.__class__ = "skins.simple.HScrollBarSkin"
  15711. })(c.simple || (c.simple = {}))
  15712. })(skins || (skins = {}));
  15713. __extends = this.__extends || function(c, e) {
  15714. function f() {
  15715. this.constructor = c
  15716. }
  15717. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15718. f.prototype = e.prototype;
  15719. c.prototype = new f
  15720. };
  15721. (function(c) {
  15722. (function(c) {
  15723. var f = function(b) {
  15724. function a() {
  15725. b.call(this);
  15726. this.__s = egret.gui.setProperties;
  15727. this.elementsContent = [this.__4_i()];
  15728. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", []), new egret.gui.State("disabled", [])]
  15729. }
  15730. __extends(a, b);
  15731. a.prototype.__4_i = function() {
  15732. var a = new egret.gui.UIAsset;
  15733. this.__s(a, ["fillMode", "percentHeight", "source", "percentWidth"], ["scale", 100, "hslider_thumb_png", 100]);
  15734. return a
  15735. };
  15736. return a
  15737. }(egret.gui.Skin);
  15738. c.HSliderThumbSkin = f;
  15739. f.prototype.__class__ = "skins.simple.HSliderThumbSkin"
  15740. })(c.simple || (c.simple = {}))
  15741. })(skins || (skins = {}));
  15742. __extends = this.__extends || function(c, e) {
  15743. function f() {
  15744. this.constructor = c
  15745. }
  15746. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15747. f.prototype = e.prototype;
  15748. c.prototype = new f
  15749. };
  15750. (function(c) {
  15751. (function(c) {
  15752. var f = function(b) {
  15753. function a() {
  15754. b.call(this);
  15755. this.__s = egret.gui.setProperties;
  15756. this.__s(this, ["height", "minWidth"], [60, 140]);
  15757. this.elementsContent = [this.__7_i(), this.labelDisplay_i()];
  15758. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__7", "source", "button_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__7", "source", "button_disabled_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 13421772)]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__7", "source", "button_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)]), new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__7", "source", "button_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__7", "source", "button_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)])]
  15759. }
  15760. __extends(a, b);
  15761. Object.defineProperty(a.prototype, "skinParts", {
  15762. get: function() {
  15763. return a._skinParts
  15764. },
  15765. enumerable: !0,
  15766. configurable: !0
  15767. });
  15768. a.prototype.labelDisplay_i = function() {
  15769. var a = new egret.gui.Label;
  15770. this.labelDisplay = a;
  15771. this.__s(a, "bottom fontFamily left right size textAlign textColor top verticalAlign".split(" "), [12, "Tahoma", 10, 10, 20, "center", 1118481, 8, "middle"]);
  15772. return a
  15773. };
  15774. a.prototype.__7_i = function() {
  15775. var a = new egret.gui.UIAsset;
  15776. this.__7 = a;
  15777. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "button_normal_png", 100]);
  15778. return a
  15779. };
  15780. a._skinParts = ["labelDisplay"];
  15781. return a
  15782. }(egret.gui.Skin);
  15783. c.TabBarButtonSkin = f;
  15784. f.prototype.__class__ = "skins.simple.TabBarButtonSkin"
  15785. })(c.simple || (c.simple = {}))
  15786. })(skins || (skins = {}));
  15787. __extends = this.__extends || function(c, e) {
  15788. function f() {
  15789. this.constructor = c
  15790. }
  15791. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15792. f.prototype = e.prototype;
  15793. c.prototype = new f
  15794. };
  15795. (function(c) {
  15796. (function(e) {
  15797. var f = function(b) {
  15798. function a() {
  15799. b.call(this);
  15800. this.__s = egret.gui.setProperties;
  15801. this.minHeight = 22;
  15802. this.elementsContent = [this.contentGroup_i()];
  15803. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", []), new egret.gui.State("disabled", [])]
  15804. }
  15805. __extends(a, b);
  15806. Object.defineProperty(a.prototype, "skinParts", {
  15807. get: function() {
  15808. return a._skinParts
  15809. },
  15810. enumerable: !0,
  15811. configurable: !0
  15812. });
  15813. a.prototype.contentGroup_i = function() {
  15814. var a = new egret.gui.Group;
  15815. this.contentGroup = a;
  15816. this.__s(a, ["bottom", "top"], [0, 0]);
  15817. a.layout = this.__4_i();
  15818. a.elementsContent = [this.disclosureButton_i(), this.iconDisplay_i(), this.labelDisplay_i()];
  15819. return a
  15820. };
  15821. a.prototype.disclosureButton_i = function() {
  15822. var a = new egret.gui.ToggleButton;
  15823. this.disclosureButton = a;
  15824. this.__s(a, ["skinName", "verticalCenter"], [c.simple.TreeDisclosureButtonSkin, 0]);
  15825. return a
  15826. };
  15827. a.prototype.iconDisplay_i = function() {
  15828. var a = new egret.gui.UIAsset;
  15829. this.iconDisplay = a;
  15830. this.__s(a, ["height", "width"], [24, 24]);
  15831. return a
  15832. };
  15833. a.prototype.labelDisplay_i = function() {
  15834. var a = new egret.gui.Label;
  15835. this.labelDisplay = a;
  15836. this.__s(a, "bottom fontFamily left maxDisplayedLines right textAlign textColor top verticalAlign".split(" "), [3, "Tahoma", 5, 1, 5, "center", 7368816, 3, "middle"]);
  15837. return a
  15838. };
  15839. a.prototype.__4_i = function() {
  15840. var a = new egret.gui.HorizontalLayout;
  15841. this.__s(a, ["gap", "verticalAlign"], [1, "middle"]);
  15842. return a
  15843. };
  15844. a._skinParts = ["disclosureButton", "iconDisplay", "labelDisplay", "contentGroup"];
  15845. return a
  15846. }(egret.gui.Skin);
  15847. e.TreeItemRendererSkin = f;
  15848. f.prototype.__class__ = "skins.simple.TreeItemRendererSkin"
  15849. })(c.simple || (c.simple = {}))
  15850. })(skins || (skins = {}));
  15851. __extends = this.__extends || function(c, e) {
  15852. function f() {
  15853. this.constructor = c
  15854. }
  15855. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15856. f.prototype = e.prototype;
  15857. c.prototype = new f
  15858. };
  15859. (function(c) {
  15860. (function(e) {
  15861. var f = function(b) {
  15862. function a() {
  15863. b.call(this);
  15864. this.__s = egret.gui.setProperties;
  15865. this.__s(this, ["minHeight", "minWidth"], [10, 10]);
  15866. this.elementsContent = [this.track_i(), this.thumb_i()];
  15867. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  15868. }
  15869. __extends(a, b);
  15870. Object.defineProperty(a.prototype, "skinParts", {
  15871. get: function() {
  15872. return a._skinParts
  15873. },
  15874. enumerable: !0,
  15875. configurable: !0
  15876. });
  15877. a.prototype.thumb_i = function() {
  15878. var a = new egret.gui.Button;
  15879. this.thumb = a;
  15880. this.__s(a, ["height", "horizontalCenter", "skinName", "width"], [20, 0, c.simple.VScrollBarThumbSkin, 10]);
  15881. return a
  15882. };
  15883. a.prototype.track_i = function() {
  15884. var a = new egret.gui.UIAsset;
  15885. this.track = a;
  15886. this.__s(a, "bottom percentHeight horizontalCenter source top width".split(" "), [10, 100, 0, "vscrolltrack_png", 10, 10]);
  15887. return a
  15888. };
  15889. a._skinParts = ["track", "thumb"];
  15890. return a
  15891. }(egret.gui.Skin);
  15892. e.VScrollBarSkin = f;
  15893. f.prototype.__class__ = "skins.simple.VScrollBarSkin"
  15894. })(c.simple || (c.simple = {}))
  15895. })(skins || (skins = {}));
  15896. __extends = this.__extends || function(c, e) {
  15897. function f() {
  15898. this.constructor = c
  15899. }
  15900. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15901. f.prototype = e.prototype;
  15902. c.prototype = new f
  15903. };
  15904. (function(c) {
  15905. (function(c) {
  15906. var f = function(b) {
  15907. function a() {
  15908. b.call(this);
  15909. this.__s = egret.gui.setProperties;
  15910. this.elementsContent = [this.__4_i()];
  15911. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", []), new egret.gui.State("disabled", [])]
  15912. }
  15913. __extends(a, b);
  15914. a.prototype.__4_i = function() {
  15915. var a = new egret.gui.UIAsset;
  15916. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "vslider_thumb_png", 100]);
  15917. return a
  15918. };
  15919. return a
  15920. }(egret.gui.Skin);
  15921. c.VSliderThumbSkin = f;
  15922. f.prototype.__class__ = "skins.simple.VSliderThumbSkin"
  15923. })(c.simple || (c.simple = {}))
  15924. })(skins || (skins = {}));
  15925. var __extends = this.__extends || function(c, e) {
  15926. function f() {
  15927. this.constructor = c
  15928. }
  15929. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15930. f.prototype = e.prototype;
  15931. c.prototype = new f
  15932. }, Main = function(c) {
  15933. function e() {
  15934. c.call(this);
  15935. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  15936. }
  15937. __extends(e, c);
  15938. e.prototype.onAddToStage = function(c) {
  15939. egret.Injector.mapClass("egret.gui.IAssetAdapter", AssetAdapter);
  15940. egret.gui.Theme.load("resource/theme.thm");
  15941. this.loadingView = new LoadingUI;
  15942. this.stage.addChild(this.loadingView);
  15943. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  15944. RES.loadConfig("resource/resource.json", "resource/")
  15945. };
  15946. e.prototype.onConfigComplete = function(c) {
  15947. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  15948. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  15949. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  15950. RES.loadGroup("preload")
  15951. };
  15952. e.prototype.onResourceLoadComplete = function(c) {
  15953. "preload" == c.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createScene())
  15954. };
  15955. e.prototype.onResourceProgress = function(c) {
  15956. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  15957. };
  15958. e.prototype.createScene = function() {
  15959. e.main = this;
  15960. this.gameLayer = new egret.DisplayObjectContainer;
  15961. this.addChild(this.gameLayer);
  15962. e.panelLayer = new PanelLayer;
  15963. this.addChild(e.panelLayer);
  15964. e.panelLayer.addPanel(e.panelLayer.vstart)
  15965. };
  15966. e.prototype.showBom = function(c, b, a) {
  15967. void 0 === a && (a = 1);
  15968. var d = new CBomb;
  15969. d.showbomb("tc_json", "tc_png", "action");
  15970. this.addChild(d);
  15971. d.anchorX = 0.5;
  15972. d.anchorY = 0.5;
  15973. d.x = c;
  15974. d.y = b;
  15975. d.scaleX = a;
  15976. d.scaleY = a
  15977. };
  15978. return e
  15979. }(egret.DisplayObjectContainer);
  15980. Main.prototype.__class__ = "Main";
  15981. __extends = this.__extends || function(c, e) {
  15982. function f() {
  15983. this.constructor = c
  15984. }
  15985. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  15986. f.prototype = e.prototype;
  15987. c.prototype = new f
  15988. };
  15989. (function(c) {
  15990. (function(c) {
  15991. var f = function(b) {
  15992. function a() {
  15993. b.call(this);
  15994. this.__s = egret.gui.setProperties;
  15995. this.__s(this, ["height", "width"], [800, 480]);
  15996. this.elementsContent = [this.__3_i(), this.__4_i(), this.lifeBar_i(), this.pauseBtn_i(), this.player_i(), this.bulletsGroup_i(), this.emenyGroup_i(), this.bigEmenyGroup_i(), this.enemyBulletGp_i(), this.menuGroup_i(), this.lifeGroup_i(), this.scoreGroup_i(), this.fullBomGroup_i(), this.gameoverGroup_i()];
  15997. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  15998. }
  15999. __extends(a, b);
  16000. Object.defineProperty(a.prototype, "skinParts", {
  16001. get: function() {
  16002. return a._skinParts
  16003. },
  16004. enumerable: !0,
  16005. configurable: !0
  16006. });
  16007. a.prototype.__11_i = function() {
  16008. var a = new egret.gui.UIAsset;
  16009. this.__s(a, ["scaleX", "scaleY", "source", "x", "y"], [0.3, 0.3, "imgFont0", 0, 0]);
  16010. return a
  16011. };
  16012. a.prototype.__12_i = function() {
  16013. var a = new egret.gui.UIAsset;
  16014. this.__s(a, ["source", "x", "y"], ["over_jpg", 0, 0]);
  16015. return a
  16016. };
  16017. a.prototype.__13_i = function() {
  16018. return new egret.gui.HorizontalLayout
  16019. };
  16020. a.prototype.__14_i = function() {
  16021. return new egret.gui.HorizontalLayout
  16022. };
  16023. a.prototype.__3_i = function() {
  16024. var a = new egret.gui.UIAsset;
  16025. this.__s(a, ["height", "source", "width", "x", "y"], [30, "player_png", 46, 16, 40]);
  16026. return a
  16027. };
  16028. a.prototype.__4_i = function() {
  16029. var a = new egret.gui.UIAsset;
  16030. this.__s(a, ["source", "x", "y"], ["lfieBg_png", 12, 14]);
  16031. return a
  16032. };
  16033. a.prototype.__5_i = function() {
  16034. var a = new egret.gui.VerticalLayout;
  16035. a.gap = 30;
  16036. return a
  16037. };
  16038. a.prototype.__6_i = function() {
  16039. var a = new egret.gui.Group;
  16040. this.__s(a, ["height", "horizontalCenter", "verticalCenter", "width"], [160, 0.5, 41, 189]);
  16041. a.layout = this.__5_i();
  16042. a.elementsContent = [this.goOnBtn_i(), this.reStartBtn_i()];
  16043. return a
  16044. };
  16045. a.prototype.__7_i = function() {
  16046. return new egret.gui.HorizontalLayout
  16047. };
  16048. a.prototype.__8_i = function() {
  16049. return new egret.gui.HorizontalLayout
  16050. };
  16051. a.prototype.__9_i = function() {
  16052. var a = new egret.gui.UIAsset;
  16053. this.__s(a, ["scaleX", "scaleY", "source", "x", "y"], [0.3, 0.3, "imgFont0", 27, 21]);
  16054. return a
  16055. };
  16056. a.prototype.bigEmenyGroup_i = function() {
  16057. var a = new egret.gui.Group;
  16058. this.bigEmenyGroup = a;
  16059. this.__s(a, ["height", "width", "x", "y"], [200, 200, 0, 0]);
  16060. return a
  16061. };
  16062. a.prototype.bulletsGroup_i = function() {
  16063. var a = new egret.gui.Group;
  16064. this.bulletsGroup = a;
  16065. this.__s(a, ["height", "width", "x", "y"], [43, 47, 0, 0]);
  16066. return a
  16067. };
  16068. a.prototype.emenyGroup_i = function() {
  16069. var a = new egret.gui.Group;
  16070. this.emenyGroup = a;
  16071. this.__s(a, ["height", "width", "x", "y"], [200, 200, 0, 0]);
  16072. return a
  16073. };
  16074. a.prototype.enemyBulletGp_i = function() {
  16075. var a = new egret.gui.Group;
  16076. this.enemyBulletGp = a;
  16077. this.__s(a, ["height", "width", "x", "y"], [200, 200, 0, 0]);
  16078. return a
  16079. };
  16080. a.prototype.fullBomGroup_i = function() {
  16081. var a = new egret.gui.Group;
  16082. this.fullBomGroup = a;
  16083. this.__s(a, ["x", "y"], [371, 738]);
  16084. a.elementsContent = [this.__10_i(), this.fullBomLabelGroup_i()];
  16085. return a
  16086. };
  16087. a.prototype.fullBomLabelGroup_i = function() {
  16088. var a = new egret.gui.Group;
  16089. this.fullBomLabelGroup = a;
  16090. this.__s(a, ["height", "width", "x", "y"], [44, 44, 63, 11]);
  16091. a.elementsContent = [this.__11_i()];
  16092. return a
  16093. };
  16094. a.prototype.gameoverGroup_i = function() {
  16095. var a = new egret.gui.Group;
  16096. this.gameoverGroup = a;
  16097. this.__s(a, ["bottom", "left", "right", "top", "visible"], [0, 0, 0, 0, !1]);
  16098. a.elementsContent = [this.__12_i(), this.shareToFacebookBtn_i(), this.restartBtn2_i(),
  16099. this.gameoverScoreGroup_i(), this.gameoverHighScoreGroup_i()
  16100. ];
  16101. return a
  16102. };
  16103. a.prototype.gameoverHighScoreGroup_i = function() {
  16104. var a = new egret.gui.Group;
  16105. this.gameoverHighScoreGroup = a;
  16106. this.__s(a, ["height", "width", "x", "y"], [38, 149, 262, 530]);
  16107. a.layout = this.__14_i();
  16108. return a
  16109. };
  16110. a.prototype.gameoverScoreGroup_i = function() {
  16111. var a = new egret.gui.Group;
  16112. this.gameoverScoreGroup = a;
  16113. this.__s(a, ["height", "width", "x", "y"], [51, 200,262, 449]);
  16114. a.layout = this.__13_i();
  16115. return a
  16116. };
  16117. a.prototype.goOnBtn_i = function() {
  16118. var a = new egret.gui.UIAsset;
  16119. this.goOnBtn = a;
  16120. this.__s(a, ["source", "x", "y"], ["goon_png", 134, 101]);
  16121. return a
  16122. };
  16123. a.prototype.lifeBar_i = function() {
  16124. var a = new egret.gui.UIAsset;
  16125. this.lifeBar = a;
  16126. this.__s(a, ["source", "x", "y"], ["lfieBar_png", 68, 20]);
  16127. return a
  16128. };
  16129. a.prototype.lifeGroup_i = function() {
  16130. var a = new egret.gui.Group;
  16131. this.lifeGroup = a;
  16132. this.__s(a, ["height", "width", "x", "y"], [48, 59, 339, 13]);
  16133. a.layout = this.__7_i();
  16134. return a
  16135. };
  16136. a.prototype.menuGroup_i = function() {
  16137. var a = new egret.gui.Group;
  16138. this.menuGroup = a;
  16139. this.__s(a, ["height", "horizontalCenter", "width", "y"], [360, 0, 292, 144]);
  16140. a.elementsContent = [this.__6_i()];
  16141. return a
  16142. };
  16143. a.prototype.pauseBtn_i = function() {
  16144. var a = new egret.gui.UIAsset;
  16145. this.pauseBtn = a;
  16146. this.__s(a, ["left", "source", "top"], [405, "pause_png", 9]);
  16147. return a
  16148. };
  16149. a.prototype.player_i = function() {
  16150. var a = new egret.gui.UIAsset;
  16151. this.player = a;
  16152. this.__s(a, ["source", "x", "y"], ["player_png", 164, 866]);
  16153. return a
  16154. };
  16155. a.prototype.reStartBtn_i = function() {
  16156. var a = new egret.gui.UIAsset;
  16157. this.reStartBtn = a;
  16158. this.__s(a, ["source", "x", "y"], ["restart_png", 58, 101]);
  16159. return a
  16160. };
  16161. a.prototype.restartBtn2_i = function() {
  16162. var a = new egret.gui.UIAsset;
  16163. this.restartBtn2 = a;
  16164. this.__s(a, ["horizontalCenter", "source", "width", "y"], [94, "restart_png", 190, 610]);
  16165. return a
  16166. };
  16167. a.prototype.scoreGroup_i = function() {
  16168. var a = new egret.gui.Group;
  16169. this.scoreGroup = a;
  16170. this.__s(a, ["height", "width", "x", "y"], [48, 175, 72, 39]);
  16171. a.layout = this.__8_i();
  16172. a.elementsContent = [this.__9_i()];
  16173. return a
  16174. };
  16175. a.prototype.shareToFacebookBtn_i = function() {
  16176. var a = new egret.gui.UIAsset;
  16177. this.shareToFacebookBtn = a;
  16178. this.__s(a, ["height", "horizontalCenter", "source", "width", "y"], [62, -93, "facebooklogo_png", 190, 610]);
  16179. return a
  16180. };
  16181. a.prototype.__10_i = function() {
  16182. var a = new egret.gui.UIAsset;
  16183. this.__s(a, ["source", "x", "y"], ["lifeLogo_png", 0, -6]);
  16184. return a
  16185. };
  16186. a._skinParts = "lifeBar pauseBtn player bulletsGroup emenyGroup bigEmenyGroup enemyBulletGp goOnBtn reStartBtn menuGroup lifeGroup scoreGroup fullBomLabelGroup fullBomGroup shareToFacebookBtn restartBtn2 gameoverScoreGroup gameoverHighScoreGroup gameoverGroup".split(" ");
  16187. return a
  16188. }(egret.gui.Skin);
  16189. c.PlayViewSkin = f;
  16190. f.prototype.__class__ = "skins.coustom.PlayViewSkin"
  16191. })(c.coustom || (c.coustom = {}))
  16192. })(skins || (skins = {}));
  16193. __extends = this.__extends || function(c, e) {
  16194. function f() {
  16195. this.constructor = c
  16196. }
  16197. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16198. f.prototype = e.prototype;
  16199. c.prototype = new f
  16200. };
  16201. (function(c) {
  16202. (function(c) {
  16203. var f = function(b) {
  16204. function a() {
  16205. b.call(this);
  16206. this.__s = egret.gui.setProperties;
  16207. this.__s(this, ["height", "width"], [800, 480]);
  16208. this.elementsContent = [this.__3_i(), this.playIntroduce_i(), this.startGameBtn_i(), this.introducer_i()];
  16209. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16210. }
  16211. __extends(a, b);
  16212. Object.defineProperty(a.prototype, "skinParts", {
  16213. get: function() {
  16214. return a._skinParts
  16215. },
  16216. enumerable: !0,
  16217. configurable: !0
  16218. });
  16219. a.prototype.__4_i = function() {
  16220. var a = new egret.gui.UIAsset;
  16221. this.__s(a, ["source", "x", "y"], ["introducer_png", 0, 0]);
  16222. return a
  16223. };
  16224. a.prototype.iReturn_i = function() {
  16225. var a = new egret.gui.UIAsset;
  16226. this.iReturn = a;
  16227. this.__s(a, ["source", "x", "y"], ["ireturn_png", 39, 674]);
  16228. return a
  16229. };
  16230. a.prototype.iStart_i = function() {
  16231. var a = new egret.gui.UIAsset;
  16232. this.iStart = a;
  16233. this.__s(a, ["source", "x", "y"], ["startButton_png", 262, 673]);
  16234. return a
  16235. };
  16236. a.prototype.introducer_i = function() {
  16237. var a = new egret.gui.Group;
  16238. this.introducer = a;
  16239. this.__s(a, ["bottom", "left", "right", "top", "visible"], [0, 0, 0, 0, !1]);
  16240. a.elementsContent = [this.__4_i(), this.iReturn_i(), this.iStart_i()];
  16241. return a
  16242. };
  16243. a.prototype.playIntroduce_i = function() {
  16244. var a = new egret.gui.UIAsset;
  16245. this.playIntroduce = a;
  16246. this.__s(a, ["source", "x", "y"], ["rules_png", 44, 591]);
  16247. return a
  16248. };
  16249. a.prototype.__3_i = function() {
  16250. var a = new egret.gui.UIAsset;
  16251. this.__s(a, ["source", "x", "y"], ["startBg_jpg", 0, 0]);
  16252. return a
  16253. };
  16254. a.prototype.startGameBtn_i = function() {
  16255. var a = new egret.gui.UIAsset;
  16256. this.startGameBtn = a;
  16257. this.__s(a, ["height", "right", "source", "width", "y"], [62, 44, "startButton_png", 189, 591]);
  16258. return a
  16259. };
  16260. a._skinParts = ["playIntroduce", "startGameBtn", "iReturn", "iStart", "introducer"];
  16261. return a
  16262. }(egret.gui.Skin);
  16263. c.StartViewSkin = f;
  16264. f.prototype.__class__ = "skins.coustom.StartViewSkin"
  16265. })(c.coustom || (c.coustom = {}))
  16266. })(skins || (skins = {}));
  16267. __extends = this.__extends || function(c, e) {
  16268. function f() {
  16269. this.constructor = c
  16270. }
  16271. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16272. f.prototype = e.prototype;
  16273. c.prototype = new f
  16274. };
  16275. (function(c) {
  16276. (function(e) {
  16277. var f = function(b) {
  16278. function a() {
  16279. b.call(this);
  16280. this.__s = egret.gui.setProperties;
  16281. this.__s(this, ["maxWidth", "minHeight", "minWidth"], [710, 230, 370]);
  16282. this.elementsContent = [this.__1_i(), this.moveArea_i(), this.contentDisplay_i(), this.__4_i()]
  16283. }
  16284. __extends(a, b);
  16285. Object.defineProperty(a.prototype, "skinParts", {
  16286. get: function() {
  16287. return a._skinParts
  16288. },
  16289. enumerable: !0,
  16290. configurable: !0
  16291. });
  16292. a.prototype.__2_i = function() {
  16293. var a = new egret.gui.UIAsset;
  16294. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "panel_headeback_png", 100]);
  16295. return a
  16296. };
  16297. a.prototype.__3_i = function() {
  16298. var a = new egret.gui.HorizontalLayout;
  16299. this.__s(a, ["gap", "horizontalAlign", "paddingLeft", "paddingRight"], [10, "center", 20, 20]);
  16300. return a
  16301. };
  16302. a.prototype.__4_i = function() {
  16303. var a = new egret.gui.Group;
  16304. this.__s(a, ["bottom", "horizontalCenter"], [25, 0]);
  16305. a.layout = this.__3_i();
  16306. a.elementsContent = [this.firstButton_i(), this.secondButton_i()];
  16307. return a
  16308. };
  16309. a.prototype.closeButton_i = function() {
  16310. var a = new egret.gui.Button;
  16311. this.closeButton = a;
  16312. this.__s(a, ["right", "skinName", "verticalCenter"], [10, c.simple.CloseButtonSkin, 0]);
  16313. return a
  16314. };
  16315. a.prototype.contentDisplay_i = function() {
  16316. var a = new egret.gui.Label;
  16317. this.contentDisplay = a;
  16318. this.__s(a, "bottom fontFamily left padding right size textAlign textColor top verticalAlign".split(" "), [45, "Tahoma", 1, 10, 1, 22, "center", 7499888, 36, "middle"]);
  16319. return a
  16320. };
  16321. a.prototype.firstButton_i = function() {
  16322. var a = new egret.gui.Button;
  16323. this.firstButton = a;
  16324. this.__s(a, ["height", "label", "width"], [50, "确定", 115]);
  16325. return a
  16326. };
  16327. a.prototype.moveArea_i = function() {
  16328. var a = new egret.gui.Group;
  16329. this.moveArea = a;
  16330. this.__s(a, ["height", "left", "right"], [55, 3, 9]);
  16331. a.elementsContent = [this.__2_i(), this.titleDisplay_i(), this.closeButton_i()];
  16332. return a
  16333. };
  16334. a.prototype.secondButton_i = function() {
  16335. var a = new egret.gui.Button;
  16336. this.secondButton = a;
  16337. this.__s(a, ["height", "label", "width"], [50, "取消", 115]);
  16338. return a
  16339. };
  16340. a.prototype.__1_i = function() {
  16341. var a = new egret.gui.UIAsset;
  16342. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "panel_back_png", 100]);
  16343. return a
  16344. };
  16345. a.prototype.titleDisplay_i = function() {
  16346. var a = new egret.gui.Label;
  16347. this.titleDisplay = a;
  16348. this.__s(a, "fontFamily left maxDisplayedLines minHeight right size textAlign textColor verticalAlign verticalCenter".split(" "), ["Tahoma", 5, 1, 28, 5, 26, "center", 7499888, "middle", 0]);
  16349. return a
  16350. };
  16351. a._skinParts = "titleDisplay closeButton moveArea contentDisplay firstButton secondButton".split(" ");
  16352. return a
  16353. }(egret.gui.Skin);
  16354. e.AlertSkin = f;
  16355. f.prototype.__class__ = "skins.simple.AlertSkin"
  16356. })(c.simple || (c.simple = {}))
  16357. })(skins || (skins = {}));
  16358. __extends = this.__extends || function(c, e) {
  16359. function f() {
  16360. this.constructor = c
  16361. }
  16362. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16363. f.prototype = e.prototype;
  16364. c.prototype = new f
  16365. };
  16366. (function(c) {
  16367. (function(c) {
  16368. var f = function(b) {
  16369. function a() {
  16370. b.call(this);
  16371. this.__s = egret.gui.setProperties;
  16372. this.__s(this, ["minHeight", "minWidth"], [60, 140]);
  16373. this.elementsContent = [this.__4_i(), this.__6_i()];
  16374. this.states = [new egret.gui.State("up", [new egret.gui.SetProperty("labelDisplay", "textColor", 1118481)]), new egret.gui.State("down", [new egret.gui.SetProperty("__4", "source", "button_down_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 2236962)]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__4", "source", "button_disabled_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 13421772)])]
  16375. }
  16376. __extends(a, b);
  16377. Object.defineProperty(a.prototype, "skinParts", {
  16378. get: function() {
  16379. return a._skinParts
  16380. },
  16381. enumerable: !0,
  16382. configurable: !0
  16383. });
  16384. a.prototype.__5_i = function() {
  16385. var a = new egret.gui.HorizontalLayout;
  16386. this.__s(a, ["gap", "horizontalAlign", "verticalAlign"], [0, "center", "middle"]);
  16387. return a
  16388. };
  16389. a.prototype.__6_i = function() {
  16390. var a = new egret.gui.Group;
  16391. this.__s(a, ["bottom", "left", "right", "top"], [10, 10, 10, 10]);
  16392. a.layout = this.__5_i();
  16393. a.elementsContent = [this.iconDisplay_i(), this.labelDisplay_i()];
  16394. return a
  16395. };
  16396. a.prototype.iconDisplay_i = function() {
  16397. var a = new egret.gui.UIAsset;
  16398. return this.iconDisplay = a
  16399. };
  16400. a.prototype.labelDisplay_i = function() {
  16401. var a = new egret.gui.Label;
  16402. this.labelDisplay = a;
  16403. this.__s(a, "fontFamily paddingLeft paddingRight size textAlign verticalAlign".split(" "), ["Tahoma", 5, 5, 20, "center", "middle"]);
  16404. return a
  16405. };
  16406. a.prototype.__4_i = function() {
  16407. var a = new egret.gui.UIAsset;
  16408. this.__4 = a;
  16409. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "button_normal_png", 100]);
  16410. return a
  16411. };
  16412. a._skinParts = ["iconDisplay", "labelDisplay"];
  16413. return a
  16414. }(egret.gui.Skin);
  16415. c.ButtonSkin = f;
  16416. f.prototype.__class__ = "skins.simple.ButtonSkin"
  16417. })(c.simple || (c.simple = {}))
  16418. })(skins || (skins = {}));
  16419. __extends = this.__extends || function(c, e) {
  16420. function f() {
  16421. this.constructor = c
  16422. }
  16423. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16424. f.prototype = e.prototype;
  16425. c.prototype = new f
  16426. };
  16427. (function(c) {
  16428. (function(c) {
  16429. var f = function(b) {
  16430. function a() {
  16431. b.call(this);
  16432. this.__s = egret.gui.setProperties;
  16433. this.elementsContent = [this.__10_i()];
  16434. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__8", "source", "checkbox_select_over_png")]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__8", "source", "checkbox_unselect_disabled_png")]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__8", "source", "checkbox_select_normal_png")]), new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__8", "source", "checkbox_unselect_over_png")]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__8", "source", "checkbox_select_disabled_png")])]
  16435. }
  16436. __extends(a, b);
  16437. Object.defineProperty(a.prototype, "skinParts", {
  16438. get: function() {
  16439. return a._skinParts
  16440. },
  16441. enumerable: !0,
  16442. configurable: !0
  16443. });
  16444. a.prototype.__7_i = function() {
  16445. var a = new egret.gui.HorizontalLayout;
  16446. this.__s(a, ["gap", "verticalAlign"], [5, "middle"]);
  16447. return a
  16448. };
  16449. a.prototype.__8_i = function() {
  16450. var a = new egret.gui.UIAsset;
  16451. this.__8 = a;
  16452. this.__s(a, ["fillMode", "height", "source", "verticalCenter", "width"], ["scale", 24, "checkbox_unselect_normal_png", 1, 24]);
  16453. return a
  16454. };
  16455. a.prototype.__9_i = function() {
  16456. var a = new egret.gui.Group;
  16457. a.elementsContent = [this.__8_i()];
  16458. return a
  16459. };
  16460. a.prototype.labelDisplay_i = function() {
  16461. var a = new egret.gui.Label;
  16462. this.labelDisplay = a;
  16463. this.__s(a, "fontFamily maxDisplayedLines size textAlign textColor verticalAlign".split(" "), ["Tahoma", 1, 20, "center", 7368816, "middle"]);
  16464. return a
  16465. };
  16466. a.prototype.__10_i = function() {
  16467. var a = new egret.gui.Group;
  16468. a.layout = this.__7_i();
  16469. a.elementsContent = [this.__9_i(), this.labelDisplay_i()];
  16470. return a
  16471. };
  16472. a._skinParts = ["labelDisplay"];
  16473. return a
  16474. }(egret.gui.Skin);
  16475. c.CheckBoxSkin = f;
  16476. f.prototype.__class__ = "skins.simple.CheckBoxSkin"
  16477. })(c.simple || (c.simple = {}))
  16478. })(skins || (skins = {}));
  16479. __extends = this.__extends || function(c, e) {
  16480. function f() {
  16481. this.constructor = c
  16482. }
  16483. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16484. f.prototype = e.prototype;
  16485. c.prototype = new f
  16486. };
  16487. (function(c) {
  16488. (function(e) {
  16489. var f = function(b) {
  16490. function a() {
  16491. b.call(this);
  16492. this.__s = egret.gui.setProperties;
  16493. this.elementsContent = [this.openButton_i(), this.labelDisplay_i(), this.popUp_i()];
  16494. this.states = [new egret.gui.State("normal", [new egret.gui.SetProperty("labelDisplay", "textColor", 1118481)]), new egret.gui.State("open", [new egret.gui.SetProperty("labelDisplay", "textColor", 2236962), new egret.gui.SetProperty("popUp", "displayPopUp", !0)]), new egret.gui.State("disabled", [])]
  16495. }
  16496. __extends(a, b);
  16497. Object.defineProperty(a.prototype, "skinParts", {
  16498. get: function() {
  16499. return a._skinParts
  16500. },
  16501. enumerable: !0,
  16502. configurable: !0
  16503. });
  16504. a.prototype.dataGroup_i = function() {
  16505. var a = new egret.gui.DataGroup;
  16506. this.dataGroup = a;
  16507. this.__s(a, ["percentHeight", "itemRendererSkinName", "percentWidth"], [100, c.simple.DropDownListItemRendererSkin, 100]);
  16508. a.layout = this.__4_i();
  16509. return a
  16510. };
  16511. a.prototype.dropDown_i = function() {
  16512. var a = new egret.gui.Group;
  16513. this.dropDown = a;
  16514. this.__s(a, ["height", "visible"], [400, !0]);
  16515. a.elementsContent = [this.scroller_i()];
  16516. return a
  16517. };
  16518. a.prototype.labelDisplay_i = function() {
  16519. var a = new egret.gui.Label;
  16520. this.labelDisplay = a;
  16521. this.__s(a, "fontFamily paddingLeft touchChildren touchEnabled verticalAlign verticalCenter".split(" "), ["Tahoma", 10, !1, !1, "middle", 0]);
  16522. return a
  16523. };
  16524. a.prototype.openButton_i = function() {
  16525. var a = new egret.gui.Button;
  16526. this.openButton = a;
  16527. this.__s(a, ["percentHeight", "skinName", "percentWidth"], [100, c.simple.DropDownListOpenButtonSkin, 100]);
  16528. return a
  16529. };
  16530. a.prototype.popUp_i = function() {
  16531. var a = new egret.gui.PopUpAnchor;
  16532. this.popUp = a;
  16533. this.__s(a, ["displayPopUp", "percentHeight", "popUpPosition", "popUpWidthMatchesAnchorWidth", "percentWidth"], [!1, 100, "below", !0, 100]);
  16534. a.popUp = this.dropDown_i();
  16535. return a
  16536. };
  16537. a.prototype.scroller_i = function() {
  16538. var a = new egret.gui.Scroller;
  16539. this.scroller = a;
  16540. this.__s(a, ["percentHeight", "percentWidth"], [100, 100]);
  16541. a.viewport = this.dataGroup_i();
  16542. return a
  16543. };
  16544. a.prototype.__4_i = function() {
  16545. var a = new egret.gui.VerticalLayout;
  16546. this.__s(a, ["gap", "horizontalAlign"], [0, "justify"]);
  16547. return a
  16548. };
  16549. a._skinParts = "openButton labelDisplay dataGroup scroller dropDown popUp".split(" ");
  16550. return a
  16551. }(egret.gui.Skin);
  16552. e.DropDownListSkin = f;
  16553. f.prototype.__class__ = "skins.simple.DropDownListSkin"
  16554. })(c.simple || (c.simple = {}))
  16555. })(skins || (skins = {}));
  16556. __extends = this.__extends || function(c, e) {
  16557. function f() {
  16558. this.constructor = c
  16559. }
  16560. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16561. f.prototype = e.prototype;
  16562. c.prototype = new f
  16563. };
  16564. (function(c) {
  16565. (function(e) {
  16566. var f = function(b) {
  16567. function a() {
  16568. b.call(this);
  16569. this.__s = egret.gui.setProperties;
  16570. this.__s(this, ["minHeight", "minWidth"], [13, 50]);
  16571. this.elementsContent = [this.track_i(), this.trackHighlight_i(), this.thumb_i()];
  16572. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16573. }
  16574. __extends(a, b);
  16575. Object.defineProperty(a.prototype, "skinParts", {
  16576. get: function() {
  16577. return a._skinParts
  16578. },
  16579. enumerable: !0,
  16580. configurable: !0
  16581. });
  16582. a.prototype.thumb_i = function() {
  16583. var a = new egret.gui.Button;
  16584. this.thumb = a;
  16585. this.__s(a, ["height", "skinName", "verticalCenter", "width"], [24, c.simple.HSliderThumbSkin, 0, 24]);
  16586. return a
  16587. };
  16588. a.prototype.trackHighlight_i = function() {
  16589. var a = new egret.gui.UIAsset;
  16590. this.trackHighlight = a;
  16591. this.__s(a, ["height", "source", "verticalCenter"], [10, "hslider_fill_png", 0]);
  16592. return a
  16593. };
  16594. a.prototype.track_i = function() {
  16595. var a = new egret.gui.UIAsset;
  16596. this.track = a;
  16597. this.__s(a, ["height", "source", "verticalCenter", "percentWidth"], [10, "hslider_track_png", 0, 100]);
  16598. return a
  16599. };
  16600. a._skinParts = ["track", "trackHighlight", "thumb"];
  16601. return a
  16602. }(egret.gui.Skin);
  16603. e.HSliderSkin = f;
  16604. f.prototype.__class__ = "skins.simple.HSliderSkin"
  16605. })(c.simple || (c.simple = {}))
  16606. })(skins || (skins = {}));
  16607. __extends = this.__extends || function(c, e) {
  16608. function f() {
  16609. this.constructor = c
  16610. }
  16611. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16612. f.prototype = e.prototype;
  16613. c.prototype = new f
  16614. };
  16615. (function(c) {
  16616. (function(c) {
  16617. var f = function(b) {
  16618. function a() {
  16619. b.call(this);
  16620. this.__s = egret.gui.setProperties;
  16621. this.height = 85;
  16622. this.elementsContent = [this.__4_i(), this.__5_i(), this.labelDisplay_i()];
  16623. this.states = [new egret.gui.State("up", [new egret.gui.SetProperty("__4", "source", "app_list_item_up_png")]), new egret.gui.State("down", [new egret.gui.SetProperty("__4", "source", "app_list_item_select_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 15790320)]), new egret.gui.State("disabled", [])]
  16624. }
  16625. __extends(a, b);
  16626. Object.defineProperty(a.prototype, "skinParts", {
  16627. get: function() {
  16628. return a._skinParts
  16629. },
  16630. enumerable: !0,
  16631. configurable: !0
  16632. });
  16633. a.prototype.__5_i = function() {
  16634. var a = new egret.gui.Rect;
  16635. this.__s(a, "fillAlpha height strokeAlpha strokeColor strokeWeight percentWidth".split(" "), [0, 0.5, 1, 8947848, 0.5, 100]);
  16636. return a
  16637. };
  16638. a.prototype.labelDisplay_i = function() {
  16639. var a = new egret.gui.Label;
  16640. this.labelDisplay = a;
  16641. this.__s(a, ["fontFamily", "left", "size", "textColor", "verticalCenter"], ["Tahoma", 32, 24, 1118481, 0]);
  16642. return a
  16643. };
  16644. a.prototype.__4_i = function() {
  16645. var a = new egret.gui.UIAsset;
  16646. this.__4 = a;
  16647. this.__s(a, ["percentHeight", "percentWidth"], [100, 100]);
  16648. return a
  16649. };
  16650. a._skinParts = ["labelDisplay"];
  16651. return a
  16652. }(egret.gui.Skin);
  16653. c.ItemRendererSkin = f;
  16654. f.prototype.__class__ = "skins.simple.ItemRendererSkin"
  16655. })(c.simple || (c.simple = {}))
  16656. })(skins || (skins = {}));
  16657. __extends = this.__extends || function(c, e) {
  16658. function f() {
  16659. this.constructor = c
  16660. }
  16661. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16662. f.prototype = e.prototype;
  16663. c.prototype = new f
  16664. };
  16665. (function(c) {
  16666. (function(c) {
  16667. var f = function(b) {
  16668. function a() {
  16669. b.call(this);
  16670. this.__s = egret.gui.setProperties;
  16671. this.elementsContent = [this.__4_i()];
  16672. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16673. }
  16674. __extends(a, b);
  16675. Object.defineProperty(a.prototype, "skinParts", {
  16676. get: function() {
  16677. return a._skinParts
  16678. },
  16679. enumerable: !0,
  16680. configurable: !0
  16681. });
  16682. a.prototype.__4_i = function() {
  16683. var a = new egret.gui.Scroller;
  16684. this.__s(a, ["percentHeight", "horizontalScrollPolicy", "percentWidth"], [100, "off", 100]);
  16685. a.viewport = this.dataGroup_i();
  16686. return a
  16687. };
  16688. a.prototype.dataGroup_i = function() {
  16689. var a = new egret.gui.DataGroup;
  16690. this.dataGroup = a;
  16691. a.layout = this.__3_i();
  16692. return a
  16693. };
  16694. a.prototype.__3_i = function() {
  16695. var a = new egret.gui.VerticalLayout;
  16696. this.__s(a, ["gap", "horizontalAlign"], [0, "contentJustify"]);
  16697. return a
  16698. };
  16699. a._skinParts = ["dataGroup"];
  16700. return a
  16701. }(egret.gui.Skin);
  16702. c.ListSkin = f;
  16703. f.prototype.__class__ = "skins.simple.ListSkin"
  16704. })(c.simple || (c.simple = {}))
  16705. })(skins || (skins = {}));
  16706. __extends = this.__extends || function(c, e) {
  16707. function f() {
  16708. this.constructor = c
  16709. }
  16710. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16711. f.prototype = e.prototype;
  16712. c.prototype = new f
  16713. };
  16714. (function(c) {
  16715. (function(c) {
  16716. var f = function(b) {
  16717. function a() {
  16718. b.call(this);
  16719. this.__s = egret.gui.setProperties;
  16720. this.__s(this, ["maxWidth", "minHeight", "minWidth"], [710, 230, 470]);
  16721. this.elementsContent = [this.__3_i(), this.moveArea_i(), this.contentGroup_i()];
  16722. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16723. }
  16724. __extends(a, b);
  16725. Object.defineProperty(a.prototype, "skinParts", {
  16726. get: function() {
  16727. return a._skinParts
  16728. },
  16729. enumerable: !0,
  16730. configurable: !0
  16731. });
  16732. a.prototype.__4_i = function() {
  16733. var a = new egret.gui.UIAsset;
  16734. this.__s(a, ["bottom", "left", "right", "source", "top"], [-4, -2, -2, "panel_headeback_png", -2]);
  16735. return a
  16736. };
  16737. a.prototype.contentGroup_i = function() {
  16738. var a = new egret.gui.Group;
  16739. this.contentGroup = a;
  16740. this.__s(a, ["bottom", "clipAndEnableScrolling", "top", "percentWidth"], [0, !0, 50, 100]);
  16741. return a
  16742. };
  16743. a.prototype.moveArea_i = function() {
  16744. var a = new egret.gui.Group;
  16745. this.moveArea = a;
  16746. this.__s(a, ["height", "left", "right"], [50, 0, 0]);
  16747. a.elementsContent = [this.__4_i(), this.titleDisplay_i()];
  16748. return a
  16749. };
  16750. a.prototype.__3_i = function() {
  16751. var a = new egret.gui.UIAsset;
  16752. this.__s(a, ["bottom", "left", "right", "source", "top"], [-10, -4, -10, "panel_back_png", -4]);
  16753. return a
  16754. };
  16755. a.prototype.titleDisplay_i = function() {
  16756. var a = new egret.gui.Label;
  16757. this.titleDisplay = a;
  16758. this.__s(a, "fontFamily left maxDisplayedLines minHeight right size textAlign textColor verticalAlign verticalCenter".split(" "), ["Tahoma", 5, 1, 28, 5, 26, "center", 7499888, "middle", 0]);
  16759. return a
  16760. };
  16761. a._skinParts = ["titleDisplay", "moveArea", "contentGroup"];
  16762. return a
  16763. }(egret.gui.Skin);
  16764. c.PanelSkin = f;
  16765. f.prototype.__class__ = "skins.simple.PanelSkin"
  16766. })(c.simple || (c.simple = {}))
  16767. })(skins || (skins = {}));
  16768. __extends = this.__extends || function(c, e) {
  16769. function f() {
  16770. this.constructor = c
  16771. }
  16772. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16773. f.prototype = e.prototype;
  16774. c.prototype = new f
  16775. };
  16776. (function(c) {
  16777. (function(c) {
  16778. var f = function(b) {
  16779. function a() {
  16780. b.call(this);
  16781. this.__s = egret.gui.setProperties;
  16782. this.height = 100;
  16783. this.elementsContent = [this.__3_i(), this.thumb_i(), this.track_i(), this.labelDisplay_i()];
  16784. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16785. }
  16786. __extends(a, b);
  16787. Object.defineProperty(a.prototype, "skinParts", {
  16788. get: function() {
  16789. return a._skinParts
  16790. },
  16791. enumerable: !0,
  16792. configurable: !0
  16793. });
  16794. a.prototype.labelDisplay_i = function() {
  16795. var a = new egret.gui.Label;
  16796. this.labelDisplay = a;
  16797. this.__s(a, "left maxDisplayedLines right size textAlign textColor verticalAlign verticalCenter".split(" "), [5, 1, 5, 20, "center", 7368816, "middle", 0]);
  16798. return a
  16799. };
  16800. a.prototype.__3_i = function() {
  16801. var a = new egret.gui.UIAsset;
  16802. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "progressbar_track_png", 100]);
  16803. return a
  16804. };
  16805. a.prototype.thumb_i = function() {
  16806. var a = new egret.gui.UIAsset;
  16807. this.thumb = a;
  16808. a.source = "progressbar_fill_png";
  16809. return a
  16810. };
  16811. a.prototype.track_i = function() {
  16812. var a = new egret.gui.UIComponent;
  16813. this.track = a;
  16814. this.__s(a, ["percentHeight", "percentWidth"], [100, 100]);
  16815. return a
  16816. };
  16817. a._skinParts = ["thumb", "track", "labelDisplay"];
  16818. return a
  16819. }(egret.gui.Skin);
  16820. c.ProgressBarSkin = f;
  16821. f.prototype.__class__ = "skins.simple.ProgressBarSkin"
  16822. })(c.simple || (c.simple = {}))
  16823. })(skins || (skins = {}));
  16824. __extends = this.__extends || function(c, e) {
  16825. function f() {
  16826. this.constructor = c
  16827. }
  16828. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16829. f.prototype = e.prototype;
  16830. c.prototype = new f
  16831. };
  16832. (function(c) {
  16833. (function(c) {
  16834. var f = function(b) {
  16835. function a() {
  16836. b.call(this);
  16837. this.__s = egret.gui.setProperties;
  16838. this.elementsContent = [this.__10_i()];
  16839. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__8", "source", "radiobutton_select_over_png")]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__8", "source", "radiobutton_unselect_disabled_png")]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__8", "source", "radiobutton_select_normal_png")]),
  16840. new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__8", "source", "radiobutton_unselect_over_png")]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__8", "source", "radiobutton_select_disabled_png")])
  16841. ]
  16842. }
  16843. __extends(a, b);
  16844. Object.defineProperty(a.prototype, "skinParts", {
  16845. get: function() {
  16846. return a._skinParts
  16847. },
  16848. enumerable: !0,
  16849. configurable: !0
  16850. });
  16851. a.prototype.__7_i = function() {
  16852. var a = new egret.gui.HorizontalLayout;
  16853. this.__s(a, ["gap", "verticalAlign"], [5, "middle"]);
  16854. return a
  16855. };
  16856. a.prototype.__8_i = function() {
  16857. var a = new egret.gui.UIAsset;
  16858. this.__8 = a;
  16859. this.__s(a, ["fillMode", "height", "source", "verticalCenter", "width"], ["scale", 24, "radiobutton_unselect_normal_png", 1, 24]);
  16860. return a
  16861. };
  16862. a.prototype.__9_i = function() {
  16863. var a = new egret.gui.Group;
  16864. a.elementsContent = [this.__8_i()];
  16865. return a
  16866. };
  16867. a.prototype.labelDisplay_i = function() {
  16868. var a = new egret.gui.Label;
  16869. this.labelDisplay = a;
  16870. this.__s(a, "fontFamily maxDisplayedLines size textAlign textColor verticalAlign".split(" "), ["Tahoma", 1, 20, "center", 7368816, "middle"]);
  16871. return a
  16872. };
  16873. a.prototype.__10_i = function() {
  16874. var a = new egret.gui.Group;
  16875. a.layout = this.__7_i();
  16876. a.elementsContent = [this.__9_i(), this.labelDisplay_i()];
  16877. return a
  16878. };
  16879. a._skinParts = ["labelDisplay"];
  16880. return a
  16881. }(egret.gui.Skin);
  16882. c.RadioButtonSkin = f;
  16883. f.prototype.__class__ = "skins.simple.RadioButtonSkin"
  16884. })(c.simple || (c.simple = {}))
  16885. })(skins || (skins = {}));
  16886. __extends = this.__extends || function(c, e) {
  16887. function f() {
  16888. this.constructor = c
  16889. }
  16890. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16891. f.prototype = e.prototype;
  16892. c.prototype = new f
  16893. };
  16894. (function(c) {
  16895. (function(e) {
  16896. var f = function(b) {
  16897. function a() {
  16898. b.call(this);
  16899. this.__s = egret.gui.setProperties;
  16900. this.__s(this, ["maxWidth", "minHeight", "minWidth"], [710, 230, 370]);
  16901. this.elementsContent = [this.horizontalScrollBar_i(), this.verticalScrollBar_i()]
  16902. }
  16903. __extends(a, b);
  16904. Object.defineProperty(a.prototype, "skinParts", {
  16905. get: function() {
  16906. return a._skinParts
  16907. },
  16908. enumerable: !0,
  16909. configurable: !0
  16910. });
  16911. a.prototype.horizontalScrollBar_i = function() {
  16912. var a = new egret.gui.HScrollBar;
  16913. this.horizontalScrollBar = a;
  16914. a.skinName = c.simple.HScrollBarSkin;
  16915. return a
  16916. };
  16917. a.prototype.verticalScrollBar_i = function() {
  16918. var a = new egret.gui.VScrollBar;
  16919. this.verticalScrollBar = a;
  16920. a.skinName = c.simple.VScrollBarSkin;
  16921. return a
  16922. };
  16923. a._skinParts = ["horizontalScrollBar", "verticalScrollBar"];
  16924. return a
  16925. }(egret.gui.Skin);
  16926. e.ScrollerSkin = f;
  16927. f.prototype.__class__ = "skins.simple.ScrollerSkin"
  16928. })(c.simple || (c.simple = {}))
  16929. })(skins || (skins = {}));
  16930. __extends = this.__extends || function(c, e) {
  16931. function f() {
  16932. this.constructor = c
  16933. }
  16934. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16935. f.prototype = e.prototype;
  16936. c.prototype = new f
  16937. };
  16938. (function(c) {
  16939. (function(c) {
  16940. var f = function(b) {
  16941. function a() {
  16942. b.call(this);
  16943. this.__s = egret.gui.setProperties;
  16944. this.__s(this, ["maxWidth", "minHeight", "minWidth"], [710, 230, 470]);
  16945. this.elementsContent = [this.contentGroup_i()];
  16946. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16947. }
  16948. __extends(a, b);
  16949. Object.defineProperty(a.prototype, "skinParts", {
  16950. get: function() {
  16951. return a._skinParts
  16952. },
  16953. enumerable: !0,
  16954. configurable: !0
  16955. });
  16956. a.prototype.contentGroup_i = function() {
  16957. var a = new egret.gui.Group;
  16958. this.contentGroup = a;
  16959. this.__s(a, ["percentHeight", "percentWidth"], [100, 100]);
  16960. return a
  16961. };
  16962. a._skinParts = ["contentGroup"];
  16963. return a
  16964. }(egret.gui.Skin);
  16965. c.SkinnableContainerSkin = f;
  16966. f.prototype.__class__ = "skins.simple.SkinnableContainerSkin"
  16967. })(c.simple || (c.simple = {}))
  16968. })(skins || (skins = {}));
  16969. __extends = this.__extends || function(c, e) {
  16970. function f() {
  16971. this.constructor = c
  16972. }
  16973. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  16974. f.prototype = e.prototype;
  16975. c.prototype = new f
  16976. };
  16977. (function(c) {
  16978. (function(e) {
  16979. var f = function(b) {
  16980. function a() {
  16981. b.call(this);
  16982. this.__s = egret.gui.setProperties;
  16983. this.__s(this, ["minHeight", "minWidth"], [20, 60]);
  16984. this.elementsContent = [this.dataGroup_i()];
  16985. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  16986. }
  16987. __extends(a, b);
  16988. Object.defineProperty(a.prototype, "skinParts", {
  16989. get: function() {
  16990. return a._skinParts
  16991. },
  16992. enumerable: !0,
  16993. configurable: !0
  16994. });
  16995. a.prototype.dataGroup_i = function() {
  16996. var a = new egret.gui.DataGroup;
  16997. this.dataGroup = a;
  16998. this.__s(a, "bottom percentHeight itemRenderer itemRendererSkinName top percentWidth".split(" "), [0, 100, new egret.gui.ClassFactory(egret.gui.TabBarButton), c.simple.TabBarButtonSkin, 90, 100]);
  16999. a.layout = this.__3_i();
  17000. return a
  17001. };
  17002. a.prototype.__3_i = function() {
  17003. var a = new egret.gui.HorizontalLayout;
  17004. this.__s(a, ["gap", "horizontalAlign", "verticalAlign"], [-1, "justify", "contentJustify"]);
  17005. return a
  17006. };
  17007. a._skinParts = ["dataGroup"];
  17008. return a
  17009. }(egret.gui.Skin);
  17010. e.TabBarSkin = f;
  17011. f.prototype.__class__ = "skins.simple.TabBarSkin"
  17012. })(c.simple || (c.simple = {}))
  17013. })(skins || (skins = {}));
  17014. __extends = this.__extends || function(c, e) {
  17015. function f() {
  17016. this.constructor = c
  17017. }
  17018. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17019. f.prototype = e.prototype;
  17020. c.prototype = new f
  17021. };
  17022. (function(c) {
  17023. (function(c) {
  17024. var f = function(b) {
  17025. function a() {
  17026. b.call(this);
  17027. this.__s = egret.gui.setProperties;
  17028. this.__s(this, ["minHeight", "minWidth"], [30, 100]);
  17029. this.elementsContent = [this.__3_i(), this.textDisplay_i()];
  17030. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [new egret.gui.SetProperty("textDisplay", "textColor", 11184810)])]
  17031. }
  17032. __extends(a, b);
  17033. Object.defineProperty(a.prototype, "skinParts", {
  17034. get: function() {
  17035. return a._skinParts
  17036. },
  17037. enumerable: !0,
  17038. configurable: !0
  17039. });
  17040. a.prototype.__3_i = function() {
  17041. var a = new egret.gui.UIAsset;
  17042. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "textbox_png", 100]);
  17043. return a
  17044. };
  17045. a.prototype.textDisplay_i = function() {
  17046. var a = new egret.gui.EditableText;
  17047. this.textDisplay = a;
  17048. this.__s(a, "bottom percentHeight left right size textColor top percentWidth".split(" "), [8, 100, 10, 10, 20, 0, 8, 100]);
  17049. return a
  17050. };
  17051. a._skinParts = ["textDisplay"];
  17052. return a
  17053. }(egret.gui.Skin);
  17054. c.TextAreaSkin = f;
  17055. f.prototype.__class__ = "skins.simple.TextAreaSkin"
  17056. })(c.simple || (c.simple = {}))
  17057. })(skins || (skins = {}));
  17058. __extends = this.__extends || function(c, e) {
  17059. function f() {
  17060. this.constructor = c
  17061. }
  17062. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17063. f.prototype = e.prototype;
  17064. c.prototype = new f
  17065. };
  17066. (function(c) {
  17067. (function(c) {
  17068. var f = function(b) {
  17069. function a() {
  17070. b.call(this);
  17071. this.__s = egret.gui.setProperties;
  17072. this.__s(this, ["minHeight", "minWidth"], [30, 100]);
  17073. this.elementsContent = [this.__3_i(), this.textDisplay_i()];
  17074. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [new egret.gui.SetProperty("textDisplay", "textColor", 11184810)])]
  17075. }
  17076. __extends(a, b);
  17077. Object.defineProperty(a.prototype, "skinParts", {
  17078. get: function() {
  17079. return a._skinParts
  17080. },
  17081. enumerable: !0,
  17082. configurable: !0
  17083. });
  17084. a.prototype.__3_i = function() {
  17085. var a = new egret.gui.UIAsset;
  17086. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "textbox_png", 100]);
  17087. return a
  17088. };
  17089. a.prototype.textDisplay_i = function() {
  17090. var a = new egret.gui.EditableText;
  17091. this.textDisplay = a;
  17092. this.__s(a, "bottom percentHeight left right size textColor top percentWidth".split(" "), [8, 100, 10, 10, 20, 0, 8, 100]);
  17093. return a
  17094. };
  17095. a._skinParts = ["textDisplay"];
  17096. return a
  17097. }(egret.gui.Skin);
  17098. c.TextInputSkin = f;
  17099. f.prototype.__class__ = "skins.simple.TextInputSkin"
  17100. })(c.simple || (c.simple = {}))
  17101. })(skins || (skins = {}));
  17102. __extends = this.__extends || function(c, e) {
  17103. function f() {
  17104. this.constructor = c
  17105. }
  17106. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17107. f.prototype = e.prototype;
  17108. c.prototype = new f
  17109. };
  17110. (function(c) {
  17111. (function(e) {
  17112. var f = function(b) {
  17113. function a() {
  17114. b.call(this);
  17115. this.__s = egret.gui.setProperties;
  17116. this.__s(this, ["maxWidth", "minHeight", "minWidth"], [710, 230, 470]);
  17117. this.elementsContent = [this.__3_i(), this.moveArea_i(), this.contentGroup_i()];
  17118. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  17119. }
  17120. __extends(a, b);
  17121. Object.defineProperty(a.prototype, "skinParts", {
  17122. get: function() {
  17123. return a._skinParts
  17124. },
  17125. enumerable: !0,
  17126. configurable: !0
  17127. });
  17128. a.prototype.__4_i = function() {
  17129. var a = new egret.gui.UIAsset;
  17130. this.__s(a, ["bottom", "left", "right", "source", "top"], [-4, -3, -3, "panel_headeback_png", -2]);
  17131. return a
  17132. };
  17133. a.prototype.closeButton_i = function() {
  17134. var a = new egret.gui.Button;
  17135. this.closeButton = a;
  17136. this.__s(a, ["right", "skinName", "verticalCenter"], [10, c.simple.CloseButtonSkin, 0]);
  17137. return a
  17138. };
  17139. a.prototype.contentGroup_i = function() {
  17140. var a = new egret.gui.Group;
  17141. this.contentGroup = a;
  17142. this.__s(a, ["bottom", "clipAndEnableScrolling", "top", "percentWidth"], [0, !0, 51, 100]);
  17143. return a
  17144. };
  17145. a.prototype.moveArea_i = function() {
  17146. var a = new egret.gui.Group;
  17147. this.moveArea = a;
  17148. this.__s(a, ["height", "left", "right"], [50, 0, 0]);
  17149. a.elementsContent = [this.__4_i(), this.titleDisplay_i(), this.closeButton_i()];
  17150. return a
  17151. };
  17152. a.prototype.__3_i = function() {
  17153. var a = new egret.gui.UIAsset;
  17154. this.__s(a, ["bottom", "left", "right", "source", "top"], [-10, -4, -10, "panel_back_png", -4]);
  17155. return a
  17156. };
  17157. a.prototype.titleDisplay_i = function() {
  17158. var a = new egret.gui.Label;
  17159. this.titleDisplay = a;
  17160. this.__s(a, "fontFamily left maxDisplayedLines minHeight right size textAlign textColor verticalAlign verticalCenter".split(" "), ["Tahoma", 5, 1, 28, 5, 26, "center", 7499888, "middle", 0]);
  17161. return a
  17162. };
  17163. a._skinParts = ["titleDisplay", "closeButton", "moveArea", "contentGroup"];
  17164. return a
  17165. }(egret.gui.Skin);
  17166. e.TitleWindowSkin = f;
  17167. f.prototype.__class__ = "skins.simple.TitleWindowSkin"
  17168. })(c.simple || (c.simple = {}))
  17169. })(skins || (skins = {}));
  17170. __extends = this.__extends || function(c, e) {
  17171. function f() {
  17172. this.constructor = c
  17173. }
  17174. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17175. f.prototype = e.prototype;
  17176. c.prototype = new f
  17177. };
  17178. (function(c) {
  17179. (function(c) {
  17180. var f = function(b) {
  17181. function a() {
  17182. b.call(this);
  17183. this.__s = egret.gui.setProperties;
  17184. this.__s(this, ["height", "minWidth"], [60, 140]);
  17185. this.elementsContent = [this.__7_i(), this.__9_i()];
  17186. this.states = [new egret.gui.State("up", []), new egret.gui.State("down", [new egret.gui.SetProperty("__7", "source", "togglebutton_over_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 1995877)]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__7", "source", "togglebutton_disabled_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 13421772)]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__7", "source", "togglebutton_selected_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 15658476)]), new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__7", "source", "togglebutton_over_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 1995877)]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__7", "source", "togglebutton_disabled_png"), new egret.gui.SetProperty("labelDisplay", "textColor", 13421772)])]
  17187. }
  17188. __extends(a, b);
  17189. Object.defineProperty(a.prototype, "skinParts", {
  17190. get: function() {
  17191. return a._skinParts
  17192. },
  17193. enumerable: !0,
  17194. configurable: !0
  17195. });
  17196. a.prototype.__8_i = function() {
  17197. var a = new egret.gui.HorizontalLayout;
  17198. this.__s(a, ["gap", "horizontalAlign", "verticalAlign"], [0, "center", "middle"]);
  17199. return a
  17200. };
  17201. a.prototype.__9_i = function() {
  17202. var a = new egret.gui.Group;
  17203. this.__s(a, ["bottom", "left", "right", "top"], [10, 10, 10, 10]);
  17204. a.layout = this.__8_i();
  17205. a.elementsContent = [this.iconDisplay_i(), this.labelDisplay_i()];
  17206. return a
  17207. };
  17208. a.prototype.iconDisplay_i = function() {
  17209. var a = new egret.gui.UIAsset;
  17210. return this.iconDisplay = a
  17211. };
  17212. a.prototype.labelDisplay_i = function() {
  17213. var a = new egret.gui.Label;
  17214. this.labelDisplay = a;
  17215. this.__s(a, ["fontFamily", "size", "textAlign", "textColor", "verticalAlign"], ["Tahoma", 20, "center", 1995877, "middle"]);
  17216. return a
  17217. };
  17218. a.prototype.__7_i = function() {
  17219. var a = new egret.gui.UIAsset;
  17220. this.__7 = a;
  17221. this.__s(a, ["percentHeight", "source", "percentWidth"], [100, "togglebutton_normal_png", 100]);
  17222. return a
  17223. };
  17224. a._skinParts = ["iconDisplay", "labelDisplay"];
  17225. return a
  17226. }(egret.gui.Skin);
  17227. c.ToggleButtonSkin = f;
  17228. f.prototype.__class__ = "skins.simple.ToggleButtonSkin"
  17229. })(c.simple || (c.simple = {}))
  17230. })(skins || (skins = {}));
  17231. __extends = this.__extends || function(c, e) {
  17232. function f() {
  17233. this.constructor = c
  17234. }
  17235. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17236. f.prototype = e.prototype;
  17237. c.prototype = new f
  17238. };
  17239. (function(c) {
  17240. (function(c) {
  17241. var f = function(b) {
  17242. function a() {
  17243. b.call(this);
  17244. this.__s = egret.gui.setProperties;
  17245. this.elementsContent = [this.__7_i(), this.__8_i(), this.__9_i(), this.__10_i(), this.__11_i(), this.__12_i()];
  17246. this.states = [new egret.gui.State("up", [new egret.gui.SetProperty("__7", "visible", !0), new egret.gui.SetProperty("__8", "visible", !0), new egret.gui.SetProperty("__9", "visible", !0)]), new egret.gui.State("down", [new egret.gui.SetProperty("__7", "visible", !0), new egret.gui.SetProperty("__8", "visible", !0), new egret.gui.SetProperty("__9", "visible", !0)]), new egret.gui.State("disabled", [new egret.gui.SetProperty("__7", "visible", !0), new egret.gui.SetProperty("__8", "visible", !0), new egret.gui.SetProperty("__9", "visible", !0)]), new egret.gui.State("upAndSelected", [new egret.gui.SetProperty("__10", "visible", !0), new egret.gui.SetProperty("__11", "visible", !0), new egret.gui.SetProperty("__12", "visible", !0)]), new egret.gui.State("downAndSelected", [new egret.gui.SetProperty("__10", "visible", !0), new egret.gui.SetProperty("__11", "visible", !0), new egret.gui.SetProperty("__12", "visible", !0)]), new egret.gui.State("disabledAndSelected", [new egret.gui.SetProperty("__10", "visible", !0), new egret.gui.SetProperty("__11", "visible", !0), new egret.gui.SetProperty("__12", "visible", !0)])]
  17247. }
  17248. __extends(a, b);
  17249. a.prototype.__10_i = function() {
  17250. var a = new egret.gui.UIAsset;
  17251. this.__10 = a;
  17252. this.__s(a, ["source", "visible"], ["onoffbutton_on_track_png", !1]);
  17253. return a
  17254. };
  17255. a.prototype.__11_i = function() {
  17256. var a = new egret.gui.UIAsset;
  17257. this.__11 = a;
  17258. this.__s(a, ["right", "source", "verticalCenter", "visible"], [1, "onoffbutton_on_thumb_png", 0, !1]);
  17259. return a
  17260. };
  17261. a.prototype.__12_i = function() {
  17262. var a = new egret.gui.UIAsset;
  17263. this.__12 = a;
  17264. this.__s(a, ["left", "source", "verticalCenter", "visible"], [15, "onoffbutton_on_label_png", 0, !1]);
  17265. return a
  17266. };
  17267. a.prototype.__7_i = function() {
  17268. var a = new egret.gui.UIAsset;
  17269. this.__7 = a;
  17270. this.__s(a, ["source", "visible"], ["onoffbutton_off_track_png", !1]);
  17271. return a
  17272. };
  17273. a.prototype.__8_i = function() {
  17274. var a = new egret.gui.UIAsset;
  17275. this.__8 = a;
  17276. this.__s(a, ["left", "source", "verticalCenter", "visible"], [1, "onoffbutton_off_thumb_png", 0, !1]);
  17277. return a
  17278. };
  17279. a.prototype.__9_i = function() {
  17280. var a = new egret.gui.UIAsset;
  17281. this.__9 = a;
  17282. this.__s(a, ["right", "source", "verticalCenter", "visible"], [15, "onoffbutton_off_label_png", 0, !1]);
  17283. return a
  17284. };
  17285. return a
  17286. }(egret.gui.Skin);
  17287. c.ToggleSwitchSkin = f;
  17288. f.prototype.__class__ = "skins.simple.ToggleSwitchSkin"
  17289. })(c.simple || (c.simple = {}))
  17290. })(skins || (skins = {}));
  17291. __extends = this.__extends || function(c, e) {
  17292. function f() {
  17293. this.constructor = c
  17294. }
  17295. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17296. f.prototype = e.prototype;
  17297. c.prototype = new f
  17298. };
  17299. (function(c) {
  17300. (function(e) {
  17301. var f = function(b) {
  17302. function a() {
  17303. b.call(this);
  17304. this.__s = egret.gui.setProperties;
  17305. this.elementsContent = [this.__4_i()];
  17306. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  17307. }
  17308. __extends(a, b);
  17309. Object.defineProperty(a.prototype, "skinParts", {
  17310. get: function() {
  17311. return a._skinParts
  17312. },
  17313. enumerable: !0,
  17314. configurable: !0
  17315. });
  17316. a.prototype.__4_i = function() {
  17317. var a = new egret.gui.Scroller;
  17318. this.__s(a, ["percentHeight", "percentWidth"], [100, 100]);
  17319. a.viewport = this.dataGroup_i();
  17320. return a
  17321. };
  17322. a.prototype.dataGroup_i = function() {
  17323. var a = new egret.gui.DataGroup;
  17324. this.dataGroup = a;
  17325. a.itemRendererSkinName = c.simple.TreeItemRendererSkin;
  17326. a.layout = this.__3_i();
  17327. return a
  17328. };
  17329. a.prototype.__3_i = function() {
  17330. var a = new egret.gui.VerticalLayout;
  17331. this.__s(a, ["gap", "horizontalAlign"], [2, "justify"]);
  17332. return a
  17333. };
  17334. a._skinParts = ["dataGroup"];
  17335. return a
  17336. }(egret.gui.Skin);
  17337. e.TreeSkin = f;
  17338. f.prototype.__class__ = "skins.simple.TreeSkin"
  17339. })(c.simple || (c.simple = {}))
  17340. })(skins || (skins = {}));
  17341. __extends = this.__extends || function(c, e) {
  17342. function f() {
  17343. this.constructor = c
  17344. }
  17345. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17346. f.prototype = e.prototype;
  17347. c.prototype = new f
  17348. };
  17349. (function(c) {
  17350. (function(e) {
  17351. var f = function(b) {
  17352. function a() {
  17353. b.call(this);
  17354. this.__s = egret.gui.setProperties;
  17355. this.__s(this, ["minHeight", "minWidth"], [13, 13]);
  17356. this.elementsContent = [this.track_i(), this.trackHighlight_i(), this.thumb_i()];
  17357. this.states = [new egret.gui.State("normal", []), new egret.gui.State("disabled", [])]
  17358. }
  17359. __extends(a, b);
  17360. Object.defineProperty(a.prototype, "skinParts", {
  17361. get: function() {
  17362. return a._skinParts
  17363. },
  17364. enumerable: !0,
  17365. configurable: !0
  17366. });
  17367. a.prototype.thumb_i = function() {
  17368. var a = new egret.gui.Button;
  17369. this.thumb = a;
  17370. this.__s(a, ["height", "horizontalCenter", "skinName", "width"], [24, 0, c.simple.VSliderThumbSkin, 24]);
  17371. return a
  17372. };
  17373. a.prototype.trackHighlight_i = function() {
  17374. var a = new egret.gui.UIAsset;
  17375. this.trackHighlight = a;
  17376. this.__s(a, ["horizontalCenter", "source", "width"], [0, "vslider_fill_png", 10]);
  17377. return a
  17378. };
  17379. a.prototype.track_i = function() {
  17380. var a = new egret.gui.UIAsset;
  17381. this.track = a;
  17382. this.__s(a, ["percentHeight", "horizontalCenter", "source", "width"], [100, 0, "vslider_track_png", 10]);
  17383. return a
  17384. };
  17385. a._skinParts = ["track", "trackHighlight", "thumb"];
  17386. return a
  17387. }(egret.gui.Skin);
  17388. e.VSliderSkin = f;
  17389. f.prototype.__class__ = "skins.simple.VSliderSkin"
  17390. })(c.simple || (c.simple = {}))
  17391. })(skins || (skins = {}));
  17392. var __extends = this.__extends || function(c, e) {
  17393. function f() {
  17394. this.constructor = c
  17395. }
  17396. for (var b in e) e.hasOwnProperty(b) && (c[b] = e[b]);
  17397. f.prototype = e.prototype;
  17398. c.prototype = new f
  17399. }, PlayBg = function(c) {
  17400. function e() {
  17401. c.call(this);
  17402. this.bgArray = [];
  17403. this.state = "";
  17404. var e = RES.getRes("img_bg_level_1_jpg"),
  17405. b = new egret.Bitmap(e);
  17406. b.y = 0;
  17407. this.addChild(b);
  17408. this.bgArray.push(b);
  17409. e = new egret.Bitmap(e);
  17410. e.y = -e.height;
  17411. this.addChild(e);
  17412. this.bgArray.push(e)
  17413. }
  17414. __extends(e, c);
  17415. e.prototype.loop = function() {
  17416. "start" == this.state && this.step()
  17417. };
  17418. e.prototype.start = function() {
  17419. this.state = "start"
  17420. };
  17421. e.prototype.stop = function() {
  17422. this.state = "stop"
  17423. };
  17424. e.prototype.step = function() {
  17425. for (var c = this.bgArray, b, a = 0; a < c.length; a++) b = c[a], b.y += 3, b.y >= b.height && (c.shift(), c.push(b), b.y -= 2 * b.height)
  17426. };
  17427. return e
  17428. }(egret.DisplayObjectContainer);
  17429. PlayBg.prototype.__class__ = "PlayBg";