12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684 |
- var egret; (function(c) {
- c.egret_string_code = {};
- c.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
- c.egret_string_code[1E3] = "Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE";
- c.egret_string_code[1001] = "\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7";
- c.egret_string_code[1002] = "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
- c.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
- c.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
- c.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
- c.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
- c.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
- c.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
- c.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
- c.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
- c.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
- c.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
- c.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
- c.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
- c.egret_string_code[1015] = "xml not found!";
- c.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
- c.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
- c.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
- c.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
- c.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
- c.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
- c.egret_string_code[1022] = "{0} ArgumentError";
- c.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
- c.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
- c.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
- c.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
- c.egret_string_code[1027] = "DecodingError";
- c.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002";
- c.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
- c.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
- c.egret_string_code[1031] = "setVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume = value\u4ee3\u66ff";
- c.egret_string_code[1032] = "getVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume\u4ee3\u66ff";
- c.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
- c.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
- c.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
- c.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
- c.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
- c.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
- c.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
- c.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
- c.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
- c.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
- c.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
- c.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
- c.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
- c.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
- c.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
- c.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
- c.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
- c.egret_string_code[4001] = "Abstract class can not be instantiated!";
- c.egret_string_code[4002] = "Unnamed data!";
- c.egret_string_code[4003] = "Nonsupport version!";
- c.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
- c.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
- c.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
- })(egret || (egret = {})); (function(c) {
- c.egret_string_code = {};
- c.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
- c.egret_string_code[1E3] = "Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE";
- c.egret_string_code[1001] = "\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7";
- c.egret_string_code[1002] = "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
- c.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
- c.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
- c.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
- c.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
- c.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
- c.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
- c.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
- c.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
- c.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
- c.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
- c.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
- c.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
- c.egret_string_code[1015] = "xml not found!";
- c.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
- c.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
- c.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
- c.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
- c.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
- c.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
- c.egret_string_code[1022] = "{0} ArgumentError";
- c.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
- c.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
- c.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
- c.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
- c.egret_string_code[1027] = "DecodingError";
- c.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002";
- c.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
- c.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
- c.egret_string_code[1031] = "setVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume = value\u4ee3\u66ff";
- c.egret_string_code[1032] = "getVolume\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528this.volume\u4ee3\u66ff";
- c.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
- c.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
- c.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
- c.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
- c.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
- c.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
- c.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
- c.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
- c.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
- c.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
- c.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
- c.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
- c.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
- c.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
- c.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
- c.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
- c.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
- c.egret_string_code[4001] = "Abstract class can not be instantiated!";
- c.egret_string_code[4002] = "Unnamed data!";
- c.egret_string_code[4003] = "Nonsupport version!";
- c.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
- c.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
- c.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
- })(egret || (egret = {}));
- var __extends = this.__extends ||
- function(c, g) {
- function e() {
- this.constructor = c
- }
- for (var d in g) g.hasOwnProperty(d) && (c[d] = g[d]);
- e.prototype = g.prototype;
- c.prototype = new e
- }; (function(c) {
- function g(d) {
- for (var b = [], a = 1; a < arguments.length; a++) b[a - 1] = arguments[a];
- if (a = c.egret_string_code[d]) for (var f = b.length,
- v = 0; v < f; v++) a = a.replace("{" + v + "}", b[v]);
- return a
- }
- var e = function() {
- function d() {}
- d.openLogByType = function(b) {
- null == d.logFuncs && (d.logFuncs = {
- error: console.error,
- debug: console.debug,
- warn: console.warn,
- info: console.info,
- log: console.log
- });
- switch (b) {
- case d.OFF:
- console.error = function() {};
- case d.ERROR:
- console.warn = function() {};
- case d.WARN:
- console.info = function() {},
- console.log = function() {};
- case d.INFO:
- console.debug = function() {}
- }
- switch (b) {
- case d.ALL:
- console.debug = d.logFuncs.debug;
- case d.INFO:
- console.log = d.logFuncs.log,
- console.info = d.logFuncs.info;
- case d.WARN:
- console.warn = d.logFuncs.warn;
- case d.ERROR:
- console.error = d.logFuncs.error
- }
- };
- d.fatal = function(b, a) {
- void 0 === a && (a = null);
- c.Logger.traceToConsole("Fatal", b, a);
- throw Error(c.Logger.getTraceCode("Fatal", b, a));
- };
- d.info = function(b, a) {
- void 0 === a && (a = null);
- c.Logger.traceToConsole("Info", b, a)
- };
- d.warning = function(b, a) {
- void 0 === a && (a = null);
- c.Logger.traceToConsole("Warning", b, a)
- };
- d.fatalWithErrorId = function(b) {
- for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
- a.unshift(b); (a = g.apply(null, a)) ? d.fatal(a) : d.warning(g( - 1, b))
- };
- d.infoWithErrorId = function(b) {
- for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
- a.unshift(b); (a = g.apply(null, a)) ? d.info(a) : d.warning(g( - 1, b))
- };
- d.warningWithErrorId = function(b) {
- for (var a = [], f = 1; f < arguments.length; f++) a[f - 1] = arguments[f];
- a.unshift(b); (a = g.apply(null, a)) ? d.warning(a) : d.warning(g( - 1, b))
- };
- d.traceToConsole = function(b, a, f) {
- console.log(c.Logger.getTraceCode(b, a, f))
- };
- d.getTraceCode = function(b, a, f) {
- return "[" + b + "]" + a + (null == f ? "": ":" + f)
- };
- d.ALL = "all";
- d.DEBUG = "debug";
- d.INFO = "info";
- d.WARN = "warn";
- d.ERROR = "error";
- d.OFF = "off";
- return d
- } ();
- c.Logger = e;
- e.prototype.__class__ = "egret.Logger";
- c.getString = g
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {
- this._hashCode = c.hashCount++
- }
- Object.defineProperty(c.prototype, "hashCode", {
- get: function() {
- return this._hashCode
- },
- enumerable: !0,
- configurable: !0
- });
- c.hashCount = 1;
- return c
- } ();
- c.HashObject = g;
- g.prototype.__class__ = "egret.HashObject"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a) {
- void 0 === a && (a = 300);
- c.call(this);
- this.objectPool = [];
- this._length = 0;
- 1 > a && (a = 1);
- this.autoDisposeTime = a;
- this.frameCount = 0
- }
- __extends(d, c);
- var b = d.prototype;
- b._checkFrame = function() {
- this.frameCount--;
- 0 >= this.frameCount && this.dispose()
- };
- Object.defineProperty(b, "length", {
- get: function() {
- return this._length
- },
- enumerable: !0,
- configurable: !0
- });
- b.push = function(a) {
- var f = this.objectPool; - 1 == f.indexOf(a) && (f.push(a), a.__recycle && a.__recycle(), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, d._callBackList.push(this)))
- };
- b.pop = function() {
- if (0 == this._length) return null;
- this._length--;
- return this.objectPool.pop()
- };
- b.dispose = function() {
- 0 < this._length && (this.objectPool = [], this._length = 0);
- this.frameCount = 0;
- var a = d._callBackList,
- f = a.indexOf(this); - 1 != f && a.splice(f, 1)
- };
- d._callBackList = [];
- return d
- } (c.HashObject);
- c.Recycler = g;
- g.prototype.__class__ = "egret.Recycler"
- })(egret || (egret = {})); (function(c) {
- c.__START_TIME;
- c.getTimer = function() {
- return Date.now() - c.__START_TIME
- }
- })(egret || (egret = {})); (function(c) {
- c.__callLaterFunctionList = [];
- c.__callLaterThisList = [];
- c.__callLaterArgsList = [];
- c.callLater = function(g, e) {
- for (var d = [], b = 2; b < arguments.length; b++) d[b - 2] = arguments[b];
- c.__callLaterFunctionList.push(g);
- c.__callLaterThisList.push(e);
- c.__callLaterArgsList.push(d)
- };
- c.__callAsyncFunctionList = [];
- c.__callAsyncThisList = [];
- c.__callAsyncArgsList = [];
- c.__callAsync = function(g, e) {
- for (var d = [], b = 2; b < arguments.length; b++) d[b - 2] = arguments[b];
- c.__callAsyncFunctionList.push(g);
- c.__callAsyncThisList.push(e);
- c.__callAsyncArgsList.push(d)
- }
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {}
- var d = e.prototype;
- d.call = function(b) {
- this.callback && this.callback.call(this.thisObject, b)
- };
- d.dispose = function() {
- this.thisObject = this.callback = null;
- e.__freeList.push(this)
- };
- e.push = function(b, a) {
- var f;
- f = e.__freeList.length ? e.__freeList.pop() : new c.RenderCommand;
- f.callback = b;
- f.thisObject = a;
- c.MainContext.__DRAW_COMMAND_LIST.push(f)
- };
- e.__freeList = [];
- return e
- } ();
- c.RenderCommand = g;
- g.prototype.__class__ = "egret.RenderCommand"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, f, b) {
- void 0 === f && (f = !1);
- void 0 === b && (b = !1);
- e.call(this);
- this.data = null;
- this._type = "";
- this._cancelable = this._bubbles = !1;
- this._eventPhase = 2;
- this._target = this._currentTarget = null;
- this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
- this.isNew = !0;
- this._type = a;
- this._bubbles = f;
- this._cancelable = b
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "type", {
- get: function() {
- return this._type
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "bubbles", {
- get: function() {
- return this._bubbles
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "cancelable", {
- get: function() {
- return this._cancelable
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "eventPhase", {
- get: function() {
- return this._eventPhase
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "currentTarget", {
- get: function() {
- return this._currentTarget
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "target", {
- get: function() {
- return this._target
- },
- enumerable: !0,
- configurable: !0
- });
- b.isDefaultPrevented = function() {
- return this._isDefaultPrevented
- };
- b.preventDefault = function() {
- this._cancelable && (this._isDefaultPrevented = !0)
- };
- b.stopPropagation = function() {
- this._bubbles && (this._isPropagationStopped = !0)
- };
- b.stopImmediatePropagation = function() {
- this._bubbles && (this._isPropagationImmediateStopped = !0)
- };
- b._reset = function() {
- this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
- };
- b.__recycle = function() {
- this.data = this._target = this._currentTarget = null
- };
- d._dispatchByTarget = function(a, f, b, d, s, e) {
- void 0 === s && (s = !1);
- void 0 === e && (e = !1);
- var g = a.eventRecycler;
- g || (g = a.eventRecycler = new c.Recycler);
- var k = g.pop();
- k ? k._type = b: k = new a(b);
- k._bubbles = s;
- k._cancelable = e;
- if (d) for (var l in d) k[l] = d[l],
- null !== k[l] && (d[l] = null);
- a = f.dispatchEvent(k);
- g.push(k);
- return a
- };
- d._getPropertyData = function(a) {
- var f = a._props;
- f || (f = a._props = {});
- return f
- };
- d.dispatchEvent = function(a, f, b, c) {
- void 0 === b && (b = !1);
- var s = d._getPropertyData(d);
- void 0 != c && (s.data = c);
- d._dispatchByTarget(d, a, f, s, b)
- };
- d.ADDED_TO_STAGE = "addedToStage";
- d.REMOVED_FROM_STAGE = "removedFromStage";
- d.ADDED = "added";
- d.REMOVED = "removed";
- d.COMPLETE = "complete";
- d.LOOP_COMPLETE = "loopcomplete";
- d.ENTER_FRAME = "enterFrame";
- d.RENDER = "render";
- d.FINISH_RENDER = "finishRender";
- d.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
- d.LEAVE_STAGE = "leaveStage";
- d.RESIZE = "resize";
- d.CHANGE = "change";
- d.ACTIVATE = "activate";
- d.DEACTIVATE = "deactivate";
- d.CLOSE = "close";
- d.CONNECT = "connect";
- return d
- } (c.HashObject);
- c.Event = g;
- g.prototype.__class__ = "egret.Event"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- c.call(this, b, a, f);
- this._status = 0
- }
- __extends(d, c);
- Object.defineProperty(d.prototype, "status", {
- get: function() {
- return this._status
- },
- enumerable: !0,
- configurable: !0
- });
- d.dispatchHTTPStatusEvent = function(b, a) {
- null == d.httpStatusEvent && (d.httpStatusEvent = new d(d.HTTP_STATUS));
- d.httpStatusEvent._status = a;
- b.dispatchEvent(d.httpStatusEvent)
- };
- d.HTTP_STATUS = "httpStatus";
- d.httpStatusEvent = null;
- return d
- } (c.Event);
- c.HTTPStatusEvent = g;
- g.prototype.__class__ = "egret.HTTPStatusEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- c.call(this, b, a, f)
- }
- __extends(d, c);
- d.SOUND_COMPLETE = "soundComplete";
- return d
- } (c.Event);
- c.SoundEvent = g;
- g.prototype.__class__ = "egret.SoundEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- c.call(this, b, a, f)
- }
- __extends(d, c);
- d.FOCUS_IN = "focusIn";
- d.FOCUS_OUT = "focusOut";
- return d
- } (c.Event);
- c.FocusEvent = g;
- g.prototype.__class__ = "egret.FocusEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(b, a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- e.call(this, b, a, f)
- }
- __extends(d, e);
- d.dispatchIOErrorEvent = function(b) {
- c.Event._dispatchByTarget(d, b, d.IO_ERROR)
- };
- d.IO_ERROR = "ioError";
- return d
- } (c.Event);
- c.IOErrorEvent = g;
- g.prototype.__class__ = "egret.IOErrorEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, f, b, c, d, n, g, k, l, m) {
- void 0 === f && (f = !0);
- void 0 === b && (b = !0);
- void 0 === c && (c = 0);
- void 0 === d && (d = 0);
- void 0 === n && (n = 0);
- void 0 === g && (g = !1);
- void 0 === k && (k = !1);
- void 0 === m && (m = !1);
- e.call(this, a, f, b);
- this._stageY = this._stageX = 0;
- this.touchPointID = NaN;
- this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
- this.touchPointID = c;
- this._stageX = d;
- this._stageY = n;
- this.ctrlKey = g;
- this.altKey = k;
- this.touchDown = m
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "stageX", {
- get: function() {
- return this._stageX
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "stageY", {
- get: function() {
- return this._stageY
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "localX", {
- get: function() {
- return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).x
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "localY", {
- get: function() {
- return this._currentTarget.globalToLocal(this._stageX, this._stageY, c.Point.identity).y
- },
- enumerable: !0,
- configurable: !0
- });
- d.dispatchTouchEvent = function(a, f, b, t, s, e, g, k, l) {
- void 0 === b && (b = 0);
- void 0 === t && (t = 0);
- void 0 === s && (s = 0);
- void 0 === e && (e = !1);
- void 0 === g && (g = !1);
- void 0 === k && (k = !1);
- void 0 === l && (l = !1);
- var m = c.Event._getPropertyData(d);
- m.touchPointID = b;
- m._stageX = t;
- m._stageY = s;
- m.ctrlKey = e;
- m.altKey = g;
- m.shiftKey = k;
- m.touchDown = l;
- c.Event._dispatchByTarget(d, a, f, m, !0, !0)
- };
- d.TOUCH_TAP = "touchTap";
- d.TOUCH_MOVE = "touchMove";
- d.TOUCH_BEGIN = "touchBegin";
- d.TOUCH_END = "touchEnd";
- d.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
- d.TOUCH_ROLL_OUT = "touchRollOut";
- d.TOUCH_ROLL_OVER = "touchRollOver";
- d.TOUCH_OUT = "touchOut";
- d.TOUCH_OVER = "touchOver";
- return d
- } (c.Event);
- c.TouchEvent = g;
- g.prototype.__class__ = "egret.TouchEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(b, a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- e.call(this, b, a, f)
- }
- __extends(d, e);
- d.dispatchTimerEvent = function(b, a) {
- c.Event._dispatchByTarget(d, b, a)
- };
- d.TIMER = "timer";
- d.TIMER_COMPLETE = "timerComplete";
- return d
- } (c.Event);
- c.TimerEvent = g;
- g.prototype.__class__ = "egret.TimerEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(b, a, f, v) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- void 0 === v && (v = "");
- e.call(this, b, a, f);
- this.text = v
- }
- __extends(d, e);
- d.dispatchTextEvent = function(b, a, f) {
- var v = c.Event._getPropertyData(d);
- v.text = f;
- c.Event._dispatchByTarget(d, b, a, v)
- };
- d.LINK = "link";
- return d
- } (c.Event);
- c.TextEvent = g;
- g.prototype.__class__ = "egret.TextEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(b, a, f, v, c) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- void 0 === v && (v = 0);
- void 0 === c && (c = 0);
- e.call(this, b, a, f);
- this.bytesTotal = this.bytesLoaded = 0;
- this.bytesLoaded = v;
- this.bytesTotal = c
- }
- __extends(d, e);
- d.dispatchProgressEvent = function(b, a, f, v) {
- void 0 === f && (f = 0);
- void 0 === v && (v = 0);
- c.Event._dispatchByTarget(d, b, a, {
- bytesLoaded: f,
- bytesTotal: v
- })
- };
- d.PROGRESS = "progress";
- d.SOCKET_DATA = "socketData";
- return d
- } (c.Event);
- c.ProgressEvent = g;
- g.prototype.__class__ = "egret.ProgressEvent"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.CAPTURING_PHASE = 1;
- c.AT_TARGET = 2;
- c.BUBBLING_PHASE = 3;
- return c
- } ();
- c.EventPhase = g;
- g.prototype.__class__ = "egret.EventPhase"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- void 0 === a && (a = null);
- e.call(this);
- this._captureEventsMap = this._eventsMap = this._eventTarget = null;
- this._eventTarget = a ? a: this
- }
- __extends(d, e);
- var b = d.prototype;
- b.addEventListener = function(a, f, b, d, s) {
- void 0 === d && (d = !1);
- void 0 === s && (s = 0);
- "undefined" === typeof d && (d = !1);
- "undefined" === typeof s && (s = 0);
- f || c.Logger.fatalWithErrorId(1010);
- d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
- var e = d[a];
- e || (e = d[a] = []);
- this._insertEventBin(e, f, b, s)
- };
- b._insertEventBin = function(a, f, b, c, d) {
- void 0 === d && (d = void 0);
- for (var e = -1,
- g = a.length,
- k = 0; k < g; k++) {
- var l = a[k];
- if (l.listener == f && l.thisObject == b && l.display == d) return ! 1; - 1 == e && l.priority < c && (e = k)
- }
- f = {
- listener: f,
- thisObject: b,
- priority: c
- };
- d && (f.display = d); - 1 != e ? a.splice(e, 0, f) : a.push(f);
- return ! 0
- };
- b.removeEventListener = function(a, f, b, c) {
- void 0 === c && (c = !1);
- if (c = c ? this._captureEventsMap: this._eventsMap) {
- var d = c[a];
- d && (this._removeEventBin(d, f, b), 0 == d.length && delete c[a])
- }
- };
- b._removeEventBin = function(a, f, b, c, d) {
- void 0 === c && (c = void 0);
- void 0 === d && (d = 0);
- for (var e = a.length; d < e; d++) {
- var g = a[d];
- if (g.listener == f && g.thisObject == b && g.display == c) return a.splice(d, 1),
- !0
- }
- return ! 1
- };
- b.hasEventListener = function(a) {
- return !! (this._eventsMap && this._eventsMap[a] || this._captureEventsMap && this._captureEventsMap[a])
- };
- b.willTrigger = function(a) {
- return this.hasEventListener(a)
- };
- b.dispatchEvent = function(a) {
- a._reset();
- a._target = this._eventTarget;
- a._currentTarget = this._eventTarget;
- return this._notifyListener(a)
- };
- b._notifyListener = function(a) {
- var f = 1 == a._eventPhase ? this._captureEventsMap: this._eventsMap;
- if (!f) return ! 0;
- f = f[a._type];
- if (!f) return ! 0;
- var b = f.length;
- if (0 == b) return ! 0;
- for (var f = f.concat(), c = 0; c < b; c++) {
- var d = f[c];
- d.listener.call(d.thisObject, a);
- if (a._isPropagationImmediateStopped) break
- }
- return ! a._isDefaultPrevented
- };
- b.dispatchEventWith = function(a, f, b) {
- void 0 === f && (f = !1);
- c.Event.dispatchEvent(this, a, f, b)
- };
- return d
- } (c.HashObject);
- c.EventDispatcher = g;
- g.prototype.__class__ = "egret.EventDispatcher"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
- this.reuseEvent = new c.Event("")
- }
- __extends(d, e);
- var b = d.prototype;
- b.run = function() {
- c.Ticker.getInstance().run();
- c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
- c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
- this.touchContext.run();
- this._profileInstance = c.Profiler.getInstance()
- };
- b.renderLoop = function(a) {
- if (0 < c.__callLaterFunctionList.length) {
- var f = c.__callLaterFunctionList;
- c.__callLaterFunctionList = [];
- var b = c.__callLaterThisList;
- c.__callLaterThisList = [];
- var t = c.__callLaterArgsList;
- c.__callLaterArgsList = []
- }
- a = this.stage;
- var e = d.cachedEvent;
- e._type = c.Event.RENDER;
- this.dispatchEvent(e);
- c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
- f && this.doCallLaterList(f, b, t);
- 0 < c.__callAsyncFunctionList.length && this.doCallAsyncList();
- f = this.rendererContext;
- f.onRenderStart();
- f.clearScreen();
- d.__DRAW_COMMAND_LIST = [];
- d._renderLoopPhase = "updateTransform";
- a._updateTransform();
- d._renderLoopPhase = "draw";
- e._type = c.Event.FINISH_UPDATE_TRANSFORM;
- this.dispatchEvent(e);
- d.__use_new_draw ? this._draw(f) : a._draw(f);
- e._type = c.Event.FINISH_RENDER;
- this.dispatchEvent(e);
- this._profileInstance._isRunning && this._profileInstance._drawProfiler(f);
- f.onRenderFinish()
- };
- b._draw = function(a) {
- for (var f = d.__DRAW_COMMAND_LIST,
- b = f.length,
- c = 0; c < b; c++) {
- var e = f[c];
- e.call(a);
- e.dispose()
- }
- };
- b.broadcastEnterFrame = function(a) {
- a = this.reuseEvent;
- a._type = c.Event.ENTER_FRAME;
- this.dispatchEvent(a);
- for (var f = c.DisplayObject._enterFrameCallBackList.concat(), b = f.length, d = 0; d < b; d++) {
- var e = f[d];
- a._target = e.display;
- a._currentTarget = e.display;
- e.listener.call(e.thisObject, a)
- }
- f = c.Recycler._callBackList;
- for (d = f.length - 1; 0 <= d; d--) f[d]._checkFrame()
- };
- b.broadcastRender = function() {
- var a = this.reuseEvent;
- a._type = c.Event.RENDER;
- for (var f = c.DisplayObject._renderCallBackList.concat(), b = f.length, d = 0; d < b; d++) {
- var e = f[d],
- n = e.display;
- a._target = n;
- a._currentTarget = n;
- e.listener.call(e.thisObject, a)
- }
- };
- b.doCallLaterList = function(a, f, b) {
- for (var c = a.length,
- d = 0; d < c; d++) {
- var e = a[d];
- null != e && e.apply(f[d], b[d])
- }
- };
- b.doCallAsyncList = function() {
- var a = c.__callAsyncFunctionList.concat(),
- f = c.__callAsyncThisList.concat(),
- b = c.__callAsyncArgsList.concat();
- c.__callAsyncFunctionList.length = 0;
- c.__callAsyncThisList.length = 0;
- for (var d = c.__callAsyncArgsList.length = 0; d < a.length; d++) {
- var e = a[d];
- null != e && e.apply(f[d], b[d])
- }
- };
- d.deviceType = null;
- d.DEVICE_PC = "web";
- d.DEVICE_MOBILE = "native";
- d.RUNTIME_HTML5 = "runtimeHtml5";
- d.RUNTIME_NATIVE = "runtimeNative";
- d.__DRAW_COMMAND_LIST = [];
- d.__use_new_draw = !0;
- d.cachedEvent = new c.Event("");
- return d
- } (c.EventDispatcher);
- c.MainContext = g;
- g.prototype.__class__ = "egret.MainContext"
- })(egret || (egret = {}));
- var testDeviceType = function() {
- if (!this.navigator) return ! 0;
- var c = navigator.userAgent.toLowerCase();
- return - 1 != c.indexOf("mobile") || -1 != c.indexOf("android")
- },
- testRuntimeType = function() {
- return this.navigator ? !0 : !1
- };
- egret.MainContext.instance = new egret.MainContext;
- egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC;
- egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5: egret.MainContext.RUNTIME_NATIVE;
- delete testDeviceType;
- delete testRuntimeType; (function(c) {
- var g = function() {
- function e() {
- this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
- this._calculatePreDrawCount = !0;
- this._txt = null;
- this._tick = 0;
- this._maxDeltaTime = 500;
- this._totalDeltaTime = 0;
- this._isRunning = !1
- }
- var d = e.prototype;
- e.getInstance = function() {
- null == e.instance && (e.instance = new e);
- return e.instance
- };
- d.stop = function() {
- if (this._isRunning) {
- this._isRunning = !1;
- c.Ticker.getInstance().unregister(this.update, this);
- var b = c.MainContext.instance;
- b.removeEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
- b.removeEventListener(c.Event.RENDER, this.onStartRender, this);
- b.removeEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
- b.removeEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
- }
- };
- d.run = function() {
- null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._DO_Props_._parent = new c.DisplayObjectContainer);
- if (!this._isRunning) {
- this._isRunning = !0;
- c.Ticker.getInstance().register(this.update, this);
- var b = c.MainContext.instance;
- b.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
- b.addEventListener(c.Event.RENDER, this.onStartRender, this);
- b.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
- b.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
- }
- };
- d._drawProfiler = function(b) {
- "_drawWebGL" in b && b._drawWebGL();
- this._calculatePreDrawCount = !1;
- this._txt._updateTransform();
- this._txt._draw(b)
- };
- d._setTxtFontSize = function(b) {
- this._txt.size = b
- };
- d.onEnterFrame = function(b) {
- this._lastTime = c.getTimer()
- };
- d.onStartRender = function(b) {
- b = c.getTimer();
- this._logicPerformanceCost = b - this._lastTime;
- this._lastTime = b
- };
- d.onFinishUpdateTransform = function(b) {
- b = c.getTimer();
- this._updateTransformPerformanceCost = b - this._lastTime;
- this._lastTime = b
- };
- d.onFinishRender = function(b) {
- b = c.getTimer();
- this._renderPerformanceCost = b - this._lastTime;
- this._lastTime = b
- };
- d.update = function(b) {
- this._tick++;
- this._totalDeltaTime += b;
- if (this._totalDeltaTime >= this._maxDeltaTime) {
- b = this._preDrawCount.toString();
- 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();
- this._txt.text = "draw:" + b + "\ncost:" + a + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
- this._tick = this._totalDeltaTime = 0
- }
- this._preDrawCount = 0;
- this._calculatePreDrawCount = !0
- };
- d.onDrawImage = function() {
- this._calculatePreDrawCount && this._preDrawCount++
- };
- return e
- } ();
- c.Profiler = g;
- g.prototype.__class__ = "egret.Profiler"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._timeScale = 1;
- this._paused = !1;
- this._callIndex = -1;
- this.callBackList = [];
- null != d.instance && c.Logger.fatalWithErrorId(1002)
- }
- __extends(d, e);
- var b = d.prototype;
- b.run = function() {
- c.__START_TIME = (new Date).getTime();
- c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
- };
- b.update = function(a) {
- if (!this._paused) {
- a *= this._timeScale;
- a *= this._timeScale;
- this._callList = this.callBackList.concat();
- for (this._callIndex = 0; this._callIndex < this._callList.length; this._callIndex++) {
- var f = this._callList[this._callIndex];
- f.listener.call(f.thisObject, a)
- }
- this._callIndex = -1;
- this._callList = null
- }
- };
- b.register = function(a, f, b) {
- void 0 === b && (b = 0);
- this._insertEventBin(this.callBackList, a, f, b)
- };
- b.unregister = function(a, f) {
- this._removeEventBin(this.callBackList, a, f);
- this._callList && -1 < this._callIndex && this._removeEventBin(this._callList, a, f, null, this._callIndex + 1)
- };
- b.setTimeout = function(a, f, b) {
- for (var d = [], e = 3; e < arguments.length; e++) d[e - 3] = arguments[e];
- c.Logger.warningWithErrorId(1003);
- c.setTimeout.apply(null, [a, f, b].concat(d))
- };
- b.setTimeScale = function(a) {
- this._timeScale = a
- };
- b.getTimeScale = function() {
- return this._timeScale
- };
- b.pause = function() {
- this._paused = !0
- };
- b.resume = function() {
- this._paused = !1
- };
- d.getInstance = function() {
- null == d.instance && (d.instance = new d);
- return d.instance
- };
- return d
- } (c.EventDispatcher);
- c.Ticker = g;
- g.prototype.__class__ = "egret.Ticker"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.LEFT = "left";
- c.RIGHT = "right";
- c.CENTER = "center";
- c.JUSTIFY = "justify";
- c.CONTENT_JUSTIFY = "contentJustify";
- return c
- } ();
- c.HorizontalAlign = g;
- g.prototype.__class__ = "egret.HorizontalAlign"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.TOP = "top";
- c.BOTTOM = "bottom";
- c.MIDDLE = "middle";
- c.JUSTIFY = "justify";
- c.CONTENT_JUSTIFY = "contentJustify";
- return c
- } ();
- c.VerticalAlign = g;
- g.prototype.__class__ = "egret.VerticalAlign"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, f) {
- void 0 === f && (f = 0);
- e.call(this);
- this._currentCount = 0;
- this._running = !1;
- this.lastTime = 0;
- this.delay = a;
- this.repeatCount = f
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "currentCount", {
- get: function() {
- return this._currentCount
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "running", {
- get: function() {
- return this._running
- },
- enumerable: !0,
- configurable: !0
- });
- b.reset = function() {
- this.stop();
- this._currentCount = 0
- };
- b.start = function() {
- this._running || (this.lastTime = c.getTimer(), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
- };
- b.stop = function() {
- this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
- };
- b.onEnterFrame = function(a) {
- a = c.getTimer();
- 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)))
- };
- return d
- } (c.EventDispatcher);
- c.Timer = g;
- g.prototype.__class__ = "egret.Timer"
- })(egret || (egret = {})); (function(c) {
- function g(c) {
- c = c.prototype ? c.prototype: Object.getPrototypeOf(c);
- if (c.hasOwnProperty("__class__")) return c.__class__;
- var d = c.constructor.toString(),
- b = d.indexOf("("),
- d = d.substring(9, b);
- Object.defineProperty(c, "__class__", {
- value: d,
- enumerable: !1,
- writable: !0
- });
- return d
- }
- c.getQualifiedClassName = g;
- c.getQualifiedSuperclassName = function(c) {
- c = c.prototype ? c.prototype: Object.getPrototypeOf(c);
- if (c.hasOwnProperty("__superclass__")) return c.__superclass__;
- var d = Object.getPrototypeOf(c);
- if (null == d) return null;
- d = g(d.constructor);
- if (!d) return null;
- Object.defineProperty(c, "__superclass__", {
- value: d,
- enumerable: !1,
- writable: !0
- });
- return d
- }
- })(egret || (egret = {})); (function(c) {
- var g = {};
- c.getDefinitionByName = function(c) {
- if (!c) return null;
- var d = g[c];
- if (d) return d;
- for (var b = c.split("."), a = b.length, d = __global, f = 0; f < a; f++) if (d = d[b[f]], !d) return null;
- return g[c] = d
- }
- })(egret || (egret = {}));
- var __global = __global || this; (function(c) {
- function g(b) {
- for (var a in e) {
- var f = e[a];
- f.delay -= b;
- 0 >= f.delay && (f.listener.apply(f.thisObject, f.params), delete e[a])
- }
- }
- var e = {},
- d = 0;
- c.setTimeout = function(b, a, f) {
- for (var v = [], t = 3; t < arguments.length; t++) v[t - 3] = arguments[t];
- v = {
- listener: b,
- thisObject: a,
- delay: f,
- params: v
- };
- 0 == d && c.Ticker.getInstance().register(g, null);
- d++;
- e[d] = v;
- return d
- };
- c.clearTimeout = function(b) {
- delete e[b]
- }
- })(egret || (egret = {})); (function(c) {
- function g(b) {
- for (var a in e) {
- var f = e[a];
- f.delay -= b;
- 0 >= f.delay && (f.delay = f.originDelay, f.listener.apply(f.thisObject, f.params))
- }
- }
- var e = {},
- d = 0;
- c.setInterval = function(b, a, f) {
- for (var v = [], t = 3; t < arguments.length; t++) v[t - 3] = arguments[t];
- v = {
- listener: b,
- thisObject: a,
- delay: f,
- originDelay: f,
- params: v
- };
- 0 == d && c.Ticker.getInstance().register(g, null);
- d++;
- e[d] = v;
- return d
- };
- c.clearInterval = function(b) {
- delete e[b]
- }
- })(egret || (egret = {})); (function(c) {
- c.hasDefinition = function(g) {
- return c.getDefinitionByName(g) ? !0 : !1
- }
- })(egret || (egret = {})); (function(c) {
- c.toColorString = function(c) {
- if (isNaN(c) || 0 > c) c = 0;
- 16777215 < c && (c = 16777215);
- for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
- return "#" + c
- }
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, f, b, c, d, n) {
- void 0 === a && (a = 1);
- void 0 === f && (f = 0);
- void 0 === b && (b = 0);
- void 0 === c && (c = 1);
- void 0 === d && (d = 0);
- void 0 === n && (n = 0);
- e.call(this);
- this.a = a;
- this.b = f;
- this.c = b;
- this.d = c;
- this.tx = d;
- this.ty = n
- }
- __extends(d, e);
- var b = d.prototype;
- b.prepend = function(a, f, b, c, d, e) {
- var g = this.tx;
- if (1 != a || 0 != f || 0 != b || 1 != c) {
- var k = this.a,
- l = this.c;
- this.a = k * a + this.b * b;
- this.b = k * f + this.b * c;
- this.c = l * a + this.d * b;
- this.d = l * f + this.d * c
- }
- this.tx = g * a + this.ty * b + d;
- this.ty = g * f + this.ty * c + e;
- return this
- };
- b.append = function(a, f, b, c, d, e) {
- var g = this.a,
- k = this.b,
- l = this.c,
- m = this.d;
- if (1 != a || 0 != f || 0 != b || 1 != c) this.a = a * g + f * l,
- this.b = a * k + f * m,
- this.c = b * g + c * l,
- this.d = b * k + c * m;
- this.tx = d * g + e * l + this.tx;
- this.ty = d * k + e * m + this.ty;
- return this
- };
- b.prependTransform = function(a, f, b, d, e, n, g, k, l) {
- if (e % 360) {
- var m = c.NumberUtils.cos(e);
- e = c.NumberUtils.sin(e)
- } else m = 1,
- e = 0;
- if (k || l) this.tx -= k,
- this.ty -= l;
- n || g ? (this.prepend(m * b, e * b, -e * d, m * d, 0, 0), this.prepend(c.NumberUtils.cos(g), c.NumberUtils.sin(g), -c.NumberUtils.sin(n), c.NumberUtils.cos(n), a, f)) : this.prepend(m * b, e * b, -e * d, m * d, a, f);
- return this
- };
- b.appendTransform = function(a, f, b, d, e, n, g, k, l) {
- if (e % 360) {
- var m = c.NumberUtils.cos(e);
- e = c.NumberUtils.sin(e)
- } else m = 1,
- e = 0;
- n || g ? (this.append(c.NumberUtils.cos(g), c.NumberUtils.sin(g), -c.NumberUtils.sin(n), c.NumberUtils.cos(n), a, f), this.append(m * b, e * b, -e * d, m * d, 0, 0)) : this.append(m * b, e * b, -e * d, m * d, a, f);
- if (k || l) this.tx -= k * this.a + l * this.c,
- this.ty -= k * this.b + l * this.d;
- return this
- };
- b.rotate = function(a) {
- var f = Math.cos(a);
- a = Math.sin(a);
- var b = this.a,
- c = this.c,
- d = this.tx;
- this.a = b * f - this.b * a;
- this.b = b * a + this.b * f;
- this.c = c * f - this.d * a;
- this.d = c * a + this.d * f;
- this.tx = d * f - this.ty * a;
- this.ty = d * a + this.ty * f;
- return this
- };
- b.skew = function(a, f) {
- this.append(c.NumberUtils.cos(f), c.NumberUtils.sin(f), -c.NumberUtils.sin(a), c.NumberUtils.cos(a), 0, 0);
- return this
- };
- b.scale = function(a, f) {
- this.a *= a;
- this.d *= f;
- this.c *= a;
- this.b *= f;
- this.tx *= a;
- this.ty *= f;
- return this
- };
- b.translate = function(a, f) {
- this.tx += a;
- this.ty += f;
- return this
- };
- b.identity = function() {
- this.a = this.d = 1;
- this.b = this.c = this.tx = this.ty = 0;
- return this
- };
- b.identityMatrix = function(a) {
- this.a = a.a;
- this.b = a.b;
- this.c = a.c;
- this.d = a.d;
- this.tx = a.tx;
- this.ty = a.ty;
- return this
- };
- b.invert = function() {
- var a = this.a,
- f = this.b,
- b = this.c,
- c = this.d,
- d = this.tx,
- e = a * c - f * b;
- this.a = c / e;
- this.b = -f / e;
- this.c = -b / e;
- this.d = a / e;
- this.tx = (b * this.ty - c * d) / e;
- this.ty = -(a * this.ty - f * d) / e;
- return this
- };
- d.transformCoords = function(a, f, b) {
- var d = c.Point.identity;
- d.x = a.a * f + a.c * b + a.tx;
- d.y = a.d * b + a.b * f + a.ty;
- return d
- };
- b.toArray = function(a) {
- this.array || (this.array = new Float32Array(9));
- 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);
- this.array[8] = 1;
- return this.array
- };
- b.setTo = function(a, f, b, c, d, e) {
- this.a = a;
- this.b = f;
- this.c = b;
- this.d = c;
- this.tx = d;
- this.ty = e
- };
- b.copyForm = function(a) {
- this.identityMatrix(a)
- };
- d.identity = new d;
- d.DEG_TO_RAD = Math.PI / 180;
- return d
- } (c.HashObject);
- c.Matrix = g;
- g.prototype.__class__ = "egret.Matrix"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a, f) {
- void 0 === a && (a = 0);
- void 0 === f && (f = 0);
- c.call(this);
- this.x = a;
- this.y = f
- }
- __extends(d, c);
- var b = d.prototype;
- b.clone = function() {
- return new d(this.x, this.y)
- };
- b.equals = function(a) {
- return this.x == a.x && this.y == a.y
- };
- d.distance = function(a, f) {
- return Math.sqrt((a.x - f.x) * (a.x - f.x) + (a.y - f.y) * (a.y - f.y))
- };
- b.setTo = function(a, f) {
- this.x = a;
- this.y = f
- };
- b.copyForm = function(a) {
- this.x = a.x;
- this.y = a.y
- };
- d.identity = new d(0, 0);
- return d
- } (c.HashObject);
- c.Point = g;
- g.prototype.__class__ = "egret.Point"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a, f, b, d) {
- void 0 === a && (a = 0);
- void 0 === f && (f = 0);
- void 0 === b && (b = 0);
- void 0 === d && (d = 0);
- c.call(this);
- this.x = a;
- this.y = f;
- this.width = b;
- this.height = d
- }
- __extends(d, c);
- var b = d.prototype;
- Object.defineProperty(b, "left", {
- get: function() {
- return this.x
- },
- set: function(a) {
- this.width += this.x - a;
- this.x = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "right", {
- get: function() {
- return this.x + this.width
- },
- set: function(a) {
- this.width = a - this.x
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "top", {
- get: function() {
- return this.y
- },
- set: function(a) {
- this.height += this.y - a;
- this.y = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "bottom", {
- get: function() {
- return this.y + this.height
- },
- set: function(a) {
- this.height = a - this.y
- },
- enumerable: !0,
- configurable: !0
- });
- b.initialize = function(a, f, b, c) {
- this.x = a;
- this.y = f;
- this.width = b;
- this.height = c;
- return this
- };
- b.contains = function(a, f) {
- return this.x <= a && this.x + this.width >= a && this.y <= f && this.y + this.height >= f
- };
- b.intersects = function(a) {
- return Math.max(this.x, a.x) <= Math.min(this.right, a.right) && Math.max(this.y, a.y) <= Math.min(this.bottom, a.bottom)
- };
- b.setEmpty = function() {
- this.height = this.width = this.y = this.x = 0
- };
- b.clone = function() {
- return new d(this.x, this.y, this.width, this.height)
- };
- b.containsPoint = function(a) {
- return this.x < a.x && this.x + this.width > a.x && this.y < a.y && this.y + this.height > a.y ? !0 : !1
- };
- b.setTo = function(a, f, b, c) {
- this.initialize(a, f, b, c)
- };
- b.copyForm = function(a) {
- this.x = a.x;
- this.y = a.y;
- this.width = a.width;
- this.height = a.height
- };
- b.inflate = function(a, f) {
- this.x -= a;
- this.width += 2 * a;
- this.y -= f;
- this.height += 2 * f
- };
- b.isEmpty = function() {
- return 0 == this.width || 0 == this.height
- };
- d.identity = new d(0, 0, 0, 0);
- return d
- } (c.HashObject);
- c.Rectangle = g;
- g.prototype.__class__ = "egret.Rectangle"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a, f, b, d, s, g, h, k) {
- void 0 === a && (a = 1);
- void 0 === f && (f = 1);
- void 0 === b && (b = 1);
- void 0 === d && (d = 1);
- void 0 === s && (s = 0);
- void 0 === g && (g = 0);
- void 0 === h && (h = 0);
- void 0 === k && (k = 0);
- c.call(this);
- this._redMultiplier = a;
- this._greenMultiplier = f;
- this._blueMultiplier = b;
- this._alphaMultiplier = d;
- this._redOffset = s;
- this._greenOffset = g;
- this._blueOffset = h;
- this._alphaOffset = k
- }
- __extends(d, c);
- var b = d.prototype;
- Object.defineProperty(b, "alphaMultiplier", {
- get: function() {
- return this._alphaMultiplier
- },
- set: function(a) {
- this._alphaMultiplier = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "alphaOffset", {
- get: function() {
- return this._alphaOffset
- },
- set: function(a) {
- this._alphaOffset = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "blueMultiplier", {
- get: function() {
- return this._blueMultiplier
- },
- set: function(a) {
- this._blueMultiplier = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "blueOffset", {
- get: function() {
- return this._blueOffset
- },
- set: function(a) {
- this._blueOffset = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "greenMultiplier", {
- get: function() {
- return this._greenMultiplier
- },
- set: function(a) {
- this._greenMultiplier = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "greenOffset", {
- get: function() {
- return this._greenOffset
- },
- set: function(a) {
- this._greenOffset = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "redMultiplier", {
- get: function() {
- return this._redMultiplier
- },
- set: function(a) {
- this._redMultiplier = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "redOffset", {
- get: function() {
- return this._redOffset
- },
- set: function(a) {
- this._redOffset = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "color", {
- get: function() {
- return this._redOffset << 16 + this._greenOffset << 8 + this._blueOffset
- },
- enumerable: !0,
- configurable: !0
- });
- b.identityColorTransform = function(a) {
- this._alphaMultiplier = a._alphaMultiplier;
- this._alphaOffset = a._alphaOffset;
- this._redMultiplier = a._redMultiplier;
- this._redOffset = a._redOffset;
- this._greenMultiplier = a._greenMultiplier;
- this._greenOffset = a._greenOffset;
- this._blueMultiplier = a._blueMultiplier;
- this._blueOffset = a._blueOffset
- };
- return d
- } (c.HashObject);
- c.ColorTransform = g;
- g.prototype.__class__ = "egret.ColorTransform"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- e.call(this);
- this._matrix = new c.Matrix;
- this._matrix2 = new c.Matrix;
- this._colorTransform = new c.ColorTransform;
- this._colorTransform2 = new c.ColorTransform;
- this._display = a
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "matrix", {
- get: function() {
- this._matrix2.identityMatrix(this._matrix);
- return this._matrix2
- },
- set: function(a) {
- this._setMatrix(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMatrix = function(a) {
- this._display.__hack_local_matrix || (this._display.__hack_local_matrix = new c.Matrix);
- this._display.__hack_local_matrix.identityMatrix(a);
- this._matrix.identityMatrix(a)
- };
- Object.defineProperty(b, "colorTransform", {
- get: function() {
- this._colorTransform2.identityColorTransform(this._colorTransform);
- return this._colorTransform2
- },
- set: function(a) {
- this._setColorTransform(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setColorTransform = function(a) {
- this._colorTransform.identityColorTransform(a)
- };
- return d
- } (c.HashObject);
- c.Transform = g;
- g.prototype.__class__ = "egret.Transform"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._isSupportDOMParser = this._xmlDict = this._parser = null;
- this._xmlDict = {};
- window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
- }
- __extends(d, e);
- var b = d.prototype;
- d.getInstance = function() {
- d._instance || (d._instance = new d);
- return d._instance
- };
- b.parserXML = function(a) {
- for (var f = 0;
- "\n" == a.charAt(f) || "\t" == a.charAt(f) || "\r" == a.charAt(f) || " " == a.charAt(f);) f++;
- 0 != f && (a = a.substring(f, a.length));
- this._isSupportDOMParser ? f = this._parser.parseFromString(a, "text/xml") : (f = new ActiveXObject("Microsoft.XMLDOM"), f.async = "false", f.loadXML(a));
- null == f && c.Logger.infoWithErrorId(1015);
- return f
- };
- d._instance = null;
- return d
- } (c.HashObject);
- c.SAXParser = g;
- g.prototype.__class__ = "egret.SAXParser"
- })(egret || (egret = {})); (function(c) {
- var g = function(a) {
- function b() {
- a.call(this);
- this._designHeight = this._designWidth = 0;
- this._scaleY = this._scaleX = 1;
- this._stageHeight = this._stageWidth = this._offSetY = 0
- }
- __extends(b, a);
- var t = b.prototype;
- b.getInstance = function() {
- null == b.instance && (d.initialize(), b.instance = new b);
- return b.instance
- };
- t.setDesignSize = function(a, f, b) {
- this._designWidth = a;
- this._designHeight = f;
- b && (c.Logger.warningWithErrorId(1001), this._setResolutionPolicy(b))
- };
- t._setResolutionPolicy = function(a) {
- this._resolutionPolicy = a;
- a.init(this);
- a._apply(this, this._designWidth, this._designHeight)
- };
- t.getScaleX = function() {
- return this._scaleX
- };
- t.getScaleY = function() {
- return this._scaleY
- };
- t.getOffSetY = function() {
- return this._offSetY
- };
- b.canvas_name = "egretCanvas";
- b.egret_root_div = "gameDiv";
- b.canvas_div_name = "canvasDiv";
- return b
- } (c.HashObject);
- c.StageDelegate = g;
- g.prototype.__class__ = "egret.StageDelegate";
- var e = function() {
- function a(f, b) {
- this._containerStrategy = f;
- this._contentStrategy = b
- }
- var b = a.prototype;
- b.init = function(a) {
- this._containerStrategy.init(a);
- this._contentStrategy.init(a)
- };
- b._apply = function(a, f, b) {
- this._containerStrategy._apply(a, f, b);
- this._contentStrategy._apply(a, f, b)
- };
- return a
- } ();
- c.ResolutionPolicy = e;
- e.prototype.__class__ = "egret.ResolutionPolicy";
- var d = function() {
- function a() {}
- var c = a.prototype;
- a.initialize = function() {
- a.EQUAL_TO_FRAME = new b
- };
- c.init = function(a) {};
- c._apply = function(a, f, b) {};
- c._setupContainer = function() {
- var a = document.body,
- f;
- a && (f = a.style) && (f.paddingTop = f.paddingTop || "0px", f.paddingRight = f.paddingRight || "0px", f.paddingBottom = f.paddingBottom || "0px", f.paddingLeft = f.paddingLeft || "0px", f.borderTop = f.borderTop || "0px", f.borderRight = f.borderRight || "0px", f.borderBottom = f.borderBottom || "0px", f.borderLeft = f.borderLeft || "0px", f.marginTop = f.marginTop || "0px", f.marginRight = f.marginRight || "0px", f.marginBottom = f.marginBottom || "0px", f.marginLeft = f.marginLeft || "0px")
- };
- return a
- } ();
- c.ContainerStrategy = d;
- d.prototype.__class__ = "egret.ContainerStrategy";
- var b = function(a) {
- function b() {
- a.apply(this, arguments)
- }
- __extends(b, a);
- b.prototype._apply = function(a) {
- this._setupContainer()
- };
- return b
- } (d);
- c.EqualToFrame = b;
- b.prototype.__class__ = "egret.EqualToFrame";
- e = function() {
- function a() {}
- var b = a.prototype;
- b.init = function(a) {};
- b._apply = function(a, f, b) {};
- b.setEgretSize = function(a, f, b, d, v, e) {
- void 0 === e && (e = 0);
- c.StageDelegate.getInstance()._stageWidth = Math.round(a);
- c.StageDelegate.getInstance()._stageHeight = Math.round(f);
- a = document.getElementById(g.canvas_div_name);
- f = document.getElementById(g.egret_root_div);
- a || (a = c.Browser.getInstance().$new("div"), a.id = g.canvas_div_name, f.appendChild(a));
- a.style.width = b + "px";
- a.style.height = d + "px";
- f.style.width = b + "px";
- f.style.height = d + "px";
- f.style.top = e + "px"
- };
- b._getClientWidth = function() {
- return document.documentElement.clientWidth
- };
- b._getClientHeight = function() {
- return document.documentElement.clientHeight
- };
- return a
- } ();
- c.ContentStrategy = e;
- e.prototype.__class__ = "egret.ContentStrategy";
- var a = function(a) {
- function b(c) {
- void 0 === c && (c = 0);
- a.call(this);
- this.minWidth = NaN;
- this.minWidth = c
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- f = this._getClientWidth();
- var c = this._getClientHeight(),
- d = c / b,
- v = f / d,
- e = 1;
- 0 != this.minWidth && (e = Math.min(1, v / this.minWidth));
- this.setEgretSize(v / e, b, f, c * e);
- a._scaleX = d * e;
- a._scaleY = d * e
- };
- return b
- } (e);
- c.FixedHeight = a;
- a.prototype.__class__ = "egret.FixedHeight";
- a = function(a) {
- function b(c) {
- void 0 === c && (c = 0);
- a.call(this);
- this.minHeight = NaN;
- this.minHeight = c
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- b = this._getClientWidth();
- var c = this._getClientHeight(),
- d = b / f,
- v = c / d,
- e = 1;
- 0 != this.minHeight && (e = Math.min(1, v / this.minHeight));
- this.setEgretSize(f, v / e, b * e, c, b * (1 - e) / 2);
- a._scaleX = d * e;
- a._scaleY = d * e
- };
- return b
- } (e);
- c.FixedWidth = a;
- a.prototype.__class__ = "egret.FixedWidth";
- a = function(a) {
- function b(c, d) {
- a.call(this);
- this.width = c;
- this.height = d
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- b = this.width;
- var c = this.height,
- d = b / f;
- this.setEgretSize(f, c / d, b, c);
- a._scaleX = d;
- a._scaleY = d
- };
- return b
- } (e);
- c.FixedSize = a;
- a.prototype.__class__ = "egret.FixedSize";
- a = function(a) {
- function b() {
- a.call(this)
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- this.setEgretSize(f, b, f, b, Math.floor((f - f) / 2));
- a._scaleX = 1;
- a._scaleY = 1
- };
- return b
- } (e);
- c.NoScale = a;
- a.prototype.__class__ = "egret.NoScale";
- a = function(a) {
- function b() {
- a.call(this)
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- var c = this._getClientWidth(),
- d = this._getClientHeight(),
- v = c,
- e = d,
- g = v / f < e / b ? v / f: e / b,
- v = f * g,
- e = b * g,
- c = Math.floor((c - v) / 2);
- a._offSetY = Math.floor((d - e) / 2);
- this.setEgretSize(f, b / 1, 1 * v, e, c, a._offSetY);
- a._scaleX = 1 * g;
- a._scaleY = 1 * g
- };
- return b
- } (e);
- c.ShowAll = a;
- a.prototype.__class__ = "egret.ShowAll";
- e = function(a) {
- function b() {
- a.call(this)
- }
- __extends(b, a);
- b.prototype._apply = function(a, f, b) {
- var c = this._getClientWidth(),
- d = this._getClientHeight(),
- c = c / f,
- d = d / b;
- this.setEgretSize(f, b, f * c, b * d);
- a._scaleX = c;
- a._scaleY = d
- };
- return b
- } (e);
- c.FullScreen = e;
- e.prototype.__class__ = "egret.FullScreen"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._originalData = {};
- this._drawAreaList = []
- }
- __extends(d, e);
- var b = d.prototype;
- d.getInstance = function() {
- null == d.instance && (d.instance = new d);
- return d.instance
- };
- b.addDrawArea = function(a) {
- this._drawAreaList.push(a)
- };
- b.clearDrawArea = function() {
- this._drawAreaList = []
- };
- b.drawImage = function(a, f, b, t, e, g, h, k, l, m, p) {
- void 0 === p && (p = void 0);
- h = h || 0;
- k = k || 0;
- var r = f._texture_to_render;
- if (null != r && 0 != g && 0 != e && 0 != l && 0 != m) {
- var q = c.MainContext.instance.rendererContext._texture_scale_factor;
- e /= q;
- g /= q;
- if (0 != this._drawAreaList.length && c.MainContext.instance.rendererContext._cacheCanvasContext) {
- q = c.DisplayObject.getTransformBounds(f._getSize(d.identityRectangle), f._worldTransform);
- f._worldBounds.initialize(q.x, q.y, q.width, q.height);
- q = this._originalData;
- q.sourceX = b;
- q.sourceY = t;
- q.sourceWidth = e;
- q.sourceHeight = g;
- q.destX = h;
- q.destY = k;
- q.destWidth = l;
- q.destHeight = m;
- for (var x = this.getDrawAreaList(), z = 0; z < x.length; z++) if (!this.ignoreRender(f, x[z], q.destX, q.destY)) {
- a.drawImage(r, b, t, e, g, h, k, l, m, p);
- break
- }
- } else a.drawImage(r, b, t, e, g, h, k, l, m, p)
- }
- };
- b.ignoreRender = function(a, f, b, c) {
- var d = a._worldBounds;
- b *= a._worldTransform.a;
- c *= a._worldTransform.d;
- return d.x + d.width + b <= f.x || d.x + b >= f.x + f.width || d.y + d.height + c <= f.y || d.y + c >= f.y + f.height ? !0 : !1
- };
- b.getDrawAreaList = function() {
- var a;
- 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;
- return a
- };
- b.onResize = function() {
- c.MainContext.instance.stage.removeEventListener(c.Event.RESIZE, this.onResize, this);
- this._defaultDrawAreaList = null
- };
- d.identityRectangle = new c.Rectangle;
- return d
- } (c.HashObject);
- c.RenderFilter = g;
- g.prototype.__class__ = "egret.RenderFilter"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {}
- e.mapClass = function(c, b, a) {
- void 0 === a && (a = "");
- c = this.getKey(c) + "#" + a;
- this.mapClassDic[c] = b
- };
- e.getKey = function(d) {
- return "string" == typeof d ? d: c.getQualifiedClassName(d)
- };
- e.mapValue = function(c, b, a) {
- void 0 === a && (a = "");
- c = this.getKey(c) + "#" + a;
- this.mapValueDic[c] = b
- };
- e.hasMapRule = function(c, b) {
- void 0 === b && (b = "");
- var a = this.getKey(c) + "#" + b;
- return this.mapValueDic[a] || this.mapClassDic[a] ? !0 : !1
- };
- e.getInstance = function(d, b) {
- void 0 === b && (b = "");
- var a = this.getKey(d) + "#" + b;
- if (this.mapValueDic[a]) return this.mapValueDic[a];
- var f = this.mapClassDic[a];
- if (f) return f = new f,
- this.mapValueDic[a] = f,
- delete this.mapClassDic[a],
- f;
- throw Error(c.getString(1028, a));
- };
- e.mapClassDic = {};
- e.mapValueDic = {};
- return e
- } ();
- c.Injector = g;
- g.prototype.__class__ = "egret.Injector"
- })(egret || (egret = {})); (function(c) {
- c = c.BitmapFilterQuality || (c.BitmapFilterQuality = {});
- c.LOW = 1;
- c.MEDIUM = 2;
- c.HIGH = 3
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.apply(this, arguments);
- this.type = null
- }
- __extends(d, c);
- return d
- } (c.HashObject);
- c.Filter = g;
- g.prototype.__class__ = "egret.Filter"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a) {
- c.call(this);
- this.blurX = b;
- this.blurY = a;
- this.type = "blur"
- }
- __extends(d, c);
- return d
- } (c.Filter);
- c.BlurFilter = g;
- g.prototype.__class__ = "egret.BlurFilter"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a) {
- void 0 === a && (a = null);
- c.call(this);
- this._matrix = [];
- this._matrix2 = [];
- this.type = "colorTransform";
- this._setMatrix(a)
- }
- __extends(d, c);
- var b = d.prototype;
- Object.defineProperty(b, "matrix", {
- get: function() {
- for (var a = 0; 20 > a; a++) this._matrix2[a] = this._matrix[a];
- return this._matrix2
- },
- set: function(a) {
- this._setMatrix(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMatrix = function(a) {
- for (var f = 0; 20 > f; f++) this._matrix[f] = a && a[f] || 0
- };
- return d
- } (c.Filter);
- c.ColorMatrixFilter = g;
- g.prototype.__class__ = "egret.ColorMatrixFilter"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a, f, d, t, s, g, h) {
- void 0 === b && (b = 16711680);
- void 0 === a && (a = 1);
- void 0 === f && (f = 6);
- void 0 === d && (d = 6);
- void 0 === t && (t = 2);
- void 0 === s && (s = 1);
- void 0 === g && (g = !1);
- void 0 === h && (h = !1);
- c.call(this);
- this.color = b;
- this.alpha = a;
- this.blurX = f;
- this.blurY = d;
- this.strength = t;
- this.quality = s;
- this.inner = g;
- this.knockout = h;
- this.type = "glow";
- this._blue = b & 255;
- this._green = (b & 65280) >> 8;
- this._red = b >> 16
- }
- __extends(d, c);
- return d
- } (c.Filter);
- c.GlowFilter = g;
- g.prototype.__class__ = "egret.GlowFilter"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b, a, f, d, t, s, g, h, k, l, m) {
- void 0 === b && (b = 4);
- void 0 === a && (a = 45);
- void 0 === f && (f = 0);
- void 0 === d && (d = 1);
- void 0 === t && (t = 4);
- void 0 === s && (s = 4);
- void 0 === g && (g = 1);
- void 0 === h && (h = 1);
- void 0 === k && (k = !1);
- void 0 === l && (l = !1);
- c.call(this, f, d, t, s, g, h, k, l);
- this.distance = b;
- this.angle = a
- }
- __extends(d, c);
- return d
- } (c.GlowFilter);
- c.DropShadowFilter = g;
- g.prototype.__class__ = "egret.DropShadowFilter"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.NORMAL = "normal";
- c.ADD = "add";
- c.ERASE = "erase";
- c.ERASE_REVERSE = "eraseReverse";
- return c
- } ();
- c.BlendMode = g;
- g.prototype.__class__ = "egret.BlendMode"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {
- this._name = null;
- this._explicitHeight = this._explicitWidth = NaN;
- this._y = this._x = 0;
- this._scaleY = this._scaleX = 1;
- this._rotation = this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
- this._alpha = 1;
- this._skewY = this._skewX = 0;
- this._blendMode = null;
- this._touchEnabled = c.defaultTouchEnabled;
- this._visible = !0;
- this._worldAlpha = 1;
- this._scrollRect = null;
- this._cacheAsBitmap = !1;
- this._stage = this._parent = null;
- this._needDraw = !1;
- this._filters = null;
- this._hasHeightSet = this._hasWidthSet = !1;
- this._sizeDirty = this._normalDirty = !0;
- this._isContainer = !1
- }
- c.defaultTouchEnabled = !1;
- return c
- } ();
- c.DisplayObjectProperties = g;
- g.prototype.__class__ = "egret.DisplayObjectProperties"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- return function() {
- this._hitTestPointTexture = null;
- this._rectH = this._rectW = 0;
- this._cacheDirty = !1
- }
- } ();
- c.DisplayObjectPrivateProperties = g;
- g.prototype.__class__ = "egret.DisplayObjectPrivateProperties"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.renderTexture = this.mask = this._sizeChangeCallTarget = this._sizeChangeCallBack = this.__hack_local_matrix = this._worldBounds = this._texture_to_render = null;
- this._DO_Props_ = new c.DisplayObjectProperties;
- this._DO_Privs_ = new c.DisplayObjectPrivateProperties;
- this._worldTransform = new c.Matrix;
- this._worldBounds = new c.Rectangle(0, 0, 0, 0);
- this._DO_Privs_._cacheBounds = new c.Rectangle(0, 0, 0, 0)
- }
- __extends(d, e);
- var b = d.prototype;
- b._setDirty = function() {
- this._DO_Props_._normalDirty = !0
- };
- b.getDirty = function() {
- return this._DO_Props_._normalDirty || this._DO_Props_._sizeDirty
- };
- b._setParentSizeDirty = function() {
- var a = this._DO_Props_._parent;
- a && (a._DO_Props_._hasWidthSet || a._DO_Props_._hasHeightSet ? a._setCacheDirty() : a._setSizeDirty())
- };
- b._setSizeDirty = function() {
- var a = this._DO_Props_;
- a._sizeDirty || (a._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == a._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
- };
- b._clearDirty = function() {
- this._DO_Props_._normalDirty = !1
- };
- b._clearSizeDirty = function() {
- this._DO_Props_._sizeDirty = !1
- };
- Object.defineProperty(b, "name", {
- get: function() {
- return this._DO_Props_._name
- },
- set: function(a) {
- this._DO_Props_._name = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "parent", {
- get: function() {
- return this._DO_Props_._parent
- },
- enumerable: !0,
- configurable: !0
- });
- b._parentChanged = function(a) {
- this._DO_Props_._parent = a
- };
- Object.defineProperty(b, "x", {
- get: function() {
- return this._DO_Props_._x
- },
- set: function(a) {
- this._setX(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setX = function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._x != a && (this._DO_Props_._x = a, this._setDirty(), this._setParentSizeDirty())
- };
- Object.defineProperty(b, "y", {
- get: function() {
- return this._DO_Props_._y
- },
- set: function(a) {
- this._setY(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setY = function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._y != a && (this._DO_Props_._y = a, this._setDirty(), this._setParentSizeDirty())
- };
- Object.defineProperty(b, "scaleX", {
- get: function() {
- return this._DO_Props_._scaleX
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._scaleX != a && (this._DO_Props_._scaleX = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "scaleY", {
- get: function() {
- return this._DO_Props_._scaleY
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._scaleY != a && (this._DO_Props_._scaleY = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "anchorOffsetX", {
- get: function() {
- return this._DO_Props_._anchorOffsetX
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._anchorOffsetX != a && (this._DO_Props_._anchorOffsetX = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "anchorOffsetY", {
- get: function() {
- return this._DO_Props_._anchorOffsetY
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._anchorOffsetY != a && (this._DO_Props_._anchorOffsetY = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "anchorX", {
- get: function() {
- return this._DO_Props_._anchorX
- },
- set: function(a) {
- this._setAnchorX(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setAnchorX = function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._anchorX != a && (this._DO_Props_._anchorX = a, this._setDirty(), this._setParentSizeDirty())
- };
- Object.defineProperty(b, "anchorY", {
- get: function() {
- return this._DO_Props_._anchorY
- },
- set: function(a) {
- this._setAnchorY(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setAnchorY = function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._anchorY != a && (this._DO_Props_._anchorY = a, this._setDirty(), this._setParentSizeDirty())
- };
- Object.defineProperty(b, "visible", {
- get: function() {
- return this._DO_Props_._visible
- },
- set: function(a) {
- this._setVisible(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setVisible = function(a) {
- this._DO_Props_._visible != a && (this._DO_Props_._visible = a, this._setSizeDirty())
- };
- Object.defineProperty(b, "rotation", {
- get: function() {
- return this._DO_Props_._rotation
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._rotation != a && (this._DO_Props_._rotation = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "alpha", {
- get: function() {
- return this._DO_Props_._alpha
- },
- set: function(a) {
- this._setAlpha(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setAlpha = function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._alpha != a && (this._DO_Props_._alpha = a, this._setDirty(), this._setCacheDirty())
- };
- Object.defineProperty(b, "skewX", {
- get: function() {
- return this._DO_Props_._skewX
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._skewX != a && (this._DO_Props_._skewX = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "skewY", {
- get: function() {
- return this._DO_Props_._skewY
- },
- set: function(a) {
- c.NumberUtils.isNumber(a) && this._DO_Props_._skewY != a && (this._DO_Props_._skewY = a, this._setDirty(), this._setParentSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "touchEnabled", {
- get: function() {
- return this._DO_Props_._touchEnabled
- },
- set: function(a) {
- this._setTouchEnabled(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setTouchEnabled = function(a) {
- this._DO_Props_._touchEnabled = a
- };
- Object.defineProperty(b, "blendMode", {
- get: function() {
- return this._DO_Props_._blendMode
- },
- set: function(a) {
- this._DO_Props_._blendMode = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "scrollRect", {
- get: function() {
- return this._DO_Props_._scrollRect
- },
- set: function(a) {
- this._setScrollRect(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setScrollRect = function(a) {
- this._DO_Props_._scrollRect = a;
- this._setSizeDirty()
- };
- Object.defineProperty(b, "measuredWidth", {
- get: function() {
- return this._measureBounds().width
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "measuredHeight", {
- get: function() {
- return this._measureBounds().height
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "explicitWidth", {
- get: function() {
- return this._DO_Props_._explicitWidth
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "explicitHeight", {
- get: function() {
- return this._DO_Props_._explicitHeight
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "width", {
- get: function() {
- return this._getWidth()
- },
- set: function(a) {
- this._setWidth(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._getWidth = function() {
- return this._getSize(c.Rectangle.identity).width
- };
- Object.defineProperty(b, "height", {
- get: function() {
- return this._getHeight()
- },
- set: function(a) {
- this._setHeight(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._getHeight = function() {
- return this._getSize(c.Rectangle.identity).height
- };
- b._setWidth = function(a) {
- this._setSizeDirty();
- this._setCacheDirty();
- this._DO_Props_._explicitWidth = a;
- this._DO_Props_._hasWidthSet = c.NumberUtils.isNumber(a)
- };
- b._setHeight = function(a) {
- this._setSizeDirty();
- this._setCacheDirty();
- this._DO_Props_._explicitHeight = a;
- this._DO_Props_._hasHeightSet = c.NumberUtils.isNumber(a)
- };
- Object.defineProperty(b, "worldAlpha", {
- get: function() {
- return this._DO_Props_._worldAlpha
- },
- set: function(a) {
- this._DO_Props_._worldAlpha = a
- },
- enumerable: !0,
- configurable: !0
- });
- b._draw = function(a) {
- if (this._DO_Props_._visible && !this.drawCacheTexture(a)) {
- var f = c.MainContext.__use_new_draw && this._DO_Props_._isContainer;
- this._hasFilters() && !f && this._setGlobalFilters(a);
- a.setAlpha(this.worldAlpha, this.blendMode);
- a.setTransform(this._worldTransform);
- var b = this.mask || this._DO_Props_._scrollRect;
- b && !f && a.pushMask(b);
- this._render(a);
- b && !f && a.popMask();
- this._hasFilters() && !f && this._removeGlobalFilters(a)
- }
- this.destroyCacheBounds()
- };
- b._setGlobalFilters = function(a) {
- var f;
- f = this._DO_Props_._filters ? this._DO_Props_._filters.concat() : [];
- if (this._transform) {
- var b = this._transform._colorTransform,
- c = d.color;
- c[0] = b._redMultiplier;
- c[4] = b._redOffset;
- c[6] = b._greenMultiplier;
- c[9] = b._greenOffset;
- c[12] = b._blueMultiplier;
- c[14] = b._blueOffset;
- c[18] = b._alphaMultiplier;
- c[19] = b._alphaOffset;
- d.colorMatrixFilter._matrix = c;
- f.push(d.colorMatrixFilter)
- }
- a.setGlobalFilters(f)
- };
- b._removeGlobalFilters = function(a) {
- a.setGlobalFilters(null)
- };
- b._hasFilters = function() {
- var a = this._DO_Props_._filters && 0 < this._DO_Props_._filters.length;
- if (this._transform) {
- var f = this._transform._colorTransform;
- if (1 != f._redMultiplier || 0 != f._redOffset || 1 != f._greenMultiplier || 0 != f._greenOffset || 1 != f._blueMultiplier || 0 != f._blueOffset || 1 != f._alphaMultiplier || 0 != f._alphaOffset) a = !0
- }
- return a
- };
- b._pushMask = function(a) {
- a.setTransform(this._worldTransform);
- var f = this.mask || this._DO_Props_._scrollRect;
- f && a.pushMask(f)
- };
- b._popMask = function(a) {
- a.popMask()
- };
- b.drawCacheTexture = function(a) {
- if (!1 == this._DO_Props_._cacheAsBitmap) return ! 1;
- var f = this.getBounds(c.Rectangle.identity);
- if (this._DO_Privs_._cacheDirty || null == this._texture_to_render || 1 <= Math.round(f.width) - this._texture_to_render._textureWidth || 1 <= Math.round(f.height) - this._texture_to_render._textureHeight) f = this._makeBitmapCache(),
- this._DO_Privs_._cacheDirty = !f;
- if (null == this._texture_to_render) return ! 1;
- var b = this._texture_to_render,
- f = b._offsetX,
- d = b._offsetY,
- e = b._textureWidth,
- b = b._textureHeight;
- this._updateTransform();
- a.setAlpha(this.worldAlpha, this.blendMode);
- a.setTransform(this._worldTransform);
- c.RenderFilter.getInstance().drawImage(a, this, 0, 0, e, b, f, d, e, b);
- return ! 0
- };
- Object.defineProperty(b, "needDraw", {
- get: function() {
- return this._DO_Props_._needDraw
- },
- set: function(a) {
- this._DO_Props_._needDraw = a
- },
- enumerable: !0,
- configurable: !0
- });
- b._updateTransform = function() {
- var a = this._DO_Props_;
- a._visible && (this._calculateWorldTransform(), "updateTransform" == c.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || a._cacheAsBitmap) && c.RenderCommand.push(this._draw, this))
- };
- b._calculateWorldTransform = function() {
- var a = this._DO_Props_,
- f = this._worldTransform,
- b = a._parent;
- f.identityMatrix(b._worldTransform);
- this._getMatrix(f);
- var c = a._scrollRect;
- c && f.append(1, 0, 0, 1, -c.x, -c.y);
- this.worldAlpha = b.worldAlpha * a._alpha
- };
- b._render = function(a) {};
- b.getBounds = function(a, f) {
- void 0 === f && (f = !0);
- var b = this._DO_Props_,
- d = this._DO_Privs_,
- e = this._measureBounds(),
- g = b._hasWidthSet ? b._explicitWidth: e.width,
- h = b._hasHeightSet ? b._explicitHeight: e.height;
- d._rectW = e.width;
- d._rectH = e.height;
- this._clearSizeDirty();
- var k = e.x,
- e = e.y,
- l = 0,
- m = 0;
- f && (0 != b._anchorX || 0 != b._anchorY ? (l = g * b._anchorX, m = h * b._anchorY) : (l = b._anchorOffsetX, m = b._anchorOffsetY));
- d._cacheBounds.initialize(k - l, e - m, g, h);
- b = d._cacheBounds;
- a || (a = new c.Rectangle);
- return a.initialize(b.x, b.y, b.width, b.height)
- };
- b.destroyCacheBounds = function() {
- var a = this._DO_Privs_;
- a._cacheBounds.x = 0;
- a._cacheBounds.y = 0;
- a._cacheBounds.width = 0;
- a._cacheBounds.height = 0
- };
- b._getConcatenatedMatrix = function() {
- for (var a = d.identityMatrixForGetConcatenated.identity(), f = this; null != f;) {
- var b = f._DO_Props_;
- 0 != b._anchorX || 0 != b._anchorY ? (f = f._getSize(c.Rectangle.identity), a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, f.width * b._anchorX, f.height * b._anchorY)) : a.prependTransform(b._x, b._y, b._scaleX, b._scaleY, b._rotation, b._skewX, b._skewY, b._anchorOffsetX, b._anchorOffsetY);
- b._scrollRect && a.prepend(1, 0, 0, 1, -b._scrollRect.x, -b._scrollRect.y);
- f = b._parent
- }
- return a
- };
- b.localToGlobal = function(a, f, b) {
- void 0 === a && (a = 0);
- void 0 === f && (f = 0);
- var d = this._getConcatenatedMatrix();
- d.append(1, 0, 0, 1, a, f);
- b || (b = new c.Point);
- b.x = d.tx;
- b.y = d.ty;
- return b
- };
- b.globalToLocal = function(a, f, b) {
- void 0 === a && (a = 0);
- void 0 === f && (f = 0);
- var d = this._getConcatenatedMatrix();
- d.invert();
- d.append(1, 0, 0, 1, a, f);
- b || (b = new c.Point);
- b.x = d.tx;
- b.y = d.ty;
- return b
- };
- b.hitTest = function(a, f, b) {
- void 0 === b && (b = !1);
- var d = this._DO_Props_;
- if (!d._visible || !b && !d._touchEnabled) return null;
- b = this.getBounds(c.Rectangle.identity, !1);
- a -= b.x;
- f -= b.y;
- return 0 <= a && a < b.width && 0 <= f && f < b.height ? this.mask || d._scrollRect ? d._scrollRect && a > d._scrollRect.x && f > d._scrollRect.y && a < d._scrollRect.x + d._scrollRect.width && f < d._scrollRect.y + d._scrollRect.height || this.mask && this.mask.x <= a && a < this.mask.x + this.mask.width && this.mask.y <= f && f < this.mask.y + this.mask.height ? this: null: this: null
- };
- b.hitTestPoint = function(a, f, b) {
- var d = this._DO_Privs_;
- a = this.globalToLocal(a, f);
- return b ? (d._hitTestPointTexture || (d._hitTestPointTexture = new c.RenderTexture), b = d._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(a.x - d._hitTestPointTexture._offsetX, a.y - d._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(a.x, a.y, !0)
- };
- b._getMatrix = function(a) {
- a || (a = c.Matrix.identity.identity());
- var f = this._DO_Props_,
- b, d;
- d = this._getOffsetPoint();
- b = d.x;
- d = d.y;
- var e = this.__hack_local_matrix;
- e ? (a.append(e.a, e.b, e.c, e.d, e.tx, e.ty), a.append(1, 0, 0, 1, -b, -d)) : a.appendTransform(f._x, f._y, f._scaleX, f._scaleY, f._rotation, f._skewX, f._skewY, b, d);
- return a
- };
- b._getSize = function(a) {
- var f = this._DO_Props_;
- if (f._hasHeightSet && f._hasWidthSet) return this._clearSizeDirty(),
- a.initialize(0, 0, f._explicitWidth, f._explicitHeight);
- this._measureSize(a);
- f._hasWidthSet && (a.width = f._explicitWidth);
- f._hasHeightSet && (a.height = f._explicitHeight);
- return a
- };
- b._measureSize = function(a) {
- var f = this._DO_Privs_;
- this._DO_Props_._sizeDirty ? (a = this._measureBounds(), f._rectW = a.width, f._rectH = a.height, this._clearSizeDirty()) : (a.width = f._rectW, a.height = f._rectH);
- a.x = 0;
- a.y = 0;
- return a
- };
- b._measureBounds = function() {
- return c.Rectangle.identity.initialize(0, 0, 0, 0)
- };
- b._getOffsetPoint = function() {
- var a = this._DO_Props_,
- f = a._anchorOffsetX,
- b = a._anchorOffsetY;
- if (0 != a._anchorX || 0 != a._anchorY) b = this._getSize(c.Rectangle.identity),
- f = a._anchorX * b.width,
- b = a._anchorY * b.height;
- a = c.Point.identity;
- a.x = f;
- a.y = b;
- return a
- };
- b._onAddToStage = function() {
- this._DO_Props_._stage = c.MainContext.instance.stage;
- c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
- };
- b._onRemoveFromStage = function() {
- c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
- };
- Object.defineProperty(b, "stage", {
- get: function() {
- return this._DO_Props_._stage
- },
- enumerable: !0,
- configurable: !0
- });
- b.addEventListener = function(a, f, b, t, s) {
- void 0 === t && (t = !1);
- void 0 === s && (s = 0);
- e.prototype.addEventListener.call(this, a, f, b, t, s); ((t = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._insertEventBin(t ? d._enterFrameCallBackList: d._renderCallBackList, f, b, s, this)
- };
- b.removeEventListener = function(a, f, b, t) {
- void 0 === t && (t = !1);
- e.prototype.removeEventListener.call(this, a, f, b, t); ((t = a == c.Event.ENTER_FRAME) || a == c.Event.RENDER) && this._removeEventBin(t ? d._enterFrameCallBackList: d._renderCallBackList, f, b, this)
- };
- b.dispatchEvent = function(a) {
- if (!a._bubbles) return e.prototype.dispatchEvent.call(this, a);
- for (var f = [], b = this; b;) f.push(b),
- b = b._DO_Props_._parent;
- a._reset();
- this._dispatchPropagationEvent(a, f);
- return ! a._isDefaultPrevented
- };
- b._dispatchPropagationEvent = function(a, f, b) {
- b = f.length;
- for (var c = 1,
- d = b - 1; 0 <= d; d--) {
- var e = f[d];
- a._currentTarget = e;
- a._target = this;
- a._eventPhase = c;
- e._notifyListener(a);
- if (a._isPropagationStopped || a._isPropagationImmediateStopped) return
- }
- e = f[0];
- a._currentTarget = e;
- a._target = this;
- a._eventPhase = 2;
- e._notifyListener(a);
- if (!a._isPropagationStopped && !a._isPropagationImmediateStopped) for (c = 3, d = 1; d < b && (e = f[d], a._currentTarget = e, a._target = this, a._eventPhase = c, e._notifyListener(a), !a._isPropagationStopped && !a._isPropagationImmediateStopped); d++);
- };
- b.willTrigger = function(a) {
- for (var f = this; f;) {
- if (f.hasEventListener(a)) return ! 0;
- f = f._DO_Props_._parent
- }
- return ! 1
- };
- Object.defineProperty(b, "cacheAsBitmap", {
- get: function() {
- return this._DO_Props_._cacheAsBitmap
- },
- set: function(a) { (this._DO_Props_._cacheAsBitmap = a) ? c.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
- },
- enumerable: !0,
- configurable: !0
- });
- b._makeBitmapCache = function() {
- this.renderTexture || (this.renderTexture = new c.RenderTexture);
- var a = this.renderTexture.drawToTexture(this);
- this._texture_to_render = a ? this.renderTexture: null;
- return a
- };
- b._setCacheDirty = function(a) {
- void 0 === a && (a = !0);
- this._DO_Privs_._cacheDirty = a
- };
- d.getTransformBounds = function(a, f) {
- var b = a.x,
- c = a.y,
- d = a.width,
- e = a.height; (b || c) && f.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
- var g = d * f.a,
- d = d * f.b,
- k = e * f.c,
- e = e * f.d,
- l = f.tx,
- m = f.ty,
- p = l,
- r = l,
- q = m,
- x = m; (b = g + l) < p ? p = b: b > r && (r = b); (b = g + k + l) < p ? p = b: b > r && (r = b); (b = k + l) < p ? p = b: b > r && (r = b); (c = d + m) < q ? q = c: c > x && (x = c); (c = d + e + m) < q ? q = c: c > x && (x = c); (c = e + m) < q ? q = c: c > x && (x = c);
- return a.initialize(p, q, r - p, x - q)
- };
- Object.defineProperty(b, "filters", {
- get: function() {
- return this._DO_Props_._filters
- },
- set: function(a) {
- this._DO_Props_._filters = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "transform", {
- get: function() {
- this._transform || (this._transform = new c.Transform(this));
- return this._transform
- },
- enumerable: !0,
- configurable: !0
- });
- d.color = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
- d.colorMatrixFilter = new c.ColorMatrixFilter;
- d.identityMatrixForGetConcatenated = new c.Matrix;
- d._enterFrameCallBackList = [];
- d._renderCallBackList = [];
- return d
- } (c.EventDispatcher);
- c.DisplayObject = g;
- g.prototype.__class__ = "egret.DisplayObject"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._touchChildren = !0;
- this._children = [];
- this._DO_Props_._isContainer = !0
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "touchChildren", {
- get: function() {
- return this._touchChildren
- },
- set: function(a) {
- this._touchChildren = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "numChildren", {
- get: function() {
- return this._children.length
- },
- enumerable: !0,
- configurable: !0
- });
- b.setChildIndex = function(a, f) {
- this.doSetChildIndex(a, f)
- };
- b.doSetChildIndex = function(a, f) {
- var b = this._children.indexOf(a);
- 0 > b && c.Logger.fatalWithErrorId(1006);
- this._children.splice(b, 1);
- 0 > f || this._children.length <= f ? this._children.push(a) : this._children.splice(f, 0, a)
- };
- b.addChild = function(a) {
- var f = this._children.length;
- a.parent == this && f--;
- return this._doAddChild(a, f)
- };
- b.addChildAt = function(a, f) {
- return this._doAddChild(a, f)
- };
- b._doAddChild = function(a, f, b) {
- void 0 === b && (b = !0);
- if (a == this) return a;
- if (0 > f || f > this._children.length) return c.Logger.fatalWithErrorId(1007),
- a;
- var e = a.parent;
- if (e == this) return this.doSetChildIndex(a, f),
- a;
- if (e) {
- var g = e._children.indexOf(a);
- 0 <= g && e._doRemoveChild(g)
- }
- this._children.splice(f, 0, a);
- a._parentChanged(this);
- b && a.dispatchEventWith(c.Event.ADDED, !0);
- if (this._DO_Props_._stage) for (a._onAddToStage(), f = d.__EVENT__ADD_TO_STAGE_LIST; 0 < f.length;) e = f.shift(),
- b && e.dispatchEventWith(c.Event.ADDED_TO_STAGE);
- a._setDirty();
- this._setSizeDirty();
- return a
- };
- b.removeChild = function(a) {
- a = this._children.indexOf(a);
- if (0 <= a) return this._doRemoveChild(a);
- c.Logger.fatalWithErrorId(1008);
- return null
- };
- b.removeChildAt = function(a) {
- if (0 <= a && a < this._children.length) return this._doRemoveChild(a);
- c.Logger.fatalWithErrorId(1007);
- return null
- };
- b._doRemoveChild = function(a, f) {
- void 0 === f && (f = !0);
- var b = this._children,
- e = b[a];
- f && e.dispatchEventWith(c.Event.REMOVED, !0);
- if (this._DO_Props_._stage) {
- e._onRemoveFromStage();
- for (var g = d.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
- var n = g.shift();
- f && n.dispatchEventWith(c.Event.REMOVED_FROM_STAGE);
- n._DO_Props_._stage = null
- }
- }
- e._parentChanged(null);
- b.splice(a, 1);
- this._setSizeDirty();
- return e
- };
- b.getChildAt = function(a) {
- if (0 <= a && a < this._children.length) return this._children[a];
- c.Logger.fatalWithErrorId(1007);
- return null
- };
- b.contains = function(a) {
- for (; a;) {
- if (a == this) return ! 0;
- a = a.parent
- }
- return ! 1
- };
- b.swapChildrenAt = function(a, f) {
- 0 <= a && a < this._children.length && 0 <= f && f < this._children.length ? this._swapChildrenAt(a, f) : c.Logger.fatalWithErrorId(1007)
- };
- b.swapChildren = function(a, f) {
- var b = this._children.indexOf(a),
- d = this._children.indexOf(f); - 1 == b || -1 == d ? c.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(b, d)
- };
- b._swapChildrenAt = function(a, f) {
- if (a != f) {
- var b = this._children,
- c = b[a];
- b[a] = b[f];
- b[f] = c
- }
- };
- b.getChildIndex = function(a) {
- return this._children.indexOf(a)
- };
- b.removeChildren = function() {
- for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
- };
- b._updateTransform = function() {
- if (this._DO_Props_._visible) {
- this._hasFilters() && c.RenderCommand.push(this._setGlobalFilters, this);
- var a = this.mask || this._DO_Props_._scrollRect;
- a && c.RenderCommand.push(this._pushMask, this);
- e.prototype._updateTransform.call(this);
- if (!this._DO_Props_._cacheAsBitmap || !this._texture_to_render) for (var f = 0,
- b = this._children,
- d = b.length; f < d; f++) b[f]._updateTransform();
- a && c.RenderCommand.push(this._popMask, this);
- this._hasFilters() && c.RenderCommand.push(this._removeGlobalFilters, this)
- }
- };
- b._render = function(a) {
- if (!c.MainContext.__use_new_draw) for (var f = 0,
- b = this._children,
- d = b.length; f < d; f++) b[f]._draw(a)
- };
- b._measureBounds = function() {
- for (var a = 0,
- f = 0,
- b = 0,
- d = 0,
- e = this._children,
- g = e.length,
- h = 0; h < g; h++) {
- var k = e[h];
- if (k.visible) {
- var l = k.getBounds(c.Rectangle.identity, !1),
- m = l.x,
- p = l.y,
- r = l.width,
- l = l.height,
- k = k._getMatrix(),
- k = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(m, p, r, l), k),
- m = k.x,
- p = k.y,
- r = k.width + k.x,
- k = k.height + k.y;
- if (m < a || 0 == h) a = m;
- if (r > f || 0 == h) f = r;
- if (p < b || 0 == h) b = p;
- if (k > d || 0 == h) d = k
- }
- }
- return c.Rectangle.identity.initialize(a, b, f - a, d - b)
- };
- b.hitTest = function(a, f, b) {
- void 0 === b && (b = !1);
- var d;
- if (!this._DO_Props_._visible) return null;
- if (this._DO_Props_._scrollRect) {
- if (a < this._DO_Props_._scrollRect.x || f < this._DO_Props_._scrollRect.y || a > this._DO_Props_._scrollRect.x + this._DO_Props_._scrollRect.width || f > this._DO_Props_._scrollRect.y + this._DO_Props_._scrollRect.height) return null
- } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > f || f > this.mask.y + this.mask.height)) return null;
- for (var g = this._children,
- n = this._touchChildren,
- h = g.length - 1; 0 <= h; h--) {
- var k = g[h],
- l = k._getMatrix(),
- m = k.scrollRect;
- m && l.append(1, 0, 0, 1, -m.x, -m.y);
- l.invert();
- l = c.Matrix.transformCoords(l, a, f);
- if (k = k.hitTest(l.x, l.y, !0)) {
- if (!n) return this;
- if (k._DO_Props_._touchEnabled && n) return k;
- d = this
- }
- }
- return d ? d: this._texture_to_render ? e.prototype.hitTest.call(this, a, f, b) : null
- };
- b._onAddToStage = function() {
- e.prototype._onAddToStage.call(this);
- for (var a = this._children.length,
- f = 0; f < a; f++) this._children[f]._onAddToStage()
- };
- b._onRemoveFromStage = function() {
- e.prototype._onRemoveFromStage.call(this);
- for (var a = this._children,
- f = a.length,
- b = 0; b < f; b++) a[b]._onRemoveFromStage()
- };
- b.getChildByName = function(a) {
- for (var f = this._children,
- b = f.length,
- c, d = 0; d < b; d++) if (c = f[d], c.name == a) return c;
- return null
- };
- d.__EVENT__ADD_TO_STAGE_LIST = [];
- d.__EVENT__REMOVE_FROM_STAGE_LIST = [];
- return d
- } (c.DisplayObject);
- c.DisplayObjectContainer = g;
- g.prototype.__class__ = "egret.DisplayObjectContainer"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.NO_BORDER = "noBorder";
- c.NO_SCALE = "noScale";
- c.SHOW_ALL = "showAll";
- c.EXACT_FIT = "exactFit";
- return c
- } ();
- c.StageScaleMode = g;
- g.prototype.__class__ = "egret.StageScaleMode"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, f) {
- void 0 === a && (a = 480);
- void 0 === f && (f = 800);
- e.call(this);
- this._changeSizeDispatchFlag = !0;
- this._scaleMode = "";
- this._stageHeight = this._stageWidth = NaN;
- this.touchEnabled = !0;
- this._DO_Props_._stage = this;
- this._stageWidth = a;
- this._stageHeight = f
- }
- __extends(d, e);
- var b = d.prototype;
- b.invalidate = function() {
- d._invalidateRenderFlag = !0
- };
- Object.defineProperty(b, "scaleMode", {
- get: function() {
- return this._scaleMode
- },
- set: function(a) {
- this._scaleMode != a && (this._scaleMode = a, this.setResolutionPolicy())
- },
- enumerable: !0,
- configurable: !0
- });
- b.changeSize = function() {
- this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(c.Event.RESIZE))
- };
- b.setResolutionPolicy = function() {
- var a = d.SCALE_MODE_ENUM[this._scaleMode];
- if (!a) throw Error(c.getString(1024));
- var f = new c.EqualToFrame,
- a = new c.ResolutionPolicy(f, a);
- c.StageDelegate.getInstance()._setResolutionPolicy(a);
- this._stageWidth = c.StageDelegate.getInstance()._stageWidth;
- this._stageHeight = c.StageDelegate.getInstance()._stageHeight
- };
- Object.defineProperty(b, "stageWidth", {
- get: function() {
- return this._stageWidth
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "stageHeight", {
- get: function() {
- return this._stageHeight
- },
- enumerable: !0,
- configurable: !0
- });
- b.hitTest = function(a, f, b) {
- if (!this._DO_Props_._touchEnabled) return null;
- var d;
- if (!this._touchChildren) return this;
- b = this._children;
- for (var e = b.length - 1; 0 <= e; e--) {
- d = b[e];
- var g = d._getMatrix(),
- h = d.scrollRect;
- h && g.append(1, 0, 0, 1, -h.x, -h.y);
- g.invert();
- g = c.Matrix.transformCoords(g, a, f);
- if ((d = d.hitTest(g.x, g.y, !0)) && d.touchEnabled) return d
- }
- return this
- };
- b.getBounds = function(a) {
- a || (a = new c.Rectangle);
- return a.initialize(0, 0, this._stageWidth, this._stageHeight)
- };
- b._updateTransform = function() {
- for (var a = 0,
- f = this._children.length; a < f; a++) this._children[a]._updateTransform()
- };
- Object.defineProperty(b, "focus", {
- get: function() {
- return null
- },
- enumerable: !0,
- configurable: !0
- });
- d.registerScaleMode = function(a, f, b) {
- d.SCALE_MODE_ENUM[a] && !b ? c.Logger.warningWithErrorId(1009, a) : d.SCALE_MODE_ENUM[a] = f
- };
- d._invalidateRenderFlag = !1;
- d.SCALE_MODE_ENUM = {};
- return d
- } (c.DisplayObjectContainer);
- c.Stage = g;
- g.prototype.__class__ = "egret.Stage"
- })(egret || (egret = {}));
- egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
- egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
- egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
- egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen; (function(c) {
- var g = function() {
- return function() {
- this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
- this._scrollTop = this._scrollLeft = 0;
- this._vCanScroll = this._hCanScroll = !1;
- this._lastTouchPosition = new c.Point(0, 0);
- this._touchStartPosition = new c.Point(0, 0);
- this._scrollStarted = !1;
- this._lastTouchTime = 0;
- this._lastTouchEvent = null;
- this._velocitys = [];
- this._isVTweenPlaying = this._isHTweenPlaying = !1;
- this._vScrollTween = this._hScrollTween = null
- }
- } ();
- c.ScrollViewProperties = g;
- g.prototype.__class__ = "egret.ScrollViewProperties"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- void 0 === a && (a = null);
- e.call(this);
- this.scrollBeginThreshold = 10;
- this.scrollSpeed = 1;
- this.touchBeginTimer = this.delayTouchBeginEvent = this._content = null;
- this.touchEnabled = !0;
- this._ScrV_Props_ = new c.ScrollViewProperties;
- a && this.setContent(a)
- }
- __extends(d, e);
- var b = d.prototype;
- b.setContent = function(a) {
- this._content !== a && (this.removeContent(), a && (this._content = a, e.prototype.addChild.call(this, a), this._addEvents()))
- };
- b.removeContent = function() {
- this._content && (this._removeEvents(), e.prototype.removeChildAt.call(this, 0));
- this._content = null
- };
- Object.defineProperty(b, "verticalScrollPolicy", {
- get: function() {
- return this._ScrV_Props_._verticalScrollPolicy
- },
- set: function(a) {
- a != this._ScrV_Props_._verticalScrollPolicy && (this._ScrV_Props_._verticalScrollPolicy = a)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "horizontalScrollPolicy", {
- get: function() {
- return this._ScrV_Props_._horizontalScrollPolicy
- },
- set: function(a) {
- a != this._ScrV_Props_._horizontalScrollPolicy && (this._ScrV_Props_._horizontalScrollPolicy = a)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "scrollLeft", {
- get: function() {
- return this._ScrV_Props_._scrollLeft
- },
- set: function(a) {
- a != this._ScrV_Props_._scrollLeft && (this._ScrV_Props_._scrollLeft = a, this._validatePosition(!1, !0), this._updateContentPosition())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "scrollTop", {
- get: function() {
- return this._ScrV_Props_._scrollTop
- },
- set: function(a) {
- a != this._ScrV_Props_._scrollTop && (this._ScrV_Props_._scrollTop = a, this._validatePosition(!0, !1), this._updateContentPosition())
- },
- enumerable: !0,
- configurable: !0
- });
- b.setScrollPosition = function(a, f, b) {
- void 0 === b && (b = !1);
- if (!b || 0 != a || 0 != f) if (b || this._ScrV_Props_._scrollTop != a || this._ScrV_Props_._scrollLeft != f) {
- if (b) {
- b = this._isOnTheEdge(!0);
- var c = this._isOnTheEdge(!1);
- this._ScrV_Props_._scrollTop += b ? a / 2 : a;
- this._ScrV_Props_._scrollLeft += c ? f / 2 : f
- } else this._ScrV_Props_._scrollTop = a,
- this._ScrV_Props_._scrollLeft = f;
- this._validatePosition(!0, !0);
- this._updateContentPosition()
- }
- };
- b._isOnTheEdge = function(a) {
- void 0 === a && (a = !0);
- var f = this._ScrV_Props_._scrollTop,
- b = this._ScrV_Props_._scrollLeft;
- return a ? 0 > f || f > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
- };
- b._validatePosition = function(a, f) {
- void 0 === a && (a = !1);
- void 0 === f && (f = !1);
- if (a) {
- var b = this.height,
- c = this._getContentHeight();
- this._ScrV_Props_._scrollTop = Math.max(this._ScrV_Props_._scrollTop, (0 - b) / 2);
- this._ScrV_Props_._scrollTop = Math.min(this._ScrV_Props_._scrollTop, c > b ? c - b / 2 : b / 2)
- }
- f && (b = this.width, c = this._getContentWidth(), this._ScrV_Props_._scrollLeft = Math.max(this._ScrV_Props_._scrollLeft, (0 - b) / 2), this._ScrV_Props_._scrollLeft = Math.min(this._ScrV_Props_._scrollLeft, c > b ? c - b / 2 : b / 2))
- };
- b._setWidth = function(a) {
- this._DO_Props_._explicitWidth != a && (e.prototype._setWidth.call(this, a), this._updateContentPosition())
- };
- b._setHeight = function(a) {
- this._DO_Props_._explicitHeight != a && (e.prototype._setHeight.call(this, a), this._updateContentPosition())
- };
- b._updateContentPosition = function() {
- var a = this.getBounds(c.Rectangle.identity);
- this.scrollRect = new c.Rectangle(this._ScrV_Props_._scrollLeft, this._ScrV_Props_._scrollTop, a.width, a.height);
- this.dispatchEvent(new c.Event(c.Event.CHANGE))
- };
- b._checkScrollPolicy = function() {
- var a = this.__checkScrollPolicy(this._ScrV_Props_._horizontalScrollPolicy, this._getContentWidth(), this.width);
- this._ScrV_Props_._hCanScroll = a;
- var f = this.__checkScrollPolicy(this._ScrV_Props_._verticalScrollPolicy, this._getContentHeight(), this.height);
- this._ScrV_Props_._vCanScroll = f;
- return a || f
- };
- b.__checkScrollPolicy = function(a, f, b) {
- return "on" == a ? !0 : "off" == a ? !1 : f > b
- };
- b._addEvents = function() {
- this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
- this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
- this.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
- };
- b._removeEvents = function() {
- this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
- this.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
- this.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
- };
- b._onTouchBegin = function(a) { ! a._isDefaultPrevented && this._checkScrollPolicy() && (this._ScrV_Props_._touchStartPosition.x = a.stageX, this._ScrV_Props_._touchStartPosition.y = a.stageY, (this._ScrV_Props_._isHTweenPlaying || this._ScrV_Props_._isVTweenPlaying) && this._onScrollFinished(), this.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this), this.stage.addEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(a), a.preventDefault())
- };
- b._onTouchBeginCapture = function(a) {
- var f = this._checkScrollPolicy();
- if (f) {
- for (var b = a.target; b != this;) {
- if ("_checkScrollPolicy" in b && (f = b._checkScrollPolicy())) return;
- b = b.parent
- }
- a.stopPropagation();
- this.delayTouchBeginEvent = this.cloneTouchEvent(a);
- this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
- this.touchBeginTimer.start();
- this._onTouchBegin(a)
- }
- };
- b._onTouchEndCapture = function(a) {
- this.delayTouchBeginEvent && this._onTouchBeginTimer()
- };
- b._onTouchBeginTimer = function() {
- this.touchBeginTimer.stop();
- var a = this.delayTouchBeginEvent;
- this.delayTouchBeginEvent = null;
- this.stage && this.dispatchPropagationEvent(a)
- };
- b.dispatchPropagationEvent = function(a) {
- for (var f = [], b = a._target, c = 0; b;) b == this && (c = f.length),
- f.push(b),
- b = b.parent;
- b = f.slice(0, c);
- b = b.reverse();
- f = b.concat(f);
- this._dispatchPropagationEvent(a, f, c)
- };
- b._dispatchPropagationEvent = function(a, f, b) {
- for (var c = f.length,
- d = 0; d < c; d++) {
- var e = f[d];
- a._currentTarget = e;
- a._eventPhase = d < b ? 1 : d == b ? 2 : 3;
- e._notifyListener(a);
- if (a._isPropagationStopped || a._isPropagationImmediateStopped) break
- }
- };
- b._onTouchMove = function(a) {
- if (this._ScrV_Props_._lastTouchPosition.x != a.stageX || this._ScrV_Props_._lastTouchPosition.y != a.stageY) {
- if (!this._ScrV_Props_._scrollStarted) {
- var f = a.stageX - this._ScrV_Props_._touchStartPosition.x,
- b = a.stageY - this._ScrV_Props_._touchStartPosition.y;
- if (Math.sqrt(f * f + b * b) < this.scrollBeginThreshold) {
- this._logTouchEvent(a);
- return
- }
- }
- this._ScrV_Props_._scrollStarted = !0;
- this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
- this.touchChildren = !1;
- f = this._getPointChange(a);
- this.setScrollPosition(f.y, f.x, !0);
- this._calcVelocitys(a);
- this._logTouchEvent(a)
- }
- };
- b._onTouchEnd = function(a) {
- this.touchChildren = !0;
- this._ScrV_Props_._scrollStarted = !1;
- c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
- c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_END, this._onTouchEnd, this);
- c.MainContext.instance.stage.removeEventListener(c.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
- this.removeEventListener(c.Event.ENTER_FRAME, this._onEnterFrame, this);
- this._moveAfterTouchEnd()
- };
- b._onEnterFrame = function(a) {
- a = c.getTimer();
- 100 < a - this._ScrV_Props_._lastTouchTime && 300 > a - this._ScrV_Props_._lastTouchTime && this._calcVelocitys(this._ScrV_Props_._lastTouchEvent)
- };
- b._logTouchEvent = function(a) {
- this._ScrV_Props_._lastTouchPosition.x = a.stageX;
- this._ScrV_Props_._lastTouchPosition.y = a.stageY;
- this._ScrV_Props_._lastTouchEvent = this.cloneTouchEvent(a);
- this._ScrV_Props_._lastTouchTime = c.getTimer()
- };
- b._getPointChange = function(a) {
- return {
- x: !1 === this._ScrV_Props_._hCanScroll ? 0 : this._ScrV_Props_._lastTouchPosition.x - a.stageX,
- y: !1 === this._ScrV_Props_._vCanScroll ? 0 : this._ScrV_Props_._lastTouchPosition.y - a.stageY
- }
- };
- b._calcVelocitys = function(a) {
- var f = c.getTimer();
- if (0 == this._ScrV_Props_._lastTouchTime) this._ScrV_Props_._lastTouchTime = f;
- else {
- var b = this._getPointChange(a),
- f = f - this._ScrV_Props_._lastTouchTime;
- b.x /= f;
- b.y /= f;
- this._ScrV_Props_._velocitys.push(b);
- 5 < this._ScrV_Props_._velocitys.length && this._ScrV_Props_._velocitys.shift();
- this._ScrV_Props_._lastTouchPosition.x = a.stageX;
- this._ScrV_Props_._lastTouchPosition.y = a.stageY
- }
- };
- b._getContentWidth = function() {
- return this._content.explicitWidth || this._content.width
- };
- b._getContentHeight = function() {
- return this._content.explicitHeight || this._content.height
- };
- b.getMaxScrollLeft = function() {
- var a = this._getContentWidth() - this.width;
- return Math.max(0, a)
- };
- b.getMaxScrollTop = function() {
- var a = this._getContentHeight() - this.height;
- return Math.max(0, a)
- };
- b._moveAfterTouchEnd = function() {
- if (0 != this._ScrV_Props_._velocitys.length) {
- for (var a = 0,
- f = 0,
- b = 0,
- c = 0; c < this._ScrV_Props_._velocitys.length; c++) var e = this._ScrV_Props_._velocitys[c],
- g = d.weight[c],
- a = a + e.x * g,
- f = f + e.y * g,
- b = b + g;
- this._ScrV_Props_._velocitys.length = 0;
- 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
- a = a / b * this.scrollSpeed;
- f = f / b * this.scrollSpeed;
- e = Math.abs(a);
- b = Math.abs(f);
- g = this.getMaxScrollLeft();
- c = this.getMaxScrollTop();
- a = 0.02 < e ? this.getAnimationDatas(a, this._ScrV_Props_._scrollLeft, g) : {
- position: this._ScrV_Props_._scrollLeft,
- duration: 1
- };
- f = 0.02 < b ? this.getAnimationDatas(f, this._ScrV_Props_._scrollTop, c) : {
- position: this._ScrV_Props_._scrollTop,
- duration: 1
- };
- this.setScrollLeft(a.position, a.duration);
- this.setScrollTop(f.position, f.duration)
- }
- };
- b._onTweenFinished = function(a) {
- a == this._ScrV_Props_._vScrollTween && (this._ScrV_Props_._isVTweenPlaying = !1);
- a == this._ScrV_Props_._hScrollTween && (this._ScrV_Props_._isHTweenPlaying = !1); ! 1 == this._ScrV_Props_._isHTweenPlaying && !1 == this._ScrV_Props_._isVTweenPlaying && this._onScrollFinished()
- };
- b._onScrollStarted = function() {};
- b._onScrollFinished = function() {
- c.Tween.removeTweens(this);
- this._ScrV_Props_._hScrollTween = null;
- this._ScrV_Props_._vScrollTween = null;
- this._ScrV_Props_._isHTweenPlaying = !1;
- this._ScrV_Props_._isVTweenPlaying = !1;
- this.dispatchEvent(new c.Event(c.Event.COMPLETE))
- };
- b.setScrollTop = function(a, f) {
- void 0 === f && (f = 0);
- var b = Math.min(this.getMaxScrollTop(), Math.max(a, 0));
- if (0 == f) return this.scrollTop = b,
- null;
- var d = c.Tween.get(this).to({
- scrollTop: a
- },
- f, c.Ease.quartOut);
- b != a && d.to({
- scrollTop: b
- },
- 300, c.Ease.quintOut);
- this._ScrV_Props_._isVTweenPlaying = !0;
- this._ScrV_Props_._vScrollTween = d;
- d.call(this._onTweenFinished, this, [d]);
- this._ScrV_Props_._isHTweenPlaying || this._onScrollStarted();
- return d
- };
- b.setScrollLeft = function(a, f) {
- void 0 === f && (f = 0);
- var b = Math.min(this.getMaxScrollLeft(), Math.max(a, 0));
- if (0 == f) return this.scrollLeft = b,
- null;
- var d = c.Tween.get(this).to({
- scrollLeft: a
- },
- f, c.Ease.quartOut);
- b != a && d.to({
- scrollLeft: b
- },
- 300, c.Ease.quintOut);
- this._ScrV_Props_._isHTweenPlaying = !0;
- this._ScrV_Props_._hScrollTween = d;
- d.call(this._onTweenFinished, this, [d]);
- this._ScrV_Props_._isVTweenPlaying || this._onScrollStarted();
- return d
- };
- b.getAnimationDatas = function(a, f, b) {
- var c = Math.abs(a),
- d = 0,
- e = f + 500 * a;
- if (0 > e || e > b) for (e = f; Infinity != Math.abs(a) && 0.02 < Math.abs(a);) e += a,
- a = 0 > e || e > b ? 0.998 * a * 0.95 : 0.998 * a,
- d++;
- else d = 500 * -Math.log(0.02 / c);
- return {
- position: Math.min(b + 50, Math.max(e, -50)),
- duration: d
- }
- };
- b.cloneTouchEvent = function(a) {
- var f = new c.TouchEvent(a._type, a._bubbles, a.cancelable);
- f.touchPointID = a.touchPointID;
- f._stageX = a._stageX;
- f._stageY = a._stageY;
- f.ctrlKey = a.ctrlKey;
- f.altKey = a.altKey;
- f.shiftKey = a.shiftKey;
- f.touchDown = a.touchDown;
- f._isDefaultPrevented = !1;
- f._target = a._target;
- return f
- };
- b.throwNotSupportedError = function() {
- throw Error(c.getString(1023));
- };
- b.addChild = function(a) {
- this.throwNotSupportedError();
- return null
- };
- b.addChildAt = function(a, f) {
- this.throwNotSupportedError();
- return null
- };
- b.removeChild = function(a) {
- this.throwNotSupportedError();
- return null
- };
- b.removeChildAt = function(a) {
- this.throwNotSupportedError();
- return null
- };
- b.setChildIndex = function(a, f) {
- this.throwNotSupportedError()
- };
- b.swapChildren = function(a, f) {
- this.throwNotSupportedError()
- };
- b.swapChildrenAt = function(a, f) {
- this.throwNotSupportedError()
- };
- b.hitTest = function(a, f, b) {
- void 0 === b && (b = !1);
- var d = e.prototype.hitTest.call(this, a, f, b);
- return d ? d: c.DisplayObject.prototype.hitTest.call(this, a, f, b)
- };
- d.weight = [1, 1.33, 1.66, 2, 2.33];
- return d
- } (c.DisplayObjectContainer);
- c.ScrollView = g;
- g.prototype.__class__ = "egret.ScrollView"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.REPEAT = "repeat";
- c.SCALE = "scale";
- return c
- } ();
- c.BitmapFillMode = g;
- g.prototype.__class__ = "egret.BitmapFillMode"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- e.call(this);
- this.scale9Grid = this._texture = null;
- this.fillMode = "scale";
- a && (this._texture = a, this._setSizeDirty());
- this.needDraw = !0
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "texture", {
- get: function() {
- return this._texture
- },
- set: function(a) {
- a != this._texture && (this._setSizeDirty(), this._texture = a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._render = function(a) {
- var f = this._texture;
- f ? (this._texture_to_render = f, d._drawBitmap(a, this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: f._textureWidth, this._DO_Props_._hasHeightSet ? this._DO_Props_._explicitHeight: f._textureHeight, this)) : this._texture_to_render = null
- };
- d._drawBitmap = function(a, f, b, c) {
- var e = c._texture_to_render;
- if (e) {
- var g = e._textureWidth,
- h = e._textureHeight;
- if ("scale" == c.fillMode) {
- var k = c.scale9Grid || e.scale9Grid;
- if (k && g - k.width < f && h - k.height < b) d.drawScale9GridImage(a, c, k, f, b);
- else {
- var k = e._offsetX,
- l = e._offsetY,
- m = e._bitmapWidth || g,
- p = e._bitmapHeight || h;
- f /= g;
- k = Math.round(k * f);
- f = Math.round(m * f);
- b /= h;
- l = Math.round(l * b);
- b = Math.round(p * b);
- d.renderFilter.drawImage(a, c, e._bitmapX, e._bitmapY, m, p, k, l, f, b)
- }
- } else d.drawRepeatImage(a, c, f, b, c.fillMode)
- }
- };
- d.drawRepeatImage = function(a, f, b, d, e) {
- var g = f._texture_to_render;
- if (g) {
- var h = g._textureWidth,
- k = g._textureHeight,
- l = g._bitmapX,
- m = g._bitmapY,
- h = g._bitmapWidth || h,
- k = g._bitmapHeight || k,
- p = g._offsetX,
- g = g._offsetY;
- c.RenderFilter.getInstance().drawImage(a, f, l, m, h, k, p, g, b, d, e)
- }
- };
- d.drawScale9GridImage = function(a, f, b, d, e) {
- var g = c.MainContext.instance.rendererContext._texture_scale_factor,
- h = f._texture_to_render;
- if (h && b) {
- var k = h._textureWidth,
- l = h._textureHeight,
- m = h._bitmapX,
- p = h._bitmapY,
- r = h._bitmapWidth || k,
- q = h._bitmapHeight || l;
- d -= k - r;
- e -= l - q;
- if (!a.drawImageScale9(h, m, p, r, q, h._offsetX, h._offsetY, d, e, b)) {
- k = h._offsetX / g;
- l = h._offsetY / g;
- h = c.RenderFilter.getInstance();
- b = c.Rectangle.identity.initialize(b.x - Math.round(k), b.y - Math.round(k), b.width, b.height);
- k = Math.round(k);
- l = Math.round(l);
- b.y == b.bottom && (b.bottom < q ? b.bottom++:b.y--);
- b.x == b.right && (b.right < r ? b.right++:b.x--);
- var x = m + b.x / g,
- z = m + b.right / g,
- u = r - b.right,
- y = p + b.y / g,
- g = p + b.bottom / g,
- w = q - b.bottom,
- B = k + b.x,
- A = l + b.y,
- q = e - (q - b.bottom),
- r = d - (r - b.right);
- h.drawImage(a, f, m, p, b.x, b.y, k, l, b.x, b.y);
- h.drawImage(a, f, x, p, b.width, b.y, B, l, r - b.x, b.y);
- h.drawImage(a, f, z, p, u, b.y, k + r, l, d - r, b.y);
- h.drawImage(a, f, m, y, b.x, b.height, k, A, b.x, q - b.y);
- h.drawImage(a, f, x, y, b.width, b.height, B, A, r - b.x, q - b.y);
- h.drawImage(a, f, z, y, u, b.height, k + r, A, d - r, q - b.y);
- h.drawImage(a, f, m, g, b.x, w, k, l + q, b.x, e - q);
- h.drawImage(a, f, x, g, b.width, w, B, l + q, r - b.x, e - q);
- h.drawImage(a, f, z, g, u, w, k + r, l + q, d - r, e - q)
- }
- }
- };
- b._measureBounds = function() {
- var a = this._texture;
- return a ? c.Rectangle.identity.initialize(0, 0, a._textureWidth, a._textureHeight) : e.prototype._measureBounds.call(this)
- };
- d.renderFilter = c.RenderFilter.getInstance();
- return d
- } (c.DisplayObject);
- c.Bitmap = g;
- g.prototype.__class__ = "egret.Bitmap"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._text = "";
- this._textChanged = !1;
- this._font = null;
- this._fontChanged = !1;
- this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = this._lineSpacing = this._letterSpacing = 0;
- this.textLinesChange = !0;
- this._lineHeights = [];
- this.needDraw = this.cacheAsBitmap = !0
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "text", {
- get: function() {
- return this._text
- },
- set: function(a) {
- this._text != a && (this._textChanged = !0, this._text = a, this._setSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "font", {
- get: function() {
- return this._font
- },
- set: function(a) {
- this._font != a && (this._font = a, this._fontChanged = !0, this._setSizeDirty())
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "letterSpacing", {
- get: function() {
- return this._letterSpacing
- },
- set: function(a) {
- this._setLetterSpacing(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setLetterSpacing = function(a) {
- this._letterSpacing = a;
- this._setSizeDirty()
- };
- Object.defineProperty(b, "lineSpacing", {
- get: function() {
- return this._lineSpacing
- },
- set: function(a) {
- this._setLineSpacing(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setLineSpacing = function(a) {
- this._lineSpacing = a
- };
- b._setSizeDirty = function() {
- e.prototype._setSizeDirty.call(this);
- this.textLinesChange = !0
- };
- b._render = function(a) {
- var f = this._getTextLines(),
- b = f.length;
- if (0 != b) {
- for (var e = this._font,
- g = e._getFirstCharHeight(), g = Math.ceil(g * d.EMPTY_FACTOR), n = 0, h = this._DO_Props_._hasHeightSet ? this._DO_Props_._explicitHeight: Number.POSITIVE_INFINITY, k = this._lineHeights, l = 0; l < b; l++) {
- var m = k[l];
- if (0 < l && n + m > h) break;
- for (var p = f[l], r = p.length, q = 0, x = 0; x < r; x++) {
- var z = p.charAt(x),
- u = e.getTexture(z);
- if (u) {
- var z = u._bitmapWidth || u._textureWidth,
- y = u._bitmapHeight || u._textureHeight;
- this._texture_to_render = u;
- c.RenderFilter.getInstance().drawImage(a, this, u._bitmapX, u._bitmapY, z, y, q + u._offsetX, n + u._offsetY, z, y);
- q += u._textureWidth + this._letterSpacing
- } else " " == z ? q += g: c.Logger.warningWithErrorId(1011, z)
- }
- n += m + this._lineSpacing
- }
- this._texture_to_render = null
- }
- };
- b._measureBounds = function() {
- var a = this._getTextLines();
- return 0 == a.length ? c.Rectangle.identity.initialize(0, 0, 0, 0) : c.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY + (a.length - 1) * this._lineSpacing)
- };
- b._getTextLines = function() {
- if (!this.textLinesChange) return this._textLines;
- var a = [];
- this._textLines = a;
- this.textLinesChange = !1;
- var f = [];
- this._lineHeights = f;
- if (!this._text || !this._font) return a;
- for (var b = 0,
- e = 0,
- g = 0,
- n = 0,
- h = this._DO_Props_._hasWidthSet,
- k = this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: Number.POSITIVE_INFINITY, l = this._font, m = l._getFirstCharHeight(), p = Math.ceil(m * d.EMPTY_FACTOR), r = this._text.split(/(?:\r\n|\r|\n)/), q = r.length, x = !0, z = 0; z < q; z++) {
- for (var u = r[z], y = u.length, w = 0, B = 0, A = !0, C = 0; C < y; C++) {
- A || (B += this._letterSpacing);
- var D = u.charAt(C),
- F,
- G = 0,
- H = 0,
- E = l.getTexture(D);
- if (E) D = E._textureWidth,
- F = E._textureHeight,
- G = E._offsetX,
- H = E._offsetY;
- else if (" " == D) D = p,
- F = m;
- else {
- c.Logger.warningWithErrorId(1011, D);
- A && (A = !1);
- continue
- }
- A && (A = !1, g = Math.min(G, g));
- x && (n = Math.min(H, n));
- h && 0 < C && B + D > k ? (a.push(u.substring(0, C)), f.push(w), e += w, b = Math.max(B, b), u = u.substring(C), y = u.length, C = 0, B = D, w = F) : (B += D, w = Math.max(F, w))
- }
- x && (x = !1);
- a.push(u);
- f.push(w);
- e += w;
- b = Math.max(B, b)
- }
- this._textWidth = b;
- this._textHeight = e;
- this._textOffsetX = g;
- this._textOffsetY = n;
- return a
- };
- d.EMPTY_FACTOR = 0.33;
- return d
- } (c.DisplayObject);
- c.BitmapText = g;
- g.prototype.__class__ = "egret.BitmapText"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function d() {
- this.fillStyleColor = this.strokeStyleColor = this.commandQueue = this._renderContext = null;
- this._dirty = !1;
- this.lineY = this.lineX = 0;
- this._firstCheck = !0;
- this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
- this.commandQueue = []
- }
- var b = d.prototype;
- b.beginFill = function(a, f) {
- void 0 === f && (f = 1);
- this.fillStyleColor = this._parseColor(a, f);
- this._pushCommand(new e(this._setStyle, this, [this.fillStyleColor]))
- };
- b._parseColor = function(a, f) {
- return "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + f + ")"
- };
- b._setStyle = function(a) {
- this._renderContext.fillStyle = a;
- this._renderContext.beginPath()
- };
- b.drawRect = function(a, f, b, c) {
- this._pushCommand(new e(function(a, f, b, c) {
- this._renderContext.beginPath();
- this._renderContext.rect(a, f, b, c);
- this._renderContext.closePath()
- },
- this, [a, f, b, c]));
- this._checkRect(a, f, b, c)
- };
- b.drawCircle = function(a, f, b) {
- this._pushCommand(new e(function(a, f, b) {
- this._renderContext.beginPath();
- this._renderContext.arc(a, f, b, 0, 2 * Math.PI);
- this._renderContext.closePath()
- },
- this, [a, f, b]));
- this._checkRect(a - b, f - b, 2 * b, 2 * b)
- };
- b.drawRoundRect = function(a, f, b, c, d, g) {
- this._pushCommand(new e(function(a, f, b, c, d, v) {
- d /= 2;
- v = v ? v / 2 : d;
- b = a + b;
- c = f + c;
- var e = c - v;
- this._renderContext.beginPath();
- this._renderContext.moveTo(b, e);
- this._renderContext.quadraticCurveTo(b, c, b - d, c);
- this._renderContext.lineTo(a + d, c);
- this._renderContext.quadraticCurveTo(a, c, a, c - v);
- this._renderContext.lineTo(a, f + v);
- this._renderContext.quadraticCurveTo(a, f, a + d, f);
- this._renderContext.lineTo(b - d, f);
- this._renderContext.quadraticCurveTo(b, f, b, f + v);
- this._renderContext.lineTo(b, e);
- this._renderContext.closePath()
- },
- this, [a, f, b, c, d, g]));
- this._checkRect(a, f, b, c)
- };
- b.drawEllipse = function(a, f, b, c) {
- this._pushCommand(new e(function(a, f, b, c) {
- a += b / 2;
- f += c / 2;
- var d = b > c ? b: c;
- b /= d;
- c /= d;
- d /= 2;
- this._renderContext.scale(b, c);
- this._renderContext.beginPath();
- this._renderContext.arc(a / b, f / c, d, 0, 2 * Math.PI);
- this._renderContext.closePath();
- this._renderContext.scale(1 / b, 1 / c)
- },
- this, [a, f, b, c]));
- this._checkRect(a, f, b, c)
- };
- b.lineStyle = function(a, f, b, c, d, g, h, k) {
- void 0 === a && (a = NaN);
- void 0 === f && (f = 0);
- void 0 === b && (b = 1);
- void 0 === c && (c = !1);
- void 0 === d && (d = "normal");
- void 0 === g && (g = null);
- void 0 === h && (h = null);
- void 0 === k && (k = 3);
- this.strokeStyleColor && (this._createEndLineCommand(), this._pushCommand(this._endLineCommand));
- this.strokeStyleColor = this._parseColor(f, b);
- this._pushCommand(new e(function(a, f) {
- this._renderContext.lineWidth = a;
- this._renderContext.strokeStyle = f;
- this._renderContext.beginPath()
- },
- this, [a, this.strokeStyleColor]));
- this.moveTo(this.lineX, this.lineY)
- };
- b.lineTo = function(a, f) {
- this._pushCommand(new e(function(a, f) {
- this._renderContext.lineTo(a, f)
- },
- this, [a, f]));
- this._checkPoint(this.lineX, this.lineY);
- this.lineX = a;
- this.lineY = f;
- this._checkPoint(a, f)
- };
- b.curveTo = function(a, f, b, c) {
- this._pushCommand(new e(function(a, f, b, c) {
- this._renderContext.quadraticCurveTo(a, f, b, c)
- },
- this, [a, f, b, c]));
- this._checkPoint(this.lineX, this.lineY);
- this.lineX = b;
- this.lineY = c;
- this._checkPoint(a, f);
- this._checkPoint(b, c)
- };
- b.cubicCurveTo = function(a, f, b, c, d, g) {
- this._pushCommand(new e(function(a, f, b, c, d, v) {
- this._renderContext.bezierCurveTo(a, f, b, c, d, v)
- },
- this, [a, f, b, c, d, g]));
- this._checkPoint(this.lineX, this.lineY);
- this.lineX = d;
- this.lineY = g;
- this._checkPoint(a, f);
- this._checkPoint(b, c);
- this._checkPoint(d, g)
- };
- b.moveTo = function(a, f) {
- this._pushCommand(new e(function(a, f) {
- this._renderContext.moveTo(a, f)
- },
- this, [a, f]));
- this.lineX = a;
- this.lineY = f
- };
- b.clear = function() {
- this.lineY = this.lineX = this.commandQueue.length = 0;
- this.fillStyleColor = this.strokeStyleColor = null;
- this._maxY = this._maxX = this._minY = this._minX = 0;
- this._dirty = this._firstCheck = !0
- };
- b.endFill = function() {
- null != this.fillStyleColor && (this._fill(), this.fillStyleColor = null)
- };
- b._beginDraw = function(a) {};
- b._endDraw = function(a) {};
- b._draw = function(a) {
- var f = this.commandQueue.length;
- if (0 != f) {
- this._beginDraw(a);
- for (var b = 0; b < f; b++) {
- var c = this.commandQueue[b];
- c.method.apply(c.thisObject, c.args)
- }
- this.fillStyleColor && (this._createEndFillCommand(), c = this._endFillCommand, c.method.apply(c.thisObject, c.args));
- this.strokeStyleColor && (this._createEndLineCommand(), c = this._endLineCommand, c.method.apply(c.thisObject, c.args));
- this._endDraw(a);
- this._dirty = !1
- }
- };
- b._checkRect = function(a, f, b, c) {
- this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = f, this._maxX = a + b, this._maxY = f + c) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, f), this._maxX = Math.max(this._maxX, a + b), this._maxY = Math.max(this._maxY, f + c));
- this._dirty = !0
- };
- b._checkPoint = function(a, f) {
- this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = f, this._maxX = a, this._maxY = f) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, f), this._maxX = Math.max(this._maxX, a), this._maxY = Math.max(this._maxY, f));
- this._lastX = a;
- this._lastY = f;
- this._dirty = !0
- };
- b._measureBounds = function() {
- return c.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
- };
- b._createEndFillCommand = function() {
- this._endFillCommand || (this._endFillCommand = new e(function() {
- this._renderContext.fill();
- this._renderContext.closePath()
- },
- this, null))
- };
- b._fill = function() {
- this.fillStyleColor && (this._createEndFillCommand(), this._pushCommand(this._endFillCommand));
- this.strokeStyleColor && (this._createEndLineCommand(), this._pushCommand(this._endLineCommand))
- };
- b._createEndLineCommand = function() {
- this._endLineCommand || (this._endLineCommand = new e(function() {
- this._renderContext.stroke();
- this._renderContext.closePath()
- },
- this, null))
- };
- b._pushCommand = function(a) {
- this.commandQueue.push(a);
- this._dirty = !0
- };
- return d
- } ();
- c.Graphics = g;
- g.prototype.__class__ = "egret.Graphics";
- var e = function() {
- return function(c, b, a) {
- this.method = c;
- this.thisObject = b;
- this.args = a
- }
- } ();
- e.prototype.__class__ = "egret.Command"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._graphics = null
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "graphics", {
- get: function() {
- this._graphics || (this._graphics = new c.Graphics, this.needDraw = !0);
- return this._graphics
- },
- enumerable: !0,
- configurable: !0
- });
- b._draw = function(a) {
- this._graphics && this._graphics._dirty && this._setCacheDirty();
- e.prototype._draw.call(this, a)
- };
- b._render = function(a) {
- this._graphics && this._graphics._draw(a)
- };
- b._measureBounds = function() {
- var a = this._graphics;
- return a ? a._measureBounds() : e.prototype._measureBounds.call(this)
- };
- return d
- } (c.DisplayObject);
- c.Shape = g;
- g.prototype.__class__ = "egret.Shape"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._graphics = null
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "graphics", {
- get: function() {
- this._graphics || (this._graphics = new c.Graphics, this.needDraw = !0);
- return this._graphics
- },
- enumerable: !0,
- configurable: !0
- });
- b._draw = function(a) {
- this._graphics && this._graphics._dirty && this._setCacheDirty();
- e.prototype._draw.call(this, a)
- };
- b._render = function(a) {
- this._graphics && this._graphics._draw(a);
- e.prototype._render.call(this, a)
- };
- b._measureBounds = function() {
- for (var a = 0,
- f = 0,
- b = 0,
- d = 0,
- e = this._children.length,
- g = 0; g < e; g++) {
- var h = this._children[g];
- if (h.visible) {
- var k = h.getBounds(c.Rectangle.identity, !1),
- l = k.x,
- m = k.y,
- p = k.width,
- k = k.height,
- h = h._getMatrix(),
- h = c.DisplayObject.getTransformBounds(c.Rectangle.identity.initialize(l, m, p, k), h),
- l = h.x,
- m = h.y,
- p = h.width + h.x,
- h = h.height + h.y;
- if (l < a || 0 == g) a = l;
- if (p > f || 0 == g) f = p;
- if (m < b || 0 == g) b = m;
- if (h > d || 0 == g) d = h
- }
- }
- if (this._graphics) {
- e = this._graphics._measureBounds();
- l = e.x;
- m = e.y;
- p = e.width + e.x;
- h = e.height + e.y;
- if (l < a || 0 == g) a = l;
- if (p > f || 0 == g) f = p;
- if (m < b || 0 == g) b = m;
- if (h > d || 0 == g) d = h
- }
- return c.Rectangle.identity.initialize(a, b, f - a, d - b)
- };
- b.hitTest = function(a, f, b) {
- void 0 === b && (b = !1);
- var d = e.prototype.hitTest.call(this, a, f, b);
- return d ? d: this._graphics ? c.DisplayObject.prototype.hitTest.call(this, a, f, b) : null
- };
- return d
- } (c.DisplayObjectContainer);
- c.Sprite = g;
- g.prototype.__class__ = "egret.Sprite"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {}
- e._getStartLine = function(c) {
- var b = e._getTextHeight(c),
- a = 0;
- c._DO_Props_._hasHeightSet && (!(b < c._DO_Props_._explicitHeight) && b > c._DO_Props_._explicitHeight && (a = Math.max(c._TF_Props_._scrollV - 1, 0), a = Math.min(c._TF_Props_._numLines - 1, a)), c._TF_Props_._multiline || (a = Math.max(c._TF_Props_._scrollV - 1, 0), a = Math.min(c._TF_Props_._numLines - 1, a)));
- return a
- };
- e._getHalign = function(d) {
- var b = d._getLinesArr(),
- a = 0;
- d._TF_Props_._textAlign == c.HorizontalAlign.CENTER ? a = 0.5 : d._TF_Props_._textAlign == c.HorizontalAlign.RIGHT && (a = 1);
- d._TF_Props_._type == c.TextFieldType.INPUT && !d._TF_Props_._multiline && 1 < b.length && (a = 0);
- return a
- };
- e._getTextHeight = function(d) {
- return c.TextFieldType.INPUT != d._TF_Props_._type || d._TF_Props_._multiline ? d._TF_Props_._textMaxHeight + (d._TF_Props_._numLines - 1) * d._TF_Props_._lineSpacing: d._TF_Props_._size
- };
- e._getValign = function(d) {
- var b = e._getTextHeight(d);
- return d._TF_Props_._type == c.TextFieldType.INPUT ? d._TF_Props_._multiline ? 0 : 0.5 : d._DO_Props_._hasHeightSet && b < d._DO_Props_._explicitHeight ? (b = 0, d._TF_Props_._verticalAlign == c.VerticalAlign.MIDDLE ? b = 0.5 : d._TF_Props_._verticalAlign == c.VerticalAlign.BOTTOM && (b = 1), b) : 0
- };
- e._getTextElement = function(c, b, a) {
- b = e._getHit(c, b, a);
- c = c._getLinesArr();
- return b && c[b.lineIndex] && c[b.lineIndex].elements[b.textElementIndex] ? c[b.lineIndex].elements[b.textElementIndex] : null
- };
- e._getHit = function(c, b, a) {
- var f = c._getLinesArr();
- if (0 == c._TF_Props_._textMaxWidth) return null;
- var v = 0,
- t = e._getTextHeight(c),
- g = 0;
- c._DO_Props_._hasHeightSet && c._DO_Props_._explicitHeight > t && (g = e._getValign(c) * (c._DO_Props_._explicitHeight - t), 0 != g && (a -= g));
- g = 0;
- for (t = e._getStartLine(c); t < f.length; t++) {
- var n = f[t];
- if (g + n.height >= a) {
- v = t + 1;
- break
- } else g += n.height;
- if (g + c._TF_Props_._lineSpacing > a) return null;
- g += c._TF_Props_._lineSpacing
- }
- if (0 === v) return null;
- c = f[v - 1];
- for (t = a = 0; t < c.elements.length; t++) if (f = c.elements[t], a + f.width < b) a += f.width;
- else return {
- lineIndex: v - 1,
- textElementIndex: t
- };
- return null
- };
- e._getScrollNum = function(c) {
- var b = 1;
- if (c._TF_Props_._multiline) {
- var a = c.height,
- f = c.size;
- c = c.lineSpacing;
- b = Math.floor(a / (f + c));
- a - (f + c) * b > f / 2 && b++
- }
- return b
- };
- return e
- } ();
- c.TextFieldUtils = g;
- g.prototype.__class__ = "egret.TextFieldUtils"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- return function() {
- this._text = this._type = "";
- this._displayAsPassword = !1;
- this._fontFamily = c.TextField.default_fontFamily;
- this._size = 30;
- this._bold = this._italic = !1;
- this._textColorString = "#FFFFFF";
- this._textColor = 16777215;
- this._strokeColorString = "#000000";
- this._stroke = this._strokeColor = 0;
- this._border = !1;
- this._borderColor = 0;
- this._background = !1;
- this._backgroundColor = 16777215;
- this._textAlign = "left";
- this._verticalAlign = "top";
- this._maxChars = this._textMaxHeight = this._textMaxWidth = 0;
- this._scrollV = -1;
- this._numLines = this._lineSpacing = 0;
- this._multiline = !1
- }
- } ();
- c.TextFieldProperties = g;
- g.prototype.__class__ = "egret.TextFieldProperties"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._inputEnabled = !1;
- this._bgGraphics = this._inputUtils = null;
- this._isFlow = !1;
- this._textArr = [];
- this._isArrayChanged = !1;
- this._linesArr = [];
- this._isTyping = !1;
- this.needDraw = !0;
- this._TF_Props_ = new c.TextFieldProperties
- }
- __extends(d, e);
- var b = d.prototype;
- b.isInput = function() {
- return this._TF_Props_._type == c.TextFieldType.INPUT
- };
- b._setTouchEnabled = function(a) {
- e.prototype._setTouchEnabled.call(this, a);
- this.isInput() && (this._inputEnabled = !0)
- };
- Object.defineProperty(b, "type", {
- get: function() {
- return this._TF_Props_._type
- },
- set: function(a) {
- this._setType(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setType = function(a) {
- var f = this._TF_Props_;
- f._type != a && (f._type = a, f._type == c.TextFieldType.INPUT ? (this._DO_Props_._hasWidthSet || this._setWidth(100), this._DO_Props_._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new c.InputController), this._inputUtils.init(this), this._setDirty(), this._DO_Props_._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
- };
- Object.defineProperty(b, "text", {
- get: function() {
- return this._getText()
- },
- set: function(a) {
- this._setText(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._getText = function() {
- return this._TF_Props_._type == c.TextFieldType.INPUT ? this._inputUtils._getText() : this._TF_Props_._text
- };
- b._setSizeDirty = function() {
- e.prototype._setSizeDirty.call(this);
- this._isArrayChanged = !0
- };
- b._setTextDirty = function() {
- this._setSizeDirty()
- };
- b._setBaseText = function(a) {
- null == a && (a = "");
- var f = this._TF_Props_;
- this._isFlow = !1;
- f._text != a && (this._setTextDirty(), f._text = a, a = "", a = f._displayAsPassword ? this.changeToPassText(f._text) : f._text, this.setMiddleStyle([{
- text: a
- }]))
- };
- b._setText = function(a) {
- null == a && (a = "");
- this._setBaseText(a);
- this._inputUtils && this._inputUtils._setText(this._TF_Props_._text)
- };
- Object.defineProperty(b, "displayAsPassword", {
- get: function() {
- return this._TF_Props_._displayAsPassword
- },
- set: function(a) {
- this._setDisplayAsPassword(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setDisplayAsPassword = function(a) {
- var f = this._TF_Props_;
- f._displayAsPassword != a && (f._displayAsPassword = a, this._setTextDirty(), a = "", a = f._displayAsPassword ? this.changeToPassText(f._text) : f._text, this.setMiddleStyle([{
- text: a
- }]))
- };
- Object.defineProperty(b, "fontFamily", {
- get: function() {
- return this._TF_Props_._fontFamily
- },
- set: function(a) {
- this._setFontFamily(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setFontFamily = function(a) {
- this._TF_Props_._fontFamily != a && (this._setTextDirty(), this._TF_Props_._fontFamily = a)
- };
- Object.defineProperty(b, "size", {
- get: function() {
- return this._TF_Props_._size
- },
- set: function(a) {
- this._setSize(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setSize = function(a) {
- this._TF_Props_._size != a && (this._setTextDirty(), this._TF_Props_._size = a)
- };
- Object.defineProperty(b, "italic", {
- get: function() {
- return this._TF_Props_._italic
- },
- set: function(a) {
- this._setItalic(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setItalic = function(a) {
- this._TF_Props_._italic != a && (this._setTextDirty(), this._TF_Props_._italic = a)
- };
- Object.defineProperty(b, "bold", {
- get: function() {
- return this._TF_Props_._bold
- },
- set: function(a) {
- this._setBold(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setBold = function(a) {
- this._TF_Props_._bold != a && (this._setTextDirty(), this._TF_Props_._bold = a)
- };
- Object.defineProperty(b, "textColor", {
- get: function() {
- return this._TF_Props_._textColor
- },
- set: function(a) {
- this._setTextColor(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setTextColor = function(a) {
- this._TF_Props_._textColor != a && (this._setTextDirty(), this._TF_Props_._textColor = a, this._TF_Props_._textColorString = c.toColorString(a))
- };
- Object.defineProperty(b, "strokeColor", {
- get: function() {
- return this._TF_Props_._strokeColor
- },
- set: function(a) {
- this._setStrokeColor(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setStrokeColor = function(a) {
- this._TF_Props_._strokeColor != a && (this._setTextDirty(), this._TF_Props_._strokeColor = a, this._TF_Props_._strokeColorString = c.toColorString(a))
- };
- Object.defineProperty(b, "stroke", {
- get: function() {
- return this._TF_Props_._stroke
- },
- set: function(a) {
- this._setStroke(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setStroke = function(a) {
- this._TF_Props_._stroke != a && (this._setTextDirty(), this._TF_Props_._stroke = a)
- };
- Object.defineProperty(b, "textAlign", {
- get: function() {
- return this._TF_Props_._textAlign
- },
- set: function(a) {
- this._setTextAlign(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setTextAlign = function(a) {
- this._TF_Props_._textAlign != a && (this._setTextDirty(), this._TF_Props_._textAlign = a)
- };
- Object.defineProperty(b, "verticalAlign", {
- get: function() {
- return this._TF_Props_._verticalAlign
- },
- set: function(a) {
- this._setVerticalAlign(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setVerticalAlign = function(a) {
- this._TF_Props_._verticalAlign != a && (this._setTextDirty(), this._TF_Props_._verticalAlign = a)
- };
- Object.defineProperty(b, "maxChars", {
- get: function() {
- return this._TF_Props_._maxChars
- },
- set: function(a) {
- this._setMaxChars(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMaxChars = function(a) {
- this._TF_Props_._maxChars != a && (this._TF_Props_._maxChars = a)
- };
- Object.defineProperty(b, "scrollV", {
- get: function() {
- return Math.min(Math.max(this._TF_Props_._scrollV, 1), this.maxScrollV)
- },
- set: function(a) {
- this._TF_Props_._scrollV = Math.max(a, 1);
- this._setDirty()
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "maxScrollV", {
- get: function() {
- this._getLinesArr();
- return Math.max(this._TF_Props_._numLines - c.TextFieldUtils._getScrollNum(this) + 1, 1)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "selectionBeginIndex", {
- get: function() {
- return 0
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "selectionEndIndex", {
- get: function() {
- return 0
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "caretIndex", {
- get: function() {
- return 0
- },
- enumerable: !0,
- configurable: !0
- });
- b._setSelection = function(a, f) {};
- Object.defineProperty(b, "lineSpacing", {
- get: function() {
- return this._TF_Props_._lineSpacing
- },
- set: function(a) {
- this._setLineSpacing(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setLineSpacing = function(a) {
- this._TF_Props_._lineSpacing != a && (this._setTextDirty(), this._TF_Props_._lineSpacing = a)
- };
- b._getLineHeight = function() {
- return this._TF_Props_._lineSpacing + this._TF_Props_._size
- };
- Object.defineProperty(b, "numLines", {
- get: function() {
- return this._TF_Props_._numLines
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "multiline", {
- get: function() {
- return this._TF_Props_._multiline
- },
- set: function(a) {
- this._setMultiline(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMultiline = function(a) {
- this._TF_Props_._multiline = a;
- this._setDirty()
- };
- b._setWidth = function(a) {
- e.prototype._setWidth.call(this, a);
- this.fillBackground()
- };
- b._setHeight = function(a) {
- e.prototype._setHeight.call(this, a);
- this.fillBackground()
- };
- Object.defineProperty(b, "border", {
- get: function() {
- return this._TF_Props_._border
- },
- set: function(a) {
- this._TF_Props_._border = a;
- this.fillBackground()
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "borderColor", {
- get: function() {
- return this._TF_Props_._borderColor
- },
- set: function(a) {
- this._TF_Props_._borderColor = a;
- this.fillBackground()
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "background", {
- get: function() {
- return this._TF_Props_._background
- },
- set: function(a) {
- this._TF_Props_._background = a;
- this.fillBackground()
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "backgroundColor", {
- get: function() {
- return this._TF_Props_._backgroundColor
- },
- set: function(a) {
- this._TF_Props_._backgroundColor = a;
- this.fillBackground()
- },
- enumerable: !0,
- configurable: !0
- });
- b.fillBackground = function() {
- var a = this._bgGraphics,
- f = this._TF_Props_;
- a && a.clear();
- if (f._background || f._border) null == a && (a = this._bgGraphics = new c.Graphics),
- f._background && a.beginFill(f._backgroundColor, 1),
- f._border && a.lineStyle(1, f._borderColor),
- a.drawRect(0, 0, this._getWidth(), this._getHeight()),
- a.endFill()
- };
- b.setFocus = function() {
- c.Logger.warningWithErrorId(1013)
- };
- b._onRemoveFromStage = function() {
- e.prototype._onRemoveFromStage.call(this);
- this._removeEvent();
- this._TF_Props_._type == c.TextFieldType.INPUT && this._inputUtils._removeStageText()
- };
- b._onAddToStage = function() {
- e.prototype._onAddToStage.call(this);
- this._addEvent();
- this._TF_Props_._type == c.TextFieldType.INPUT && this._inputUtils._addStageText()
- };
- b._updateBaseTransform = function() {
- this._getLinesArr();
- 0 == this._TF_Props_._textMaxWidth && this._TF_Props_._type != c.TextFieldType.INPUT || e.prototype._updateTransform.call(this)
- };
- b._updateTransform = function() {
- this._TF_Props_._type == c.TextFieldType.INPUT ? this._DO_Props_._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() : this._updateBaseTransform()
- };
- b._draw = function(a) {
- var f = this._TF_Props_;
- if (f._type == c.TextFieldType.INPUT) {
- if (this._isTyping) return
- } else if (0 == f._textMaxWidth) return;
- e.prototype._draw.call(this, a)
- };
- b._render = function(a) {
- this._bgGraphics && this._bgGraphics._draw(a);
- this.drawText(a);
- this._clearDirty()
- };
- b._measureBounds = function() {
- var a = this._TF_Props_;
- this._getLinesArr();
- return 0 == a._textMaxWidth ? c.Rectangle.identity.initialize(0, 0, 0, 0) : c.Rectangle.identity.initialize(0, 0, a._textMaxWidth, c.TextFieldUtils._getTextHeight(this))
- };
- Object.defineProperty(b, "textFlow", {
- get: function() {
- return this._textArr
- },
- set: function(a) {
- var f = this._TF_Props_;
- this._isFlow = !0;
- var b = "";
- null == a && (a = []);
- for (var c = 0; c < a.length; c++) b += a[c].text;
- f._displayAsPassword ? this._setBaseText(b) : (f._text = b, this.setMiddleStyle(a))
- },
- enumerable: !0,
- configurable: !0
- });
- b.changeToPassText = function(a) {
- if (this._TF_Props_._displayAsPassword) {
- for (var f = "",
- b = 0,
- c = a.length; b < c; b++) switch (a.charAt(b)) {
- case "\n":
- f += "\n";
- break;
- case "\r":
- break;
- default:
- f += "*"
- }
- return f
- }
- return a
- };
- b.setMiddleStyle = function(a) {
- this._isArrayChanged = !0;
- this._textArr = a;
- this._setSizeDirty()
- };
- Object.defineProperty(b, "textWidth", {
- get: function() {
- return this._TF_Props_._textMaxWidth
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "textHeight", {
- get: function() {
- return c.TextFieldUtils._getTextHeight(this)
- },
- enumerable: !0,
- configurable: !0
- });
- b.appendText = function(a) {
- this.appendElement({
- text: a
- })
- };
- b.appendElement = function(a) {
- this._textArr.push(a);
- this.setMiddleStyle(this._textArr)
- };
- b._getLinesArr = function() {
- var a = this._TF_Props_;
- if (!this._isArrayChanged) return this._linesArr;
- this._isArrayChanged = !1;
- var f = this._textArr,
- b = c.MainContext.instance.rendererContext;
- this._linesArr.length = 0;
- a._textMaxHeight = 0;
- a._textMaxWidth = 0;
- if (this._DO_Props_._hasWidthSet && 0 == this._DO_Props_._explicitWidth) return a._numLines = 0,
- [{
- width: 0,
- height: 0,
- charNum: 0,
- elements: [],
- hasNextLine: !1
- }];
- this._isFlow || b.setupFont(this);
- for (var d = this._linesArr,
- e = 0,
- g = 0,
- h = 0,
- k = 0,
- l, m = 0,
- p = f.length; m < p; m++) {
- var r = f[m];
- r.style = r.style || {};
- for (var q = r.text.toString().split(/(?:\r\n|\r|\n)/), x = 0, z = q.length; x < z; x++) {
- null == d[k] && (l = {
- width: 0,
- height: 0,
- elements: [],
- charNum: 0,
- hasNextLine: !1
- },
- d[k] = l, g = h = e = 0);
- var h = a._type == c.TextFieldType.INPUT ? a._size: Math.max(h, r.style.size || a._size),
- u = !0;
- if ("" == q[x]) x == z - 1 && (u = !1);
- else {
- this._isFlow && b.setupFont(this, r.style);
- var y = b.measureText(q[x]);
- if (this._DO_Props_._hasWidthSet) if (e + y <= this._DO_Props_._explicitWidth) l.elements.push({
- width: y,
- text: q[x],
- style: r.style
- }),
- e += y,
- g += q[x].length,
- x == z - 1 && (u = !1);
- else {
- for (var w = u = 0,
- B = q[x], A = B.length; u < A; u++) {
- y = b.measureText(B.charAt(u));
- if (e + y > this._DO_Props_._explicitWidth && 0 != e + u) break;
- w += y;
- e += y;
- g += 1
- }
- 0 < u && (l.elements.push({
- width: w,
- text: B.substring(0, u),
- style: r.style
- }), q[x] = B.substring(u));
- x--;
- u = !1
- } else e += y,
- g += q[x].length,
- l.elements.push({
- width: y,
- text: q[x],
- style: r.style
- }),
- x == z - 1 && (u = !1)
- }
- u && (g++, l.hasNextLine = !0);
- x < q.length - 1 && (l.width = e, l.height = h, l.charNum = g, a._textMaxWidth = Math.max(a._textMaxWidth, e), a._textMaxHeight += h, k++)
- }
- m == f.length - 1 && l && (l.width = e, l.height = h, l.charNum = g, a._textMaxWidth = Math.max(a._textMaxWidth, e), a._textMaxHeight += h)
- }
- a._numLines = d.length;
- return d
- };
- b.drawText = function(a) {
- var f = this._TF_Props_,
- b = this._getLinesArr();
- if (0 != f._textMaxWidth) {
- var d = this._DO_Props_._hasWidthSet ? this._DO_Props_._explicitWidth: f._textMaxWidth,
- e = c.TextFieldUtils._getTextHeight(this),
- g = 0,
- h = c.TextFieldUtils._getStartLine(this);
- if (this._DO_Props_._hasHeightSet && this._DO_Props_._explicitHeight > e) var k = c.TextFieldUtils._getValign(this),
- g = g + k * (this._DO_Props_._explicitHeight - e);
- for (var g = Math.round(g), e = c.TextFieldUtils._getHalign(this), k = 0, l = h, m = f._numLines; l < m; l++) {
- var p = b[l],
- r = p.height,
- g = g + r / 2;
- if (l != h) {
- if (f._type == c.TextFieldType.INPUT && !f._multiline) break;
- if (this._DO_Props_._hasHeightSet && g > this._DO_Props_._explicitHeight) break
- }
- for (var k = Math.round((d - p.width) * e), q = 0, x = p.elements.length; q < x; q++) {
- var z = p.elements[q];
- a.drawText(this, z.text, k, g + (r - (z.style.size || f._size)) / 2, z.width, z.style);
- k += z.width
- }
- g += r / 2 + f._lineSpacing
- }
- }
- };
- b._addEvent = function() {
- this.addEventListener(c.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
- };
- b._removeEvent = function() {
- this.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
- };
- b.onTapHandler = function(a) {
- if (this._TF_Props_._type != c.TextFieldType.INPUT && (a = c.TextFieldUtils._getTextElement(this, a.localX, a.localY), null != a && (a = a.style) && a.href && a.href.match(/^event:/))) {
- var f = a.href.match(/^event:/)[0];
- c.TextEvent.dispatchTextEvent(this, c.TextEvent.LINK, a.href.substring(f.length))
- }
- };
- d.default_fontFamily = "Arial";
- return d
- } (c.DisplayObject);
- c.TextField = g;
- g.prototype.__class__ = "egret.TextField"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {
- this.resutlArr = []
- }
- var d = c.prototype;
- d.parser = function(b) {
- this.stackArray = [];
- this.resutlArr = [];
- for (var a = 0,
- f = b.length; a < f;) {
- var c = b.indexOf("<", a);
- 0 > c ? (this.addToResultArr(b.substring(a)), a = f) : (this.addToResultArr(b.substring(a, c)), a = b.indexOf(">", c), "/" == b.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(b.substring(c + 1, a)), a += 1)
- }
- return this.resutlArr
- };
- d.addToResultArr = function(b) {
- if ("" != b) {
- var a = [];
- a.push(["<", "<"]);
- a.push([">", ">"]);
- a.push(["&", "&"]);
- a.push([""", '"']);
- a.push(["';", "'"]);
- for (var f = 0; f < a.length; f++) b.replace(new RegExp(a[f][0], "g"), a[f][1]);
- 0 < this.stackArray.length ? this.resutlArr.push({
- text: b,
- style: this.stackArray[this.stackArray.length - 1]
- }) : this.resutlArr.push({
- text: b
- })
- }
- };
- d.changeStringToObject = function(b) {
- var a = {};
- b = b.replace(/( )+/g, " ").split(" ");
- for (var f = 0; f < b.length; f++) this.addProperty(a, b[f]);
- return a
- };
- d.addProperty = function(b, a) {
- var f = a.replace(/( )*=( )*/g, "=").split("=");
- f[1] && (f[1] = f[1].replace(/(\"|\')/g, ""));
- switch (f[0].toLowerCase()) {
- case "color":
- case "textcolor":
- f[1] = f[1].replace(/#/, "0x");
- b.textColor = parseInt(f[1]);
- break;
- case "strokecolor":
- f[1] = f[1].replace(/#/, "0x");
- b.strokeColor = parseInt(f[1]);
- break;
- case "stroke":
- b.stroke = parseInt(f[1]);
- break;
- case "b":
- b.bold = "true" == (f[1] || "true");
- break;
- case "i":
- b.italic = "true" == (f[1] || "true");
- break;
- case "size":
- b.size = parseInt(f[1]);
- break;
- case "fontfamily":
- b.fontFamily = f[1];
- break;
- case "href":
- b.href = f[1]
- }
- };
- d.addToArray = function(b) {
- b = this.changeStringToObject(b);
- if (0 != this.stackArray.length) {
- var a = this.stackArray[this.stackArray.length - 1],
- f;
- for (f in a) null == b[f] && (b[f] = a[f])
- }
- this.stackArray.push(b)
- };
- return c
- } ();
- c.HtmlTextParser = g;
- g.prototype.__class__ = "egret.HtmlTextParser"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.DYNAMIC = "dynamic";
- c.INPUT = "input";
- return c
- } ();
- c.TextFieldType = g;
- g.prototype.__class__ = "egret.TextFieldType"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- e.call(this);
- this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
- this._textureMap = {};
- this.texture = a;
- this._sourceWidth = a._sourceWidth;
- this._sourceHeight = a._sourceHeight;
- this._bitmapX = a._bitmapX - a._offsetX;
- this._bitmapY = a._bitmapY - a._offsetY
- }
- __extends(d, e);
- var b = d.prototype;
- b.getTexture = function(a) {
- return this._textureMap[a]
- };
- b.createTexture = function(a, f, b, d, e, g, h, k, l) {
- void 0 === g && (g = 0);
- void 0 === h && (h = 0);
- "undefined" === typeof k && (k = g + d);
- "undefined" === typeof l && (l = h + e);
- var m = this.texture._clone(),
- p = c.MainContext.instance.rendererContext._texture_scale_factor;
- m._bitmapX = this._bitmapX + f;
- m._bitmapY = this._bitmapY + b;
- m._bitmapWidth = d * p;
- m._bitmapHeight = e * p;
- m._offsetX = g;
- m._offsetY = h;
- m._textureWidth = k * p;
- m._textureHeight = l * p;
- m._sourceWidth = this._sourceWidth;
- m._sourceHeight = this._sourceHeight;
- return this._textureMap[a] = m
- };
- b.dispose = function() {
- this.texture && this.texture.dispose()
- };
- return d
- } (c.HashObject);
- c.SpriteSheet = g;
- g.prototype.__class__ = "egret.SpriteSheet"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._text = null;
- this._isFocus = !1
- }
- __extends(d, e);
- var b = d.prototype;
- b.init = function(a) {
- this._text = a;
- this.stageText = c.StageText.create();
- this.stageText._setTextField(this._text)
- };
- b._addStageText = function() {
- this._text._inputEnabled || (this._text._DO_Props_._touchEnabled = !0);
- this.stageText._add();
- this.stageText._addListeners();
- this.stageText.addEventListener("updateText", this.updateTextHandler, this);
- this._text.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
- c.MainContext.instance.stage.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);
- this.stageText.addEventListener("blur", this.blurHandler, this);
- this.stageText.addEventListener("focus", this.focusHandler, this)
- };
- b._removeStageText = function() {
- this._text._inputEnabled || (this._text._DO_Props_._touchEnabled = !1);
- this.stageText._remove();
- this.stageText._removeListeners();
- this.stageText._removeInput();
- this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
- this._text.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
- c.MainContext.instance.stage.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);
- this.stageText.removeEventListener("blur", this.blurHandler, this);
- this.stageText.removeEventListener("focus", this.focusHandler, this)
- };
- b._getText = function() {
- return this.stageText._getText()
- };
- b._setText = function(a) {
- this.stageText._setText(a)
- };
- b.focusHandler = function(a) {
- this._isFocus = !0;
- this._text._isTyping = !0;
- this._text.dispatchEvent(new c.FocusEvent(c.FocusEvent.FOCUS_IN))
- };
- b.blurHandler = function(a) {
- this._isFocus = !1;
- this._text._isTyping = !1;
- this._text.dispatchEvent(new c.FocusEvent(c.FocusEvent.FOCUS_OUT))
- };
- b.onMouseDownHandler = function(a) {
- a.stopPropagation();
- this._text._DO_Props_._visible && !this._isFocus && (this._isFocus = !0, this.stageText._show(this._text._TF_Props_._multiline, this._text.size, this._text.width, this._text.height), a = this._text.localToGlobal(), this.stageText._initElement(a.x, a.y, this._text._worldTransform.a, this._text._worldTransform.d))
- };
- b.onStageDownHandler = function(a) {
- this.stageText._hide()
- };
- b.updateTextHandler = function(a) {
- this.resetText();
- this._text.dispatchEvent(new c.Event(c.Event.CHANGE))
- };
- b.resetText = function() {
- this._text._setBaseText(this.stageText._getText())
- };
- b._hideInput = function() {
- this.stageText._removeInput()
- };
- b._updateTransform = function() {
- this._text._updateBaseTransform(); ! this._text._DO_Props_._visible && this.stageText && this._hideInput()
- };
- b._updateProperties = function() {
- if (!this._isFocus) {
- var a = this._text._DO_Props_._stage;
- if (null == a) this.stageText._setVisible(!1);
- else {
- for (var f = this._text,
- b = f._DO_Props_._visible; b;) {
- f = f.parent;
- if (f == a) break;
- b = f._DO_Props_._visible
- }
- this.stageText._setVisible(b)
- }
- this.stageText._setMultiline(this._text._TF_Props_._multiline);
- this.stageText._setTextType(this._text._TF_Props_._displayAsPassword ? "password": "text");
- this.stageText._setText(this._text._TF_Props_._text);
- this.stageText._resetStageText()
- }
- this._updateTransform()
- };
- return d
- } (c.HashObject);
- c.InputController = g;
- g.prototype.__class__ = "egret.InputController"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a, f) {
- c.call(this, a);
- this.firstCharHeight = 0;
- "string" == typeof f ? this.charList = this.parseConfig(f) : f && f.hasOwnProperty("frames") ? this.charList = f.frames: this.charList = {}
- }
- __extends(d, c);
- var b = d.prototype;
- b.getTexture = function(a) {
- var f = this._textureMap[a];
- if (!f) {
- f = this.charList[a];
- if (!f) return null;
- f = this.createTexture(a, f.x, f.y, f.w, f.h, f.offX, f.offY, f.sourceW, f.sourceH);
- this._textureMap[a] = f
- }
- return f
- };
- b._getFirstCharHeight = function() {
- if (0 == this.firstCharHeight) for (var a in this.charList) {
- var f = this.charList[a];
- if (f) {
- var b = f.sourceH;
- void 0 === b && (b = f.h, void 0 === b && (b = 0), f = f.offY, void 0 === f && (f = 0), b += f);
- if (! (0 >= b)) {
- this.firstCharHeight = b;
- break
- }
- }
- }
- return this.firstCharHeight
- };
- b.parseConfig = function(a) {
- a = a.split("\r\n").join("\n");
- a = a.split("\n");
- for (var f = this.getConfigByKey(a[3], "count"), b = {},
- c = 4; c < 4 + f; c++) {
- var d = a[c],
- e = String.fromCharCode(this.getConfigByKey(d, "id")),
- g = {};
- b[e] = g;
- g.x = this.getConfigByKey(d, "x");
- g.y = this.getConfigByKey(d, "y");
- g.w = this.getConfigByKey(d, "width");
- g.h = this.getConfigByKey(d, "height");
- g.offX = this.getConfigByKey(d, "xoffset");
- g.offY = this.getConfigByKey(d, "yoffset")
- }
- return b
- };
- b.getConfigByKey = function(a, f) {
- for (var b = a.split(" "), c = 0, d = b.length; c < d; c++) {
- var e = b[c];
- if (f == e.substring(0, f.length)) return b = e.substring(f.length + 1),
- parseInt(b)
- }
- return 0
- };
- return d
- } (c.SpriteSheet);
- c.BitmapFont = g;
- g.prototype.__class__ = "egret.BitmapFont"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- e.call(this);
- this._isAddedToStage = !1;
- this._frames = this._movieClipData = this._textureToRender = null;
- this._totalFrames = 0;
- this._frameLabels = null;
- this._frameIntervalTime = 0;
- this._eventPool = null;
- this._isPlaying = !1;
- this._isStopped = !0;
- this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
- this._setMovieClipData(a);
- this.needDraw = !0
- }
- __extends(d, e);
- var b = d.prototype;
- b._init = function() {
- this._reset();
- var a = this._movieClipData;
- a && a._isDataValid() && (this._frames = a.frames, this._totalFrames = a.numFrames, this._frameLabels = a.labels, this._frameIntervalTime = 1E3 / a.frameRate, this._initFrame())
- };
- b._reset = function() {
- this._frames = null;
- this._playTimes = 0;
- this._isPlaying = !1;
- this.setIsStopped(!0);
- this._currentFrameNum = 0;
- this._nextFrameNum = 1;
- this._passedTime = this._displayedKeyFrameNum = 0;
- this._eventPool = []
- };
- b._initFrame = function() {
- this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
- };
- b._render = function(a) {
- var f = this._textureToRender;
- if (this._texture_to_render = f) {
- var b = Math.round(f._offsetX),
- c = Math.round(f._offsetY),
- e = f._bitmapWidth || f._textureWidth,
- g = f._bitmapHeight || f._textureHeight,
- h = Math.round(e),
- k = Math.round(g);
- d.renderFilter.drawImage(a, this, f._bitmapX, f._bitmapY, e, g, b, c, h, k)
- }
- };
- b._measureBounds = function() {
- var a = this._textureToRender;
- return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : e.prototype._measureBounds.call(this)
- };
- b._onAddToStage = function() {
- e.prototype._onAddToStage.call(this);
- this._isAddedToStage = !0;
- this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
- };
- b._onRemoveFromStage = function() {
- e.prototype._onRemoveFromStage.call(this);
- this._isAddedToStage = !1;
- this.setIsStopped(!0)
- };
- b._getFrameLabelByName = function(a, f) {
- void 0 === f && (f = !1);
- f && (a = a.toLowerCase());
- var b = this._frameLabels;
- if (b) for (var c = null,
- d = 0; d < b.length; d++) if (c = b[d], f ? c.name.toLowerCase() === a: c.name === a) return c;
- return null
- };
- b._getFrameLabelByFrame = function(a) {
- var b = this._frameLabels;
- if (b) for (var c = null,
- d = 0; d < b.length; d++) if (c = b[d], c.frame === a) return c;
- return null
- };
- b._getFrameLabelForFrame = function(a) {
- var b = null,
- c = null,
- d = this._frameLabels;
- if (d) for (var e = 0; e < d.length; e++) {
- c = d[e];
- if (c.frame > a) break;
- b = c
- }
- return b
- };
- b.play = function(a) {
- void 0 === a && (a = 0);
- this._isPlaying = !0;
- this.setPlayTimes(a);
- 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
- };
- b.stop = function() {
- this._isPlaying = !1;
- this.setIsStopped(!0)
- };
- b.prevFrame = function() {
- this.gotoAndStop(this._currentFrameNum - 1)
- };
- b.nextFrame = function() {
- this.gotoAndStop(this._currentFrameNum + 1)
- };
- b.gotoAndPlay = function(a, b) {
- void 0 === b && (b = 0);
- if (0 === arguments.length || 2 < arguments.length) throw Error(c.getString(1022, "MovieClip.gotoAndPlay()"));
- this.play(b);
- this._gotoFrame(a)
- };
- b.gotoAndStop = function(a) {
- if (1 != arguments.length) throw Error(c.getString(1022, "MovieClip.gotoAndStop()"));
- this.stop();
- this._gotoFrame(a)
- };
- b._gotoFrame = function(a) {
- var b;
- if ("string" === typeof a) b = this._getFrameLabelByName(a).frame;
- else if (b = parseInt(a + "", 10), b != a) throw Error(c.getString(1022, "Frame Label Not Found"));
- 1 > b ? b = 1 : b > this._totalFrames && (b = this._totalFrames);
- b !== this._nextFrameNum && (this._nextFrameNum = b, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
- };
- b._advanceTime = function(a) {
- var b = this._frameIntervalTime;
- a = this._passedTime + a;
- this._passedTime = a % b;
- b = a / b;
- if (! (1 > b)) {
- for (; 1 <= b;) {
- b--;
- this._nextFrameNum++;
- if (this._nextFrameNum > this._totalFrames) if ( - 1 == this._playTimes) this._eventPool.push(c.Event.LOOP_COMPLETE),
- this._nextFrameNum = 1;
- else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(c.Event.LOOP_COMPLETE),
- this._nextFrameNum = 1;
- else {
- this._nextFrameNum = this._totalFrames;
- this._eventPool.push(c.Event.COMPLETE);
- this.stop();
- break
- }
- this._advanceFrame()
- }
- this._constructFrame();
- this._handlePendingEvent();
- this._setDirty()
- }
- };
- b._advanceFrame = function() {
- this._currentFrameNum = this._nextFrameNum
- };
- b._constructFrame = function() {
- var a = this._currentFrameNum;
- this._displayedKeyFrameNum != a && (this._textureToRender = this._movieClipData.getTextureByFrame(a), this._DO_Props_._sizeDirty = !0, this._displayedKeyFrameNum = a)
- };
- b._handlePendingEvent = function() {
- if (0 != this._eventPool.length) {
- this._eventPool.reverse();
- for (var a = this._eventPool,
- b = a.length,
- d = !1,
- e = !1,
- g = 0; g < b; g++) {
- var n = a.pop();
- n == c.Event.LOOP_COMPLETE ? e = !0 : n == c.Event.COMPLETE ? d = !0 : this.dispatchEventWith(n)
- }
- e && this.dispatchEventWith(c.Event.LOOP_COMPLETE);
- d && this.dispatchEventWith(c.Event.COMPLETE)
- }
- };
- Object.defineProperty(b, "totalFrames", {
- get: function() {
- return this._totalFrames
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "currentFrame", {
- get: function() {
- return this._currentFrameNum
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "currentFrameLabel", {
- get: function() {
- var a = this._getFrameLabelByFrame(this._currentFrameNum);
- return a && a.name
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "currentLabel", {
- get: function() {
- var a = this._getFrameLabelForFrame(this._currentFrameNum);
- return a ? a.name: null
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "frameRate", {
- get: function() {
- return this.movieClipData.frameRate
- },
- set: function(a) {
- a != this._movieClipData.frameRate && (this._movieClipData.frameRate = a, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "isPlaying", {
- get: function() {
- return this._isPlaying
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "movieClipData", {
- get: function() {
- return this._movieClipData
- },
- set: function(a) {
- this._setMovieClipData(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMovieClipData = function(a) {
- this._movieClipData != a && (this._movieClipData = a, this._init())
- };
- b.setPlayTimes = function(a) {
- if (0 > a || 1 <= a) this._playTimes = 0 > a ? -1 : Math.floor(a)
- };
- b.setIsStopped = function(a) {
- this._isStopped != a && ((this._isStopped = a) ? (this._playTimes = 0, c.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, c.Ticker.getInstance().register(this._advanceTime, this)))
- };
- d.renderFilter = c.RenderFilter.getInstance();
- return d
- } (c.DisplayObject);
- c.MovieClip = g;
- g.prototype.__class__ = "egret.MovieClip"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a, b) {
- c.call(this);
- this._name = a;
- this._frame = b | 0
- }
- __extends(d, c);
- var b = d.prototype;
- Object.defineProperty(b, "name", {
- get: function() {
- return this._name
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "frame", {
- get: function() {
- return this._frame
- },
- enumerable: !0,
- configurable: !0
- });
- b.clone = function() {
- return new d(this._name, this._frame)
- };
- return d
- } (c.EventDispatcher);
- c.FrameLabel = g;
- g.prototype.__class__ = "egret.FrameLabel"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._mcData = null;
- this.numFrames = 1;
- this.frames = [];
- this.labels = null;
- this.frameRate = 0;
- this.spriteSheet = this.textureData = null
- }
- __extends(d, e);
- var b = d.prototype;
- b._init = function(a, b, c) {
- this.textureData = b;
- this.spriteSheet = c;
- this._setMCData(a)
- };
- b.getKeyFrameData = function(a) {
- a = this.frames[a - 1];
- a.frame && (a = this.frames[a.frame - 1]);
- return a
- };
- b.getTextureByFrame = function(a) {
- a = this.getKeyFrameData(a);
- if (a.res) {
- var b = this.getTextureByResName(a.res);
- b._offsetX = a.x | 0;
- b._offsetY = a.y | 0;
- return b
- }
- return null
- };
- b.getTextureByResName = function(a) {
- var b = this.spriteSheet.getTexture(a);
- b || (b = this.textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
- return b
- };
- b._isDataValid = function() {
- return 0 < this.frames.length
- };
- b._isTextureValid = function() {
- return null != this.textureData && null != this.spriteSheet
- };
- b._fillMCData = function(a) {
- this.frameRate = a.frameRate || 24;
- this._fillFramesData(a.frames);
- this._fillFrameLabelsData(a.labels)
- };
- b._fillFramesData = function(a) {
- for (var b = this.frames,
- c = a ? a.length: 0, d, e = 0; e < c; e++) if (d = a[e], b.push(d), d.duration) {
- var g = parseInt(d.duration);
- if (1 < g) {
- d = b.length;
- for (var h = 1; h < g; h++) b.push({
- frame: d
- })
- }
- }
- this.numFrames = b.length
- };
- b._fillFrameLabelsData = function(a) {
- if (a) {
- var b = a.length;
- if (0 < b) {
- this.labels = [];
- for (var d = 0; d < b; d++) {
- var e = a[d];
- this.labels.push(new c.FrameLabel(e.name, e.frame))
- }
- }
- }
- };
- Object.defineProperty(b, "mcData", {
- get: function() {
- return this._mcData
- },
- set: function(a) {
- this._setMCData(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setMCData = function(a) {
- this._mcData != a && (this._mcData = a) && this._fillMCData(a)
- };
- return d
- } (c.HashObject);
- c.MovieClipData = g;
- g.prototype.__class__ = "egret.MovieClipData"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, b) {
- e.call(this);
- this.enableCache = !0;
- this._mcDataCache = {};
- this._mcDataSet = a;
- this.setTexture(b)
- }
- __extends(d, e);
- var b = d.prototype;
- b.clearCache = function() {
- this._mcDataCache = {}
- };
- b.generateMovieClipData = function(a) {
- void 0 === a && (a = "");
- if ("" == a && this._mcDataSet) for (a in this._mcDataSet.mc) break;
- if ("" == a) return null;
- var b = this._findFromCache(a, this._mcDataCache);
- b || (b = new c.MovieClipData, this._fillData(a, b, this._mcDataCache));
- return b
- };
- b._findFromCache = function(a, b) {
- return this.enableCache && b[a] ? b[a] : null
- };
- b._fillData = function(a, b, c) {
- if (this._mcDataSet) {
- var d = this._mcDataSet.mc[a];
- d && (b._init(d, this._mcDataSet.res, this._spriteSheet), this.enableCache && (c[a] = b))
- }
- };
- Object.defineProperty(b, "mcDataSet", {
- get: function() {
- return this._mcDataSet
- },
- set: function(a) {
- this._mcDataSet = a
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "texture", {
- set: function(a) {
- this.setTexture(a)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "spriteSheet", {
- get: function() {
- return this._spriteSheet
- },
- enumerable: !0,
- configurable: !0
- });
- b.setTexture = function(a) {
- this._spriteSheet = a ? new c.SpriteSheet(a) : null
- };
- return d
- } (c.EventDispatcher);
- c.MovieClipDataFactory = g;
- g.prototype.__class__ = "egret.MovieClipDataFactory"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._scaleY = this._scaleX = 1;
- this._size = 30;
- this._color = "#FFFFFF";
- this._fontFamily = "Arial";
- this._italic = this._bold = !1;
- this._textAlign = "left";
- this._verticalAlign = "top";
- this._visible = !1;
- this._height = this._width = 0;
- this._multiline = !1;
- this._maxChars = 0
- }
- __extends(d, c);
- var b = d.prototype;
- b._setTextField = function(a) {
- this._textfield = a
- };
- b._getText = function() {
- return null
- };
- b._setText = function(a) {};
- b._setTextType = function(a) {};
- b._getTextType = function() {
- return null
- };
- b._show = function(a, b, c, d) {};
- b._add = function() {};
- b._remove = function() {};
- b._hide = function() {};
- b._addListeners = function() {};
- b._removeListeners = function() {};
- b._setScale = function(a, b) {
- this._scaleX = a;
- this._scaleY = b
- };
- b.changePosition = function(a, b) {};
- b._setSize = function(a) {
- this._size = a
- };
- b._setTextColor = function(a) {
- this._color = a
- };
- b._setTextFontFamily = function(a) {
- this._fontFamily = a
- };
- b._setBold = function(a) {
- this._bold = a
- };
- b._setItalic = function(a) {
- this._italic = a
- };
- b._setTextAlign = function(a) {
- this._textAlign = a
- };
- b._setVerticalAlign = function(a) {
- this._verticalAlign = a
- };
- b._setVisible = function(a) {
- this._visible = a
- };
- b._setWidth = function(a) {
- this._width = a
- };
- b._setHeight = function(a) {
- this._height = a
- };
- b._setMultiline = function(a) {
- this._multiline = a
- };
- b._setMaxChars = function(a) {
- this._maxChars = a
- };
- b._resetStageText = function() {};
- b._initElement = function(a, b, c, d) {};
- b._removeInput = function() {};
- d.create = function() {
- return null
- };
- return d
- } (c.EventDispatcher);
- c.StageText = g;
- g.prototype.__class__ = "egret.StageText"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.GET = "get";
- c.POST = "post";
- return c
- } ();
- c.URLRequestMethod = g;
- g.prototype.__class__ = "egret.URLRequestMethod"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.BINARY = "binary";
- c.TEXT = "text";
- c.VARIABLES = "variables";
- c.TEXTURE = "texture";
- c.SOUND = "sound";
- return c
- } ();
- c.URLLoaderDataFormat = g;
- g.prototype.__class__ = "egret.URLLoaderDataFormat"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(a) {
- void 0 === a && (a = null);
- c.call(this);
- this.variables = null;
- null !== a && this.decode(a)
- }
- __extends(d, c);
- var b = d.prototype;
- b.decode = function(a) {
- this.variables || (this.variables = {});
- a = a.split("+").join(" ");
- for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) {
- var d = decodeURIComponent(b[1]);
- b = decodeURIComponent(b[2]);
- if (!1 == d in this.variables) this.variables[d] = b;
- else {
- var e = this.variables[d];
- e instanceof Array ? e.push(b) : this.variables[d] = [e, b]
- }
- }
- };
- b.toString = function() {
- if (!this.variables) return "";
- var a = this.variables,
- b = [],
- c;
- for (c in a) b.push(this.encodeValue(c, a[c]));
- return b.join("&")
- };
- b.encodeValue = function(a, b) {
- return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
- };
- b.encodeArray = function(a, b) {
- return a ? 0 == b.length ? encodeURIComponent(a) + "=": b.map(function(b) {
- return encodeURIComponent(a) + "=" + encodeURIComponent(b)
- }).join("&") : ""
- };
- return d
- } (c.HashObject);
- c.URLVariables = g;
- g.prototype.__class__ = "egret.URLVariables"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- return function(c, d) {
- this.value = this.name = "";
- this.name = c;
- this.value = d
- }
- } ();
- c.URLRequestHeader = g;
- g.prototype.__class__ = "egret.URLRequestHeader"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(b) {
- void 0 === b && (b = null);
- e.call(this);
- this.data = null;
- this.method = c.URLRequestMethod.GET;
- this.url = "";
- this.url = b
- }
- __extends(d, e);
- return d
- } (c.HashObject);
- c.URLRequest = g;
- g.prototype.__class__ = "egret.URLRequest"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- void 0 === a && (a = null);
- e.call(this);
- this.dataFormat = c.URLLoaderDataFormat.TEXT;
- this._request = this.data = null;
- this._status = -1;
- a && this.load(a)
- }
- __extends(d, e);
- var b = d.prototype;
- b.load = function(a) {
- this._request = a;
- this.data = null;
- c.MainContext.instance.netContext.proceed(this)
- };
- b.__recycle = function() {
- this.data = this._request = null
- };
- return d
- } (c.EventDispatcher);
- c.URLLoader = g;
- g.prototype.__class__ = "egret.URLLoader"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
- this._bitmapData = null
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "textureWidth", {
- get: function() {
- return this._textureWidth
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "textureHeight", {
- get: function() {
- return this._textureHeight
- },
- enumerable: !0,
- configurable: !0
- });
- b._setBitmapData = function(a) {
- var b = c.MainContext.instance.rendererContext._texture_scale_factor;
- this._bitmapData = a;
- this._sourceWidth = a.width;
- this._sourceHeight = a.height;
- this._textureWidth = this._sourceWidth * b;
- this._textureHeight = this._sourceHeight * b;
- this._bitmapWidth = this._textureWidth;
- this._bitmapHeight = this._textureHeight;
- this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
- };
- b.getPixel32 = function(a, b) {
- return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
- };
- b.dispose = function() {
- var a = this._bitmapData;
- a.dispose && a.dispose()
- };
- b._clone = function() {
- var a = new d;
- a._bitmapData = this._bitmapData;
- return a
- };
- b.draw = function(a, b, c, d, e, g, h, k, l, m) {};
- b._drawForCanvas = function(a, b, c, d, e, g, h, k, l, m) {
- var p = this._bitmapData;
- p && p.avaliable && (void 0 != m ? this._drawRepeatImageForCanvas(a, b, c, d, e, g, h, k, l, m) : a.drawImage(p, b, c, d, e, g, h, k, l))
- };
- b._drawForNative = function(a, b, c, d, e, g, h, k, l, m) {
- var p = this._bitmapData;
- p && p.avaliable && (void 0 !== m ? this._drawRepeatImageForNative(a, b, c, d, e, g, h, k, l, m) : a.drawImage(p, b, c, d, e, g, h, k, l))
- };
- b._drawRepeatImageForNative = function(a, b, d, e, g, n, h, k, l, m) {
- m = c.MainContext.instance.rendererContext._texture_scale_factor;
- e *= m;
- for (g *= m; n < k; n += e) for (var p = h; p < l; p += g) {
- var r = Math.min(e, k - n),
- q = Math.min(g, l - p);
- this._drawForNative(a, b, d, r / m, q / m, n, p, r, q, void 0)
- }
- };
- b._drawRepeatImageForCanvas = function(a, b, d, e, g, n, h, k, l, m) {
- if (void 0 === this.pattern) {
- var p = c.MainContext.instance.rendererContext._texture_scale_factor,
- r = this._bitmapData,
- q = r;
- if (r.width != e || r.height != g || 1 != p) q = document.createElement("canvas"),
- q.width = e * p,
- q.height = g * p,
- q.getContext("2d").drawImage(r, b, d, e, g, 0, 0, e * p, g * p);
- this.pattern = a.createPattern(q, m)
- }
- a.fillStyle = this.pattern;
- a.translate(n, h);
- a.fillRect(0, 0, k, l);
- a.translate( - n, -h)
- };
- b._disposeForCanvas = function() {
- d.deleteWebGLTexture(this);
- var a = this._bitmapData;
- a.onload = null;
- a.onerror = null;
- a.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAATSURBVHjaYvj//z8DAAAA//8DAAj8Av7TpXVhAAAAAElFTkSuQmCC";
- a.avaliable = !1;
- console.log("_disposeForCanvas")
- };
- b._disposeForNative = function() {
- var a = this._bitmapData;
- a.dispose();
- a.avaliable = !1;
- console.log("_disposeForNative")
- };
- d.deleteWebGLTexture = function(a) {
- if (a = a._bitmapData) {
- var b = a.webGLTexture;
- if (b) for (var c in b) {
- var d = b[c];
- d.glContext.deleteTexture(d)
- }
- a.webGLTexture = null
- }
- };
- d.createBitmapData = function(a, b) {};
- d._createBitmapDataForCanvasAndWebGl = function(a, b) {
- var e = d._bitmapDataFactory[a];
- e || (e = document.createElement("img"), e.setAttribute("bitmapSrc", a), d._bitmapDataFactory[a] = e);
- if (e.avaliable) b(0, e);
- else {
- e.crossOrigin = d.crossOrigin;
- var g = window.URL || window.webkitURL;
- if (null == d._bitmapCallbackMap[a]) if (d._addToCallbackList(a, b), 0 != a.indexOf("data:") && 0 != a.indexOf("http:") && 0 != a.indexOf("https:") && c.Browser.getInstance().isIOS() && 7 <= parseInt(c.Browser.getInstance().getIOSVersion().charAt(0)) && g) {
- var s = new XMLHttpRequest;
- s.open("get", a, !0);
- s.responseType = "blob";
- s.onload = function() {
- if (200 == this.status) {
- var c = this.response;
- e.onload = function() {
- g.revokeObjectURL(e.src);
- d._onLoad(a, e)
- };
- e.onerror = function() {
- d._onError(a, e)
- };
- e.src = g.createObjectURL(c)
- } else b(1, null)
- };
- s.send()
- } else e.onload = function() {
- d._onLoad(a, e)
- },
- e.onerror = function() {
- d._onError(a, e)
- },
- e.src = a;
- else d._addToCallbackList(a, b)
- }
- };
- d._onLoad = function(a, b) {
- b.avaliable = !0;
- b.onload && (b.onload = null);
- b.onerror && (b.onerror = null);
- var c = d._bitmapCallbackMap[a];
- if (c && c.length) {
- delete d._bitmapCallbackMap[a];
- for (var e = c.length,
- g = 0; g < e; g++)(0, c[g])(0, b)
- }
- };
- d._onError = function(a, b) {
- var c = d._bitmapCallbackMap[a];
- if (c && c.length) {
- delete d._bitmapCallbackMap[a];
- for (var e = c.length,
- g = 0; g < e; g++)(0, c[g])(1, b)
- }
- };
- d._createBitmapDataForNative = function(a, b) {
- console.log("_createBitmapDataForNative:" + a);
- var e = d._bitmapDataFactory[a];
- e ? (e.avaliable || (console.log("reload"), e.reload(), e.avaliable = !0), b(0, e)) : c.NativeNetContext.__use_asyn ? d._bitmapCallbackMap[a] ? d._addToCallbackList(a, b) : (d._addToCallbackList(a, b), e = new c.PromiseObject, e.onSuccessFunc = function(b) {
- d._bitmapDataFactory[a] = b;
- d._onLoad(a, b)
- },
- e.onErrorFunc = function() {
- d._onError(a, null)
- },
- console.log("addTextureAsyn"), egret_native.Texture.addTextureAsyn(a, e)) : (console.log("addTexture"), e = egret_native.Texture.addTexture(a), d._bitmapDataFactory[a] = e, e.avaliable = !0, b(0, e))
- };
- d._addToCallbackList = function(a, b) {
- var c = d._bitmapCallbackMap[a];
- c || (c = []);
- c.push(b);
- d._bitmapCallbackMap[a] = c
- };
- d.crossOrigin = null;
- d._bitmapDataFactory = {};
- d._bitmapCallbackMap = {};
- return d
- } (c.HashObject);
- c.Texture = g;
- g.prototype.__class__ = "egret.Texture"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this)
- }
- __extends(d, e);
- var b = d.prototype;
- b.init = function() {
- this._bitmapData = document.createElement("canvas");
- this._bitmapData.avaliable = !0;
- this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
- };
- b.drawToTexture = function(a, b, e) {
- var g = b || a.getBounds(c.Rectangle.identity);
- if (0 == g.width || 0 == g.height) return ! 1;
- this._bitmapData || this.init();
- var s = g.x,
- n = g.y,
- h = g.width,
- g = g.height,
- k, l, m = c.MainContext.instance.rendererContext._texture_scale_factor;
- k = h / m;
- l = g / m;
- k = Math.round(k);
- l = Math.round(l);
- this.setSize(k, l);
- this.begin();
- a._worldTransform.identity();
- a._worldTransform.a = 1 / m;
- a._worldTransform.d = 1 / m;
- e && (a._worldTransform.a *= e, a._worldTransform.d *= e);
- e = a._DO_Props_._anchorOffsetX;
- m = a._DO_Props_._anchorOffsetY;
- if (0 != a._DO_Props_._anchorX || 0 != a._DO_Props_._anchorY) e = a._DO_Props_._anchorX * k,
- m = a._DO_Props_._anchorY * l;
- this._offsetX = s + e;
- this._offsetY = n + m;
- a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
- b && (this._offsetX -= s, this._offsetY -= n);
- a.worldAlpha = 1;
- if (a instanceof c.DisplayObjectContainer) for (b = a._children, s = 0, n = b.length; s < n; s++) b[s]._updateTransform();
- this.renderContext.setTransform(a._worldTransform);
- b = c.RenderFilter.getInstance();
- s = b._drawAreaList.concat();
- b._drawAreaList.length = 0;
- this.renderContext.clearScreen();
- this.renderContext.onRenderStart();
- c.Texture.deleteWebGLTexture(this);
- a._hasFilters() && a._setGlobalFilters(this.renderContext); (n = a.mask || a._DO_Props_._scrollRect) && this.renderContext.pushMask(n);
- e = c.MainContext.__use_new_draw;
- c.MainContext.__use_new_draw = !1;
- a._render(this.renderContext);
- c.MainContext.__use_new_draw = e;
- n && this.renderContext.popMask();
- a._hasFilters() && a._removeGlobalFilters(this.renderContext);
- d.identityRectangle.width = k;
- d.identityRectangle.height = l;
- b.addDrawArea(d.identityRectangle);
- this.renderContext.onRenderFinish();
- b._drawAreaList = s;
- this._sourceWidth = k;
- this._sourceHeight = l;
- this._textureWidth = Math.round(h);
- this._textureHeight = Math.round(g);
- this.end();
- return ! 0
- };
- b.setSize = function(a, b) {
- var c = this._bitmapData;
- c.width = a;
- c.height = b;
- c.style.width = a + "px";
- c.style.height = b + "px";
- this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
- };
- b.begin = function() {};
- b.end = function() {};
- b.dispose = function() {
- this._bitmapData && (this.renderContext = this._bitmapData = null)
- };
- d.create = function() {
- return d._pool.length ? d._pool.pop() : new d
- };
- d.release = function(a) {
- d._pool.push(a)
- };
- d.identityRectangle = new c.Rectangle;
- d._pool = [];
- return d
- } (c.Texture);
- c.RenderTexture = g;
- g.prototype.__class__ = "egret.RenderTexture"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.renderCost = 0;
- this._texture_scale_factor = 1;
- this.profiler = c.Profiler.getInstance();
- d.blendModesForGL || d.initBlendMode()
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "texture_scale_factor", {
- get: function() {
- return this._texture_scale_factor
- },
- set: function(a) {
- this._setTextureScaleFactor(a)
- },
- enumerable: !0,
- configurable: !0
- });
- b._setTextureScaleFactor = function(a) {
- this._texture_scale_factor = a
- };
- b.clearScreen = function() {};
- b.clearRect = function(a, b, c, d) {};
- b.drawImage = function(a, b, c, d, e, g, h, k, l, m) {
- this.profiler.onDrawImage()
- };
- b.drawImageScale9 = function(a, b, c, d, e, g, h, k, l, m) {
- return ! 1
- };
- b._addOneDraw = function() {
- this.profiler.onDrawImage()
- };
- b.setTransform = function(a) {};
- b.setAlpha = function(a, b) {};
- b.setupFont = function(a, b) {};
- b.measureText = function(a) {
- return 0
- };
- b.drawText = function(a, b, c, d, e, g) {
- this.profiler.onDrawImage()
- };
- b.strokeRect = function(a, b, c, d, e) {};
- b.pushMask = function(a) {};
- b.popMask = function() {};
- b.onRenderStart = function() {};
- b.onRenderFinish = function() {};
- b.setGlobalFilters = function(a) {};
- b.drawCursor = function(a, b, c, d) {};
- d.createRendererContext = function(a) {
- return null
- };
- d.initBlendMode = function() {
- d.blendModesForGL = {};
- d.blendModesForGL[c.BlendMode.NORMAL] = [1, 771];
- d.blendModesForGL[c.BlendMode.ADD] = [770, 1];
- d.blendModesForGL[c.BlendMode.ERASE] = [0, 771];
- d.blendModesForGL[c.BlendMode.ERASE_REVERSE] = [0, 770]
- };
- d.registerBlendModeForGL = function(a, b, e, g) {
- d.blendModesForGL[a] && !g ? c.Logger.warningWithErrorId(1005, a) : d.blendModesForGL[a] = [b, e]
- };
- d.imageSmoothingEnabled = !0;
- d.blendModesForGL = null;
- return d
- } (c.HashObject);
- c.RendererContext = g;
- g.prototype.__class__ = "egret.RendererContext"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.MOUSE = "mouse";
- c.TOUCH = "touch";
- c.mode = "touch";
- return c
- } ();
- c.InteractionMode = g;
- g.prototype.__class__ = "egret.InteractionMode"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._currentTouchTarget = {};
- this.maxTouches = 2;
- this.touchDownTarget = {};
- this.touchingIdentifiers = [];
- this.lastTouchY = this.lastTouchX = -1
- }
- __extends(d, e);
- var b = d.prototype;
- b.run = function() {};
- b.getTouchData = function(a, b, c) {
- var d = this._currentTouchTarget[a];
- null == d && (d = {},
- this._currentTouchTarget[a] = d);
- d.stageX = b;
- d.stageY = c;
- d.identifier = a;
- return d
- };
- b.dispatchEvent = function(a, b) {
- c.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX, b.stageY, !1, !1, !1, !0 == this.touchDownTarget[b.identifier])
- };
- b.onTouchBegan = function(a, b, d) {
- if (this.touchingIdentifiers.length != this.maxTouches) {
- this.lastTouchX = a;
- this.lastTouchY = b;
- var e = c.MainContext.instance.stage.hitTest(a, b);
- e && (a = this.getTouchData(d, a, b), this.touchDownTarget[d] = !0, a.target = e, a.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a));
- this.touchingIdentifiers.push(d)
- }
- };
- b.onTouchMove = function(a, b, d) {
- if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || b != this.lastTouchY)) {
- this.lastTouchX = a;
- this.lastTouchY = b;
- var e = c.MainContext.instance.stage.hitTest(a, b);
- e && (a = this.getTouchData(d, a, b), a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, a))
- }
- };
- b.onTouchEnd = function(a, b, d) {
- var e = this.touchingIdentifiers.indexOf(d); - 1 != e && (this.touchingIdentifiers.splice(e, 1), e = c.MainContext.instance.stage.hitTest(a, b)) && (a = this.getTouchData(d, a, b), delete this.touchDownTarget[d], d = a.beginTarget, a.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), d == e ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
- };
- return d
- } (c.HashObject);
- c.TouchContext = g;
- g.prototype.__class__ = "egret.TouchContext"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this)
- }
- __extends(d, e);
- var b = d.prototype;
- b.proceed = function(a) {};
- d._getUrl = function(a) {
- var b = a.url; - 1 == b.indexOf("?") && a.method == c.URLRequestMethod.GET && a.data && a.data instanceof c.URLVariables && (b = b + "?" + a.data.toString());
- return b
- };
- b.getChangeList = function() {
- return []
- };
- return d
- } (c.HashObject);
- c.NetContext = g;
- g.prototype.__class__ = "egret.NetContext"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this.frameRate = 60
- }
- __extends(d, c);
- d.prototype.executeMainLoop = function(b, a) {};
- return d
- } (c.HashObject);
- c.DeviceContext = g;
- g.prototype.__class__ = "egret.DeviceContext"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.call = function(c, b) {};
- c.addCallback = function(c, b) {};
- return c
- } ();
- c.ExternalInterface = g;
- g.prototype.__class__ = "egret.ExternalInterface"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.header = this.trans = null;
- this.ua = navigator.userAgent.toLowerCase();
- this.trans = this.getTrans("transform")
- }
- __extends(d, e);
- var b = d.prototype;
- d.getInstance = function() {
- null == d.instance && (d.instance = new d);
- return d.instance
- };
- Object.defineProperty(b, "isMobile", {
- get: function() {
- c.Logger.warningWithErrorId(1E3);
- return c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE
- },
- enumerable: !0,
- configurable: !0
- });
- b.isIOS = function() {
- return 0 > this.ua.indexOf("windows") && (0 <= this.ua.indexOf("iphone") || 0 <= this.ua.indexOf("ipad") || 0 <= this.ua.indexOf("ipod"))
- };
- b.getIOSVersion = function() {
- return this.ua.toLowerCase().match(/cpu [^\d]*\d.*like mac os x/)[0].match(/\d(_\d)*/)[0]
- };
- b.getUserAgent = function() {
- return this.ua
- };
- b.getTrans = function(a, b) {
- void 0 === b && (b = !1);
- var c = "";
- b ? c = this.getHeader(a) : (null == this.header && (this.header = this.getHeader("transform")), c = this.header);
- return "" == c ? a: c + a.charAt(0).toUpperCase() + a.substring(1, a.length)
- };
- b.getHeader = function(a) {
- var b = document.createElement("div").style;
- if (a in b) return "";
- a = a.charAt(0).toUpperCase() + a.substring(1, a.length);
- for (var c = ["webkit", "ms", "Moz", "O"], d = 0; d < c.length; d++) if (c[d] + a in b) return c[d];
- return ""
- };
- b.$new = function(a) {
- return this.$(document.createElement(a))
- };
- b.$ = function(a) {
- var b = document;
- if (a = a instanceof HTMLElement ? a: b.querySelector(a)) a.find = a.find || this.$,
- a.hasClass = a.hasClass ||
- function(a) {
- return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
- },
- a.addClass = a.addClass ||
- function(a) {
- this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
- return this
- },
- a.removeClass = a.removeClass ||
- function(a) {
- this.hasClass(a) && (this.className = this.className.replace(a, ""));
- return this
- },
- a.remove = a.remove ||
- function() {},
- a.appendTo = a.appendTo ||
- function(a) {
- a.appendChild(this);
- return this
- },
- a.prependTo = a.prependTo ||
- function(a) {
- a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
- return this
- },
- a.transforms = a.transforms ||
- function() {
- this.style[d.getInstance().trans] = d.getInstance().translate(this.position) + d.getInstance().rotate(this.rotation) + d.getInstance().scale(this.scale) + d.getInstance().skew(this.skew);
- return this
- },
- a.position = a.position || {
- x: 0,
- y: 0
- },
- a.rotation = a.rotation || 0,
- a.scale = a.scale || {
- x: 1,
- y: 1
- },
- a.skew = a.skew || {
- x: 0,
- y: 0
- },
- a.translates = function(a, b) {
- this.position.x = a;
- this.position.y = b - c.MainContext.instance.stage.stageHeight;
- this.transforms();
- return this
- },
- a.rotate = function(a) {
- this.rotation = a;
- this.transforms();
- return this
- },
- a.resize = function(a, b) {
- this.scale.x = a;
- this.scale.y = b;
- this.transforms();
- return this
- },
- a.setSkew = function(a, b) {
- this.skew.x = a;
- this.skew.y = b;
- this.transforms();
- return this
- };
- return a
- };
- b.translate = function(a) {
- return "translate(" + a.x + "px, " + a.y + "px) "
- };
- b.rotate = function(a) {
- return "rotate(" + a + "deg) "
- };
- b.scale = function(a) {
- return "scale(" + a.x + ", " + a.y + ") "
- };
- b.skew = function(a) {
- return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
- };
- return d
- } (c.HashObject);
- c.Browser = g;
- g.prototype.__class__ = "egret.Browser"
- })(egret || (egret = {})); (function(c) { (function(c) {
- c.getItem = function(c) {
- return null
- };
- c.setItem = function(c, d) {
- return ! 1
- };
- c.removeItem = function(c) {};
- c.clear = function() {}
- })(c.localStorage || (c.localStorage = {}))
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {}
- e.parse = function(d) {
- d = c.SAXParser.getInstance().parserXML(d);
- if (!d || !d.childNodes) return null;
- for (var b = d.childNodes.length,
- a = !1,
- f = 0; f < b; f++) {
- var g = d.childNodes[f];
- if (1 == g.nodeType) {
- a = !0;
- break
- }
- }
- return a ? e.parseNode(g) : null
- };
- e.parseNode = function(c) {
- if (!c || 1 != c.nodeType) return null;
- var b = {};
- b.localName = c.localName;
- b.name = c.nodeName;
- c.namespaceURI && (b.namespace = c.namespaceURI);
- c.prefix && (b.prefix = c.prefix);
- for (var a = c.attributes,
- f = a.length,
- g = 0; g < f; g++) {
- var t = a[g],
- s = t.name;
- 0 != s.indexOf("xmlns:") && (b["$" + s] = t.value)
- }
- a = c.childNodes;
- f = a.length;
- for (g = 0; g < f; g++) if (t = e.parseNode(a[g])) b.children || (b.children = []),
- t.parent = b,
- b.children.push(t); ! b.children && (c = c.textContent.trim()) && (b.text = c);
- return b
- };
- e.findChildren = function(c, b, a) {
- a ? a.length = 0 : a = [];
- e.findByPath(c, b, a);
- return a
- };
- e.findByPath = function(c, b, a) {
- var f = b.indexOf("."),
- g; - 1 == f ? (g = b, f = !0) : (g = b.substring(0, f), b = b.substring(f + 1), f = !1);
- if (c = c.children) for (var t = c.length,
- s = 0; s < t; s++) {
- var n = c[s];
- n.localName == g && (f ? a.push(n) : e.findByPath(n, b, a))
- }
- };
- e.getAttributes = function(c, b) {
- b ? b.length = 0 : b = [];
- for (var a in c)"$" == a.charAt(0) && b.push(a.substring(1));
- return b
- };
- return e
- } ();
- c.XML = g;
- g.prototype.__class__ = "egret.XML"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.LITTLE_ENDIAN = "littleEndian";
- c.BIG_ENDIAN = "bigEndian";
- return c
- } ();
- c.Endian = g;
- g.prototype.__class__ = "egret.Endian";
- var e = function() {
- function d(a) {
- this.BUFFER_EXT_SIZE = 0;
- this.EOF_code_point = this.EOF_byte = -1;
- this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
- this.endian = g.BIG_ENDIAN
- }
- var b = d.prototype;
- b._setArrayBuffer = function(a) {
- this.write_position = a.byteLength;
- this.data = new DataView(a);
- this._position = 0
- };
- b.setArrayBuffer = function(a) {};
- Object.defineProperty(b, "buffer", {
- get: function() {
- return this.data.buffer
- },
- set: function(a) {
- this.data = new DataView(a)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "dataView", {
- get: function() {
- return this.data
- },
- set: function(a) {
- this.data = a;
- this.write_position = a.byteLength
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "bufferOffset", {
- get: function() {
- return this.data.byteOffset
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "position", {
- get: function() {
- return this._position
- },
- set: function(a) {
- this._position < a && !this.validate(a - this._position) || (this._position = a, this.write_position = a > this.write_position ? a: this.write_position)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "length", {
- get: function() {
- return this.write_position
- },
- set: function(a) {
- this.validateBuffer(a, !0)
- },
- enumerable: !0,
- configurable: !0
- });
- Object.defineProperty(b, "bytesAvailable", {
- get: function() {
- return this.data.byteLength - this._position
- },
- enumerable: !0,
- configurable: !0
- });
- b.clear = function() {
- this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
- };
- b.readBoolean = function() {
- return this.validate(d.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
- };
- b.readByte = function() {
- return this.validate(d.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
- };
- b.readBytes = function(a, b, c) {
- void 0 === b && (b = 0);
- void 0 === c && (c = 0);
- if (0 == c) c = this.bytesAvailable;
- else if (!this.validate(c)) return null;
- a ? a.validateBuffer(c) : a = new d(new ArrayBuffer(c));
- for (var e = 0; e < c; e++) a.data.setUint8(e + b, this.data.getUint8(this.position++))
- };
- b.readDouble = function() {
- if (!this.validate(d.SIZE_OF_FLOAT64)) return null;
- var a = this.data.getFloat64(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_FLOAT64;
- return a
- };
- b.readFloat = function() {
- if (!this.validate(d.SIZE_OF_FLOAT32)) return null;
- var a = this.data.getFloat32(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_FLOAT32;
- return a
- };
- b.readInt = function() {
- if (!this.validate(d.SIZE_OF_INT32)) return null;
- var a = this.data.getInt32(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_INT32;
- return a
- };
- b.readShort = function() {
- if (!this.validate(d.SIZE_OF_INT16)) return null;
- var a = this.data.getInt16(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_INT16;
- return a
- };
- b.readUnsignedByte = function() {
- return this.validate(d.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
- };
- b.readUnsignedInt = function() {
- if (!this.validate(d.SIZE_OF_UINT32)) return null;
- var a = this.data.getUint32(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_UINT32;
- return a
- };
- b.readUnsignedShort = function() {
- if (!this.validate(d.SIZE_OF_UINT16)) return null;
- var a = this.data.getUint16(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_UINT16;
- return a
- };
- b.readUTF = function() {
- if (!this.validate(d.SIZE_OF_UINT16)) return null;
- var a = this.data.getUint16(this.position, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_UINT16;
- return 0 < a ? this.readUTFBytes(a) : ""
- };
- b.readUTFBytes = function(a) {
- if (!this.validate(a)) return null;
- var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
- this.position += a;
- return this.decodeUTF8(b)
- };
- b.writeBoolean = function(a) {
- this.validateBuffer(d.SIZE_OF_BOOLEAN);
- this.data.setUint8(this.position++, a ? 1 : 0)
- };
- b.writeByte = function(a) {
- this.validateBuffer(d.SIZE_OF_INT8);
- this.data.setInt8(this.position++, a)
- };
- b.writeBytes = function(a, b, c) {
- void 0 === b && (b = 0);
- void 0 === c && (c = 0);
- if (! (0 > b || 0 > c) && (c = 0 == c ? a.length - b: Math.min(a.length - b, c), 0 < c)) {
- this.validateBuffer(c);
- a = new DataView(a.buffer);
- for (var d = b; d < c + b; d++) this.data.setUint8(this.position++, a.getUint8(d))
- }
- };
- b.writeDouble = function(a) {
- this.validateBuffer(d.SIZE_OF_FLOAT64);
- this.data.setFloat64(this.position, a, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_FLOAT64
- };
- b.writeFloat = function(a) {
- this.validateBuffer(d.SIZE_OF_FLOAT32);
- this.data.setFloat32(this.position, a, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_FLOAT32
- };
- b.writeInt = function(a) {
- this.validateBuffer(d.SIZE_OF_INT32);
- this.data.setInt32(this.position, a, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_INT32
- };
- b.writeShort = function(a) {
- this.validateBuffer(d.SIZE_OF_INT16);
- this.data.setInt16(this.position, a, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_INT16
- };
- b.writeUnsignedInt = function(a) {
- this.validateBuffer(d.SIZE_OF_UINT32);
- this.data.setUint32(this.position, a, this.endian == g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_UINT32
- };
- b.writeUTF = function(a) {
- a = this.encodeUTF8(a);
- var b = a.length;
- this.validateBuffer(d.SIZE_OF_UINT16 + b);
- this.data.setUint16(this.position, b, this.endian === g.LITTLE_ENDIAN);
- this.position += d.SIZE_OF_UINT16;
- this._writeUint8Array(a, !1)
- };
- b.writeUTFBytes = function(a) {
- this._writeUint8Array(this.encodeUTF8(a))
- };
- b.toString = function() {
- return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
- };
- b._writeUint8Array = function(a, b) {
- void 0 === b && (b = !0);
- b && this.validateBuffer(this.position + a.length);
- for (var c = 0; c < a.length; c++) this.data.setUint8(this.position++, a[c])
- };
- b.validate = function(a) {
- if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return ! 0;
- throw c.getString(1025);
- };
- b.validateBuffer = function(a, b) {
- void 0 === b && (b = !1);
- this.write_position = a > this.write_position ? a: this.write_position;
- a += this._position;
- if (this.data.byteLength < a || b) {
- var c = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)),
- d = Math.min(this.data.buffer.byteLength, a + this.BUFFER_EXT_SIZE);
- c.set(new Uint8Array(this.data.buffer, 0, d));
- this.buffer = c.buffer
- }
- };
- b.encodeUTF8 = function(a) {
- var b = 0;
- a = this.stringToCodePoints(a);
- for (var c = []; a.length > b;) {
- var d = a[b++];
- if (this.inRange(d, 55296, 57343)) this.encoderError(d);
- else if (this.inRange(d, 0, 127)) c.push(d);
- else {
- var e, g;
- this.inRange(d, 128, 2047) ? (e = 1, g = 192) : this.inRange(d, 2048, 65535) ? (e = 2, g = 224) : this.inRange(d, 65536, 1114111) && (e = 3, g = 240);
- for (c.push(this.div(d, Math.pow(64, e)) + g); 0 < e;) {
- var h = this.div(d, Math.pow(64, e - 1));
- c.push(128 + h % 64);
- e -= 1
- }
- }
- }
- return new Uint8Array(c)
- };
- b.decodeUTF8 = function(a) {
- for (var b = 0,
- c = "",
- d, e = 0,
- g = 0,
- h = 0,
- k = 0; a.length > b;) {
- d = a[b++];
- if (d === this.EOF_byte) d = 0 !== g ? this.decoderError(!1) : this.EOF_code_point;
- else if (0 === g) this.inRange(d, 0, 127) || (this.inRange(d, 194, 223) ? (g = 1, k = 128, e = d - 192) : this.inRange(d, 224, 239) ? (g = 2, k = 2048, e = d - 224) : this.inRange(d, 240, 244) ? (g = 3, k = 65536, e = d - 240) : this.decoderError(!1), e *= Math.pow(64, g), d = null);
- else if (this.inRange(d, 128, 191)) if (h += 1, e += (d - 128) * Math.pow(64, g - h), h !== g) d = null;
- else {
- var l = e,
- m = k,
- k = h = g = e = 0;
- d = this.inRange(l, m, 1114111) && !this.inRange(l, 55296, 57343) ? l: this.decoderError(!1, d)
- } else k = h = g = e = 0,
- b--,
- d = this.decoderError(!1, d);
- null !== d && d !== this.EOF_code_point && (65535 >= d ? 0 < d && (c += String.fromCharCode(d)) : (d -= 65536, c += String.fromCharCode(55296 + (d >> 10 & 1023)), c += String.fromCharCode(56320 + (d & 1023))))
- }
- return c
- };
- b.encoderError = function(a) {
- throw c.getString(1026, a);
- };
- b.decoderError = function(a, b) {
- if (a) throw c.getString(1027);
- return b || 65533
- };
- b.inRange = function(a, b, c) {
- return b <= a && a <= c
- };
- b.div = function(a, b) {
- return Math.floor(a / b)
- };
- b.stringToCodePoints = function(a) {
- for (var b = [], c = 0, d = a.length; c < a.length;) {
- var e = a.charCodeAt(c);
- if (this.inRange(e, 55296, 57343)) if (this.inRange(e, 56320, 57343)) b.push(65533);
- else if (c === d - 1) b.push(65533);
- else {
- var g = a.charCodeAt(c + 1);
- this.inRange(g, 56320, 57343) ? (e &= 1023, g &= 1023, c += 1, b.push(65536 + (e << 10) + g)) : b.push(65533)
- } else b.push(e);
- c += 1
- }
- return b
- };
- d.SIZE_OF_BOOLEAN = 1;
- d.SIZE_OF_INT8 = 1;
- d.SIZE_OF_INT16 = 2;
- d.SIZE_OF_INT32 = 4;
- d.SIZE_OF_UINT8 = 1;
- d.SIZE_OF_UINT16 = 2;
- d.SIZE_OF_UINT32 = 4;
- d.SIZE_OF_FLOAT32 = 4;
- d.SIZE_OF_FLOAT64 = 8;
- return d
- } ();
- c.ByteArray = e;
- e.prototype.__class__ = "egret.ByteArray"
- })(egret || (egret = {})); (function(c) {
- c.getOption = function(c) {
- if (window.hasOwnProperty("location")) {
- var e = location.search;
- if ("" == e) return "";
- for (var e = e.slice(1), e = e.split("&"), d = e.length, b = 0; b < d; b++) {
- var a = e[b].split("=");
- if (a[0] == c) return a[1]
- }
- }
- return ""
- }
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a, b, c) {
- e.call(this);
- this._target = null;
- this.loop = this.ignoreGlobalPause = this._useTicks = !1;
- this._actions = this._steps = this.pluginData = null;
- this.paused = !1;
- this.duration = 0;
- this._prevPos = -1;
- this.position = null;
- this._stepPosition = this._prevPosition = 0;
- this.passive = !1;
- this.initialize(a, b, c)
- }
- __extends(d, e);
- var b = d.prototype;
- d.get = function(a, b, c, e) {
- void 0 === b && (b = null);
- void 0 === c && (c = null);
- void 0 === e && (e = !1);
- e && d.removeTweens(a);
- return new d(a, b, c)
- };
- d.removeTweens = function(a) {
- if (a.tween_count) {
- for (var b = d._tweens,
- c = b.length - 1; 0 <= c; c--) b[c]._target == a && (b[c].paused = !0, b.splice(c, 1));
- a.tween_count = 0
- }
- };
- d.pauseTweens = function(a) {
- if (a.tween_count) for (var b = c.Tween._tweens,
- d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !0)
- };
- d.resumeTweens = function(a) {
- if (a.tween_count) for (var b = c.Tween._tweens,
- d = b.length - 1; 0 <= d; d--) b[d]._target == a && (b[d].paused = !1)
- };
- d.tick = function(a, b) {
- void 0 === b && (b = !1);
- for (var c = d._tweens.concat(), e = c.length - 1; 0 <= e; e--) {
- var g = c[e];
- b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : a)
- }
- };
- d._register = function(a, b) {
- var e = a._target,
- g = d._tweens;
- if (b) e && (e.tween_count = 0 < e.tween_count ? e.tween_count + 1 : 1),
- g.push(a),
- d._inited || (c.Ticker.getInstance().register(d.tick, null), d._inited = !0);
- else for (e && e.tween_count--, e = g.length; e--;) if (g[e] == a) {
- g.splice(e, 1);
- break
- }
- };
- d.removeAllTweens = function() {
- for (var a = d._tweens,
- b = 0,
- c = a.length; b < c; b++) {
- var e = a[b];
- e.paused = !0;
- e._target.tweenjs_count = 0
- }
- a.length = 0
- };
- b.initialize = function(a, b, c) {
- this._target = a;
- b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && d.removeTweens(a));
- this.pluginData = c || {};
- this._curQueueProps = {};
- this._initQueueProps = {};
- this._steps = [];
- this._actions = [];
- b && b.paused ? this.paused = !0 : d._register(this, !0);
- b && null != b.position && this.setPosition(b.position, d.NONE)
- };
- b.setPosition = function(a, b) {
- void 0 === b && (b = 1);
- 0 > a && (a = 0);
- var c = a,
- d = !1;
- c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
- if (c == this._prevPos) return d;
- var e = this._prevPos;
- this.position = this._prevPos = c;
- this._prevPosition = a;
- if (this._target) if (d) this._updateTargetProps(null, 1);
- else if (0 < this._steps.length) {
- for (var g = 0,
- h = this._steps.length; g < h && !(this._steps[g].t > c); g++);
- g = this._steps[g - 1];
- this._updateTargetProps(g, (this._stepPosition = c - g.t) / g.d)
- }
- 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
- d && this.setPaused(!0);
- this.dispatchEventWith("change");
- return d
- };
- b._runActions = function(a, b, c) {
- void 0 === c && (c = !1);
- var d = a,
- e = b,
- g = -1,
- h = this._actions.length,
- k = 1;
- a > b && (d = b, e = a, g = h, h = k = -1);
- for (; (g += k) != h;) {
- b = this._actions[g];
- var l = b.t; (l == e || l > d && l < e || c && l == a) && b.f.apply(b.o, b.p)
- }
- };
- b._updateTargetProps = function(a, b) {
- var c, e, g, n;
- if (a || 1 != b) {
- if (this.passive = !!a.v) return;
- a.e && (b = a.e(b, 0, 1, 1));
- c = a.p0;
- e = a.p1
- } else this.passive = !1,
- c = e = this._curQueueProps;
- for (var h in this._initQueueProps) {
- null == (g = c[h]) && (c[h] = g = this._initQueueProps[h]);
- null == (n = e[h]) && (e[h] = n = g);
- g = g == n || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? n: g: g + (n - g) * b;
- var k = !1;
- if (n = d._plugins[h]) for (var l = 0,
- m = n.length; l < m; l++) {
- var p = n[l].tween(this, h, g, c, e, b, !!a && c == e, !a);
- p == d.IGNORE ? k = !0 : g = p
- }
- k || (this._target[h] = g)
- }
- };
- b.setPaused = function(a) {
- this.paused = a;
- d._register(this, !a);
- return this
- };
- b._cloneProps = function(a) {
- var b = {},
- c;
- for (c in a) b[c] = a[c];
- return b
- };
- b._addStep = function(a) {
- 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
- return this
- };
- b._appendQueueProps = function(a) {
- var b, c, e, g, n, h;
- for (h in a) if (void 0 === this._initQueueProps[h]) {
- c = this._target[h];
- if (b = d._plugins[h]) for (e = 0, g = b.length; e < g; e++) c = b[e].init(this, h, c);
- this._initQueueProps[h] = this._curQueueProps[h] = void 0 === c ? null: c
- }
- for (h in a) {
- c = this._curQueueProps[h];
- if (b = d._plugins[h]) for (n = n || {},
- e = 0, g = b.length; e < g; e++) b[e].step && b[e].step(this, h, c, a[h], n);
- this._curQueueProps[h] = a[h]
- }
- n && this._appendQueueProps(n);
- return this._curQueueProps
- };
- b._addAction = function(a) {
- a.t = this.duration;
- this._actions.push(a);
- return this
- };
- b._set = function(a, b) {
- for (var c in a) b[c] = a[c]
- };
- b.wait = function(a, b) {
- if (null == a || 0 >= a) return this;
- var c = this._cloneProps(this._curQueueProps);
- return this._addStep({
- d: a,
- p0: c,
- p1: c,
- v: b
- })
- };
- b.to = function(a, b, c) {
- void 0 === c && (c = void 0);
- if (isNaN(b) || 0 > b) b = 0;
- return this._addStep({
- d: b || 0,
- p0: this._cloneProps(this._curQueueProps),
- e: c,
- p1: this._cloneProps(this._appendQueueProps(a))
- })
- };
- b.call = function(a, b, c) {
- void 0 === b && (b = void 0);
- void 0 === c && (c = void 0);
- return this._addAction({
- f: a,
- p: c ? c: [],
- o: b ? b: this._target
- })
- };
- b.set = function(a, b) {
- void 0 === b && (b = null);
- return this._addAction({
- f: this._set,
- o: this,
- p: [a, b ? b: this._target]
- })
- };
- b.play = function(a) {
- a || (a = this);
- return this.call(a.setPaused, a, [!1])
- };
- b.pause = function(a) {
- a || (a = this);
- return this.call(a.setPaused, a, [!0])
- };
- b.tick = function(a) {
- this.paused || this.setPosition(this._prevPosition + a)
- };
- d.NONE = 0;
- d.LOOP = 1;
- d.REVERSE = 2;
- d._tweens = [];
- d.IGNORE = {};
- d._plugins = {};
- d._inited = !1;
- return d
- } (c.EventDispatcher);
- c.Tween = g;
- g.prototype.__class__ = "egret.Tween"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {
- c.Logger.fatalWithErrorId(1014)
- }
- e.get = function(c) { - 1 > c && (c = -1);
- 1 < c && (c = 1);
- return function(b) {
- return 0 == c ? b: 0 > c ? b * (b * -c + 1 + c) : b * ((2 - b) * c + (1 - c))
- }
- };
- e.getPowIn = function(c) {
- return function(b) {
- return Math.pow(b, c)
- }
- };
- e.getPowOut = function(c) {
- return function(b) {
- return 1 - Math.pow(1 - b, c)
- }
- };
- e.getPowInOut = function(c) {
- return function(b) {
- return 1 > (b *= 2) ? 0.5 * Math.pow(b, c) : 1 - 0.5 * Math.abs(Math.pow(2 - b, c))
- }
- };
- e.sineIn = function(c) {
- return 1 - Math.cos(c * Math.PI / 2)
- };
- e.sineOut = function(c) {
- return Math.sin(c * Math.PI / 2)
- };
- e.sineInOut = function(c) {
- return - 0.5 * (Math.cos(Math.PI * c) - 1)
- };
- e.getBackIn = function(c) {
- return function(b) {
- return b * b * ((c + 1) * b - c)
- }
- };
- e.getBackOut = function(c) {
- return function(b) {
- return--b * b * ((c + 1) * b + c) + 1
- }
- };
- e.getBackInOut = function(c) {
- c *= 1.525;
- return function(b) {
- return 1 > (b *= 2) ? 0.5 * b * b * ((c + 1) * b - c) : 0.5 * ((b -= 2) * b * ((c + 1) * b + c) + 2)
- }
- };
- e.circIn = function(c) {
- return - (Math.sqrt(1 - c * c) - 1)
- };
- e.circOut = function(c) {
- return Math.sqrt(1 - --c * c)
- };
- e.circInOut = function(c) {
- return 1 > (c *= 2) ? -0.5 * (Math.sqrt(1 - c * c) - 1) : 0.5 * (Math.sqrt(1 - (c -= 2) * c) + 1)
- };
- e.bounceIn = function(c) {
- return 1 - e.bounceOut(1 - c)
- };
- e.bounceOut = function(c) {
- return c < 1 / 2.75 ? 7.5625 * c * c: c < 2 / 2.75 ? 7.5625 * (c -= 1.5 / 2.75) * c + 0.75 : c < 2.5 / 2.75 ? 7.5625 * (c -= 2.25 / 2.75) * c + 0.9375 : 7.5625 * (c -= 2.625 / 2.75) * c + 0.984375
- };
- e.bounceInOut = function(c) {
- return 0.5 > c ? 0.5 * e.bounceIn(2 * c) : 0.5 * e.bounceOut(2 * c - 1) + 0.5
- };
- e.getElasticIn = function(c, b) {
- var a = 2 * Math.PI;
- return function(f) {
- if (0 == f || 1 == f) return f;
- var e = b / a * Math.asin(1 / c);
- return - (c * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - e) * a / b))
- }
- };
- e.getElasticOut = function(c, b) {
- var a = 2 * Math.PI;
- return function(f) {
- if (0 == f || 1 == f) return f;
- var e = b / a * Math.asin(1 / c);
- return c * Math.pow(2, -10 * f) * Math.sin((f - e) * a / b) + 1
- }
- };
- e.getElasticInOut = function(c, b) {
- var a = 2 * Math.PI;
- return function(f) {
- var e = b / a * Math.asin(1 / c);
- return 1 > (f *= 2) ? -0.5 * c * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - e) * a / b) : c * Math.pow(2, -10 * (f -= 1)) * Math.sin((f - e) * a / b) * 0.5 + 1
- }
- };
- e.quadIn = e.getPowIn(2);
- e.quadOut = e.getPowOut(2);
- e.quadInOut = e.getPowInOut(2);
- e.cubicIn = e.getPowIn(3);
- e.cubicOut = e.getPowOut(3);
- e.cubicInOut = e.getPowInOut(3);
- e.quartIn = e.getPowIn(4);
- e.quartOut = e.getPowOut(4);
- e.quartInOut = e.getPowInOut(4);
- e.quintIn = e.getPowIn(5);
- e.quintOut = e.getPowOut(5);
- e.quintInOut = e.getPowInOut(5);
- e.backIn = e.getBackIn(1.7);
- e.backOut = e.getBackOut(1.7);
- e.backInOut = e.getBackInOut(1.7);
- e.elasticIn = e.getElasticIn(1, 0.3);
- e.elasticOut = e.getElasticOut(1, 0.3);
- e.elasticInOut = e.getElasticInOut(1, 0.3 * 1.5);
- return e
- } ();
- c.Ease = g;
- g.prototype.__class__ = "egret.Ease"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.path = "";
- this.audio = null;
- this.type = d.EFFECT;
- this._pauseTime = 0;
- this._listeners = []
- }
- __extends(d, e);
- var b = d.prototype;
- Object.defineProperty(b, "position", {
- get: function() {
- return this.audio ? Math.floor(1E3 * this.audio._getCurrentTime()) : 0
- },
- enumerable: !0,
- configurable: !0
- });
- b.play = function(a, b) {
- void 0 === a && (a = !1);
- void 0 === b && (b = 0);
- var c = this.audio;
- c && (c._setCurrentTime(b / 1E3), c._setLoop(a), c._play(this.type))
- };
- b.stop = function() {
- var a = this.audio;
- a && (this._pauseTime = 0, a._setCurrentTime(0), a._pause())
- };
- b.pause = function() {
- var a = this.audio;
- a && (this._pauseTime = a._getCurrentTime(), a._pause())
- };
- b.resume = function() {
- var a = this.audio;
- a && (a._setCurrentTime(this._pauseTime), this._pauseTime = 0, a._play(this.type))
- };
- b.load = function() {
- var a = this.audio;
- a && a._load()
- };
- b.addEventListener = function(a, b, d) {
- e.prototype.addEventListener.call(this, a, b, d);
- var g = this;
- this.audio && 1 == this._eventsMap[a].length && (b = a == c.SoundEvent.SOUND_COMPLETE ?
- function(a) {
- c.Event._dispatchByTarget(c.SoundEvent, g, c.SoundEvent.SOUND_COMPLETE)
- }: function(a) {
- c.Event._dispatchByTarget(c.Event, g, a.type)
- },
- this._listeners.push({
- type: a,
- func: b
- }), a = g.getVirtualType(a), this.audio._addEventListener(a, b, !1))
- };
- b.removeEventListener = function(a, b, c) {
- e.prototype.removeEventListener.call(this, a, b, c);
- if (this.audio && (!this._eventsMap || !this._eventsMap[a] || 0 == this._eventsMap[a].length)) for (c = 0; c < this._listeners.length; c++) if (b = this._listeners[c], b.type == a) {
- this._listeners.splice(c, 1);
- a = this.getVirtualType(a);
- this.audio._removeEventListener(a, b.func, !1);
- break
- }
- };
- b.getVirtualType = function(a) {
- switch (a) {
- case c.SoundEvent.SOUND_COMPLETE:
- return "ended";
- default:
- return a
- }
- };
- Object.defineProperty(b, "volume", {
- get: function() {
- return this.audio ? this.audio._getVolume() : 0
- },
- set: function(a) {
- var b = this.audio;
- b && b._setVolume(Math.max(0, Math.min(a, 1)))
- },
- enumerable: !0,
- configurable: !0
- });
- b.setVolume = function(a) {
- c.Logger.warningWithErrorId(1031);
- this.volume = a
- };
- b.getVolume = function() {
- c.Logger.warningWithErrorId(1032);
- return this.volume
- };
- b.preload = function(a, b, c) {
- void 0 === b && (b = null);
- void 0 === c && (c = null);
- this.type = a;
- this.audio._preload(a, b, c)
- };
- b._setAudio = function(a) {
- this.audio = a
- };
- b.destroy = function() {
- this.audio._destroy()
- };
- d.MUSIC = "music";
- d.EFFECT = "effect";
- return d
- } (c.EventDispatcher);
- c.Sound = g;
- g.prototype.__class__ = "egret.Sound"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function c() {}
- c.isNumber = function(c) {
- return "number" === typeof c && !isNaN(c)
- };
- c.sin = function(d) {
- var b = Math.floor(d),
- a = b + 1,
- f = c.sinInt(b),
- g = c.sinInt(a);
- return (d - b) * g + (a - d) * f
- };
- c.sinInt = function(c) {
- c %= 360;
- 0 > c && (c += 360);
- return 90 > c ? egret_sin_map[c] : 180 > c ? egret_cos_map[c - 90] : 270 > c ? -egret_sin_map[c - 180] : -egret_cos_map[c - 270]
- };
- c.cos = function(d) {
- var b = Math.floor(d),
- a = b + 1,
- f = c.cosInt(b),
- g = c.cosInt(a);
- return (d - b) * g + (a - d) * f
- };
- c.cosInt = function(c) {
- c %= 360;
- 0 > c && (c += 360);
- return 90 > c ? egret_cos_map[c] : 180 > c ? -egret_sin_map[c - 90] : 270 > c ? -egret_cos_map[c - 180] : egret_sin_map[c - 270]
- };
- return c
- } ();
- c.NumberUtils = g;
- g.prototype.__class__ = "egret.NumberUtils"
- })(egret || (egret = {}));
- for (var egret_sin_map = {},
- egret_cos_map = {},
- NumberUtils_i = 0; 90 >= NumberUtils_i; NumberUtils_i++) egret_sin_map[NumberUtils_i] = Math.sin(NumberUtils_i * egret.Matrix.DEG_TO_RAD),
- egret_cos_map[NumberUtils_i] = Math.cos(NumberUtils_i * egret.Matrix.DEG_TO_RAD);
- Function.prototype.bind || (Function.prototype.bind = function(c) {
- if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
- var g = Array.prototype.slice.call(arguments, 1),
- e = this,
- d = function() {},
- b = function() {
- return e.apply(this instanceof d && c ? this: c, g.concat(Array.prototype.slice.call(arguments)))
- };
- d.prototype = this.prototype;
- b.prototype = new d;
- return b
- }); (function(c) {
- var g = function() {
- function e() {
- this.downloadingSizeThisObject = this.downloadingSizeFunc = this.onErrorThisObject = this.onErrorFunc = this.onSuccessThisObject = this.onSuccessFunc = null
- }
- var d = e.prototype;
- e.create = function() {
- return e.promiseObjectList.length ? e.promiseObjectList.pop() : new c.PromiseObject
- };
- d.onSuccess = function() {
- for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
- this.onSuccessFunc && this.onSuccessFunc.apply(this.onSuccessThisObject, b);
- this.destroy()
- };
- d.onError = function() {
- for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
- this.onErrorFunc && this.onErrorFunc.apply(this.onErrorThisObject, b);
- this.destroy()
- };
- d.downloadingSize = function() {
- for (var b = [], a = 0; a < arguments.length; a++) b[a - 0] = arguments[a];
- this.downloadingSizeFunc && this.downloadingSizeFunc.apply(this.downloadingSizeThisObject, b)
- };
- d.destroy = function() {
- this.downloadingSizeThisObject = this.downloadingSizeFunc = this.onErrorThisObject = this.onErrorFunc = this.onSuccessThisObject = this.onSuccessFunc = void 0;
- e.promiseObjectList.push(this)
- };
- e.promiseObjectList = [];
- return e
- } ();
- c.PromiseObject = g;
- g.prototype.__class__ = "egret.PromiseObject"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d(a) {
- void 0 === a && (a = 60);
- e.call(this);
- this.frameRate = a;
- this._time = 0;
- this._requestAnimationId = NaN;
- this._isActivate = !0;
- d.countTime = 0;
- 0 == 60 % a && (d.countTime = 60 / a - 1, d.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, d.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
- d.requestAnimationFrame || (d.requestAnimationFrame = function(b) {
- return window.setTimeout(b, 1E3 / a)
- });
- d.cancelAnimationFrame || (d.cancelAnimationFrame = function(a) {
- return window.clearTimeout(a)
- });
- d.instance = this;
- this.registerListener()
- }
- __extends(d, e);
- var b = d.prototype;
- b.enterFrame = function() {
- var a = d.instance,
- b = d._thisObject,
- e = d._callback,
- g = c.getTimer(),
- s = g - a._time;
- a._requestAnimationId = d.requestAnimationFrame.call(window, d.prototype.enterFrame);
- d.count < d.countTime ? d.count++:(d.count = 0, e.call(b, s), a._time = g)
- };
- b.executeMainLoop = function(a, b) {
- d._callback = a;
- d._thisObject = b;
- this.enterFrame()
- };
- b.reset = function() {
- var a = d.instance;
- a._requestAnimationId && (a._time = c.getTimer(), d.cancelAnimationFrame.call(window, a._requestAnimationId), a.enterFrame())
- };
- b.registerListener = function() {
- var a = this,
- b = function() {
- a._isActivate && (a._isActivate = !1, c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.DEACTIVATE)))
- },
- e = function() {
- a._isActivate || (a._isActivate = !0, d.instance.reset(), c.MainContext.instance.stage.dispatchEvent(new c.Event(c.Event.ACTIVATE)))
- },
- g = function() {
- document[s] ? b() : e()
- };
- window.addEventListener("focus", e, !1);
- window.addEventListener("blur", b, !1);
- var s, n;
- "undefined" !== typeof document.hidden ? (s = "hidden", n = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (s = "mozHidden", n = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (s = "msHidden", n = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (s = "webkitHidden", n = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (s = "oHidden", n = "ovisibilitychange");
- "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", b, !1));
- s && n && document.addEventListener(n, g, !1);
- g = navigator.userAgent;
- n = /micromessenger/gi.test(g);
- var h = /mqq/ig.test(g);
- if (/mobile.*qq/gi.test(g) || n) h = !1;
- h && (g = window.browser || {},
- g.execWebFn = g.execWebFn || {},
- g.execWebFn.postX5GamePlayerMessage = function(a) {
- a = a.type;
- "app_enter_background" == a ? b() : "app_enter_foreground" == a && e()
- },
- window.browser = g)
- };
- d.instance = null;
- d.countTime = 0;
- d.requestAnimationFrame = null;
- d.cancelAnimationFrame = null;
- d._thisObject = null;
- d._callback = null;
- d.count = 0;
- return d
- } (c.DeviceContext);
- c.HTML5DeviceContext = g;
- g.prototype.__class__ = "egret.HTML5DeviceContext"
- })(egret || (egret = {}));
- var egret_html5_localStorage; (function(c) {
- c.getItem = function(c) {
- return window.localStorage.getItem(c)
- };
- c.setItem = function(c, e) {
- try {
- return window.localStorage.setItem(c, e),
- !0
- } catch(d) {
- return egret.Logger.infoWithErrorId(1018, c, e),
- !1
- }
- };
- c.removeItem = function(c) {
- window.localStorage.removeItem(c)
- };
- c.clear = function() {
- window.localStorage.clear()
- };
- c.init = function() {
- for (var g in c) egret.localStorage[g] = c[g]
- }
- })(egret_html5_localStorage || (egret_html5_localStorage = {}));
- egret_html5_localStorage.init(); (function(c) {
- var g = function(e) {
- function d(a, b) {
- void 0 === b && (b = !0);
- e.call(this);
- this.useCacheCanvas = b;
- c.Texture.prototype.draw = c.Texture.prototype._drawForCanvas;
- c.Texture.prototype.dispose = c.Texture.prototype._disposeForCanvas;
- this.canvas = a || this.createCanvas();
- this.canvasContext = this.canvas.getContext("2d");
- b ? (this._cacheCanvas = document.createElement("canvas"), this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height, this.drawCanvasContext = this._cacheCanvasContext = this._cacheCanvas.getContext("2d")) : this.drawCanvasContext = this.canvasContext;
- var d = this.drawCanvasContext;
- if (void 0 == d.imageSmoothingEnabled) {
- for (var g = ["webkitImageSmoothingEnabled", "mozImageSmoothingEnabled", "msImageSmoothingEnabled"], s = 0; s < g.length; s++) {
- var n = g[s];
- if (void 0 != d[n]) break
- }
- Object.defineProperty(d, "imageSmoothingEnabled", {
- get: function() {
- return this[n]
- },
- set: function(a) {
- this[n] = a
- },
- enumerable: !0,
- configurable: !0
- })
- }
- this.onResize();
- var h = this.drawCanvasContext.setTransform,
- k = this;
- this.drawCanvasContext.setTransform = function(a, b, c, f, d, e) {
- k._matrixA = a;
- k._matrixB = b;
- k._matrixC = c;
- k._matrixD = f;
- k._matrixTx = d;
- k._matrixTy = e;
- h.call(k.drawCanvasContext, a, b, c, f, d, e)
- };
- this._matrixA = 1;
- this._matrixC = this._matrixB = 0;
- this._matrixD = 1;
- this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
- this.initBlendMode()
- }
- __extends(d, e);
- var b = d.prototype;
- b.createCanvas = function() {
- var a = c.Browser.getInstance().$("#egretCanvas");
- if (!a) {
- var b = document.getElementById(c.StageDelegate.canvas_div_name),
- a = c.Browser.getInstance().$new("canvas");
- a.id = "egretCanvas";
- b.appendChild(a)
- }
- c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
- return a
- };
- b.onResize = function() {
- if (this.canvas) {
- var a = document.getElementById(c.StageDelegate.canvas_div_name);
- this.canvas.width = c.MainContext.instance.stage.stageWidth;
- this.canvas.height = c.MainContext.instance.stage.stageHeight;
- this.canvas.style.width = a.style.width;
- this.canvas.style.height = a.style.height;
- this.useCacheCanvas && (this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height);
- this.drawCanvasContext.imageSmoothingEnabled = c.RendererContext.imageSmoothingEnabled
- }
- };
- b.clearScreen = function() {
- for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, d = a.length; b < d; b++) {
- var e = a[b];
- this.clearRect(e.x, e.y, e.width, e.height)
- }
- a = c.MainContext.instance.stage;
- this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
- this.renderCost = 0
- };
- b.clearRect = function(a, b, c, d) {
- this.canvasContext.clearRect(a, b, c, d)
- };
- b.drawImage = function(a, b, d, g, s, n, h, k, l, m) {
- void 0 === m && (m = void 0);
- n += this._transformTx;
- h += this._transformTy;
- var p = c.getTimer();
- a.draw(this.drawCanvasContext, b, d, g, s, n, h, k, l, m);
- e.prototype.drawImage.call(this, a, b, d, g, s, n, h, k, l, m);
- this.renderCost += c.getTimer() - p
- };
- b.setTransform = function(a) {
- 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
- };
- b.setAlpha = function(a, b) {
- this.drawCanvasContext.globalAlpha = a;
- b ? (this.blendValue = this.blendModes[b], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = this.blendModes[c.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
- };
- b.initBlendMode = function() {
- this.blendModes = {};
- this.blendModes[c.BlendMode.NORMAL] = "source-over";
- this.blendModes[c.BlendMode.ADD] = "lighter";
- this.blendModes[c.BlendMode.ERASE] = "destination-out";
- this.blendModes[c.BlendMode.ERASE_REVERSE] = "destination-in"
- };
- b.setupFont = function(a, b) {
- void 0 === b && (b = null);
- b = b || {};
- var c = a._TF_Props_,
- d = null == b.size ? c._size: b.size,
- e = null == b.fontFamily ? c._fontFamily: b.fontFamily,
- g = this.drawCanvasContext,
- h = (null == b.italic ? c._italic: b.italic) ? "italic ": "normal ",
- h = h + ((null == b.bold ? c._bold: b.bold) ? "bold ": "normal ");
- g.font = h + (d + "px " + e);
- g.textAlign = "left";
- g.textBaseline = "middle"
- };
- b.measureText = function(a) {
- return this.drawCanvasContext.measureText(a).width
- };
- b.drawText = function(a, b, d, g, s, n) {
- void 0 === n && (n = null);
- this.setupFont(a, n);
- n = n || {};
- var h = a._TF_Props_,
- k;
- k = null != n.textColor ? c.toColorString(n.textColor) : h._textColorString;
- var l;
- l = null != n.strokeColor ? c.toColorString(n.strokeColor) : h._strokeColorString;
- var h = null != n.stroke ? n.stroke: h._stroke,
- m = this.drawCanvasContext;
- m.fillStyle = k;
- m.strokeStyle = l;
- h && (m.lineWidth = 2 * h, m.strokeText(b, d + this._transformTx, g + this._transformTy, s || 65535));
- m.fillText(b, d + this._transformTx, g + this._transformTy, s || 65535);
- e.prototype.drawText.call(this, a, b, d, g, s, n)
- };
- b.strokeRect = function(a, b, c, d, e) {
- this.drawCanvasContext.strokeStyle = e;
- this.drawCanvasContext.strokeRect(a, b, c, d)
- };
- b.pushMask = function(a) {
- this.drawCanvasContext.save();
- this.drawCanvasContext.beginPath();
- this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
- this.drawCanvasContext.clip();
- this.drawCanvasContext.closePath()
- };
- b.popMask = function() {
- this.drawCanvasContext.restore();
- this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
- };
- b.onRenderStart = function() {
- this.drawCanvasContext.save()
- };
- b.onRenderFinish = function() {
- this.drawCanvasContext.restore();
- this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
- if (this.useCacheCanvas) for (var a = this._cacheCanvas.width,
- b = this._cacheCanvas.height,
- d = c.RenderFilter.getInstance().getDrawAreaList(), e = 0, g = d.length; e < g; e++) {
- var n = d[e],
- h = n.x,
- k = n.y,
- l = n.width,
- n = n.height;
- h + l > a && (l = a - h);
- k + n > b && (n = b - k);
- 0 < l && 0 < n && this.canvasContext.drawImage(this._cacheCanvas, h, k, l, n, h, k, l, n)
- }
- };
- b.drawCursor = function(a, b, c, d) {
- this.drawCanvasContext.strokeStyle = "#40a5ff";
- this.drawCanvasContext.lineWidth = 2;
- this.drawCanvasContext.beginPath();
- this.drawCanvasContext.moveTo(Math.round(a + this._transformTx), Math.round(b + this._transformTy));
- this.drawCanvasContext.lineTo(Math.round(c + this._transformTx), Math.round(d + this._transformTy));
- this.drawCanvasContext.closePath();
- this.drawCanvasContext.stroke()
- };
- return d
- } (c.RendererContext);
- c.HTML5CanvasRenderer = g;
- g.prototype.__class__ = "egret.HTML5CanvasRenderer"
- })(egret || (egret = {}));
- egret.RendererContext.createRendererContext = function(c) {
- return new egret.HTML5CanvasRenderer(c, !1)
- };
- egret.Graphics.prototype._beginDraw = function(c) {
- this._renderContext = c.drawCanvasContext;
- var g = c._transformTx;
- c = c._transformTy;
- 0 == g && 0 == c || this._renderContext.translate(g, c)
- };
- egret.Graphics.prototype._endDraw = function(c) {
- this._renderContext = c.drawCanvasContext;
- var g = c._transformTx;
- c = c._transformTy;
- 0 == g && 0 == c || this._renderContext.translate( - g, -c)
- }; (function(c) {
- var g = function(e) {
- function d(a) {
- e.call(this);
- this.glID = this.gl = this.canvas = null;
- this.size = 2E3;
- this.vertices = null;
- this.vertSize = 5;
- this.indices = null;
- this.projectionY = this.projectionX = NaN;
- this.shaderManager = null;
- this.contextLost = !1;
- this.glContextId = 0;
- this.currentBlendMode = "";
- this.currentBaseTexture = null;
- this.currentBatchSize = 0;
- this.worldTransform = null;
- this.worldAlpha = 1;
- this.maskList = [];
- this.maskDataFreeList = [];
- this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints = this.filterType = this.colorTransformMatrix = null;
- this.graphicsStyle = {};
- c.Texture.prototype.dispose = c.Texture.prototype._disposeForCanvas;
- this.canvas = a || this.createCanvas();
- this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
- this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
- this.html5Canvas = document.createElement("canvas");
- this.canvasContext = new c.HTML5CanvasRenderer(this.html5Canvas);
- this.onResize();
- this.projectionX = this.canvas.width / 2;
- this.projectionY = -this.canvas.height / 2;
- a = 6 * this.size;
- this.vertices = new Float32Array(4 * this.size * this.vertSize);
- this.indices = new Uint16Array(a);
- for (var b = 0,
- d = 0; b < a; b += 6, d += 4) this.indices[b + 0] = d + 0,
- this.indices[b + 1] = d + 1,
- this.indices[b + 2] = d + 2,
- this.indices[b + 3] = d + 0,
- this.indices[b + 4] = d + 2,
- this.indices[b + 5] = d + 3;
- this.initWebGL();
- this.shaderManager = new c.WebGLShaderManager(this.gl);
- this.worldTransform = new c.Matrix;
- this.initAll()
- }
- __extends(d, e);
- var b = d.prototype;
- b.onRenderFinish = function() {
- this._drawWebGL()
- };
- d.initWebGLCanvas = function() {
- c.RenderTexture.WebGLCanvas || (c.RenderTexture.WebGLCanvas = document.createElement("canvas"), c.RenderTexture.WebGLCanvas.avaliable = !0, c.RenderTexture.WebGLRenderer = new c.WebGLRenderer(c.RenderTexture.WebGLCanvas), c.RenderTexture.WebGLRenderer.setAlpha(1))
- };
- b.initAll = function() {
- d.isInit || (d.isInit = !0, egret_webgl_graphics.init(), c.TextField.prototype._makeBitmapCache = function() {
- this.renderTexture || (this.renderTexture = new c.RenderTexture);
- var a = this.getBounds(c.Rectangle.identity);
- if (0 == a.width || 0 == a.height) return this._texture_to_render = null,
- !1;
- this._bitmapData || (this._bitmapData = document.createElement("canvas"), this._bitmapData.avaliable = !0, this.renderContext = c.RendererContext.createRendererContext(this._bitmapData));
- var b = this._bitmapData,
- d = a.width,
- a = a.height,
- e, g, n = c.MainContext.instance.rendererContext._texture_scale_factor;
- e = d / n;
- g = a / n;
- e = Math.round(e);
- g = Math.round(g);
- b.width = e;
- b.height = g;
- b.style.width = e + "px";
- b.style.height = g + "px";
- this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e, this.renderContext._cacheCanvas.height = g);
- this._worldTransform.identity();
- this._worldTransform.a = 1 / n;
- this._worldTransform.d = 1 / n;
- this.renderContext.setTransform(this._worldTransform);
- this.worldAlpha = 1;
- b = c.RenderFilter.getInstance();
- n = b._drawAreaList.concat();
- b._drawAreaList.length = 0;
- this.renderContext.clearScreen();
- this.renderContext.onRenderStart();
- c.Texture.deleteWebGLTexture(this.renderTexture);
- this.renderTexture.dispose();
- this._hasFilters() && this._setGlobalFilters(this.renderContext);
- var h = this.mask || this._DO_Props_._scrollRect;
- h && this.renderContext.pushMask(h);
- this._render(this.renderContext);
- h && this.renderContext.popMask();
- this._hasFilters() && this._removeGlobalFilters(this.renderContext);
- c.RenderTexture.identityRectangle.width = e;
- c.RenderTexture.identityRectangle.height = g;
- b.addDrawArea(c.RenderTexture.identityRectangle);
- this.renderContext.onRenderFinish();
- b._drawAreaList = n;
- this.renderTexture._bitmapData = this._bitmapData;
- this.renderTexture._sourceWidth = e;
- this.renderTexture._sourceHeight = g;
- this.renderTexture._textureWidth = d;
- this.renderTexture._textureHeight = a;
- this._texture_to_render = this.renderTexture;
- return ! 0
- },
- c.TextField.prototype._draw = function(a) {
- this._TF_Props_._type == c.TextFieldType.INPUT && this._isTyping || (this.getDirty() && (this._texture_to_render = this.renderTexture, this._DO_Props_._cacheAsBitmap = !0), c.DisplayObject.prototype._draw.call(this, a))
- },
- c.RenderTexture.prototype.init = function() {
- this._bitmapData = document.createElement("canvas");
- this._bitmapData.avaliable = !0;
- this.canvasContext = this._bitmapData.getContext("2d");
- d.initWebGLCanvas();
- this._webglBitmapData = c.RenderTexture.WebGLCanvas;
- this.renderContext = c.RenderTexture.WebGLRenderer
- },
- c.RenderTexture.prototype.setSize = function(a, b) {
- this._webglBitmapData && this.renderContext.setSize(a, b);
- if (this._bitmapData) {
- var c = this._bitmapData;
- c.width = a;
- c.height = b;
- c.style.width = a + "px";
- c.style.height = b + "px"
- }
- },
- c.RenderTexture.prototype.end = function() {},
- c.RenderTexture.prototype.drawToTexture = function(a, b, d) {
- var e = b || a.getBounds(c.Rectangle.identity);
- if (0 == e.width || 0 == e.height) return ! 1;
- "undefined" == typeof d && (d = 1);
- this._bitmapData || this.init();
- var g = e.x,
- n = e.y,
- h = e.width,
- e = e.height,
- e = e / d,
- k = c.MainContext.instance.rendererContext._texture_scale_factor,
- h = Math.round(h / d),
- e = Math.round(e);
- this.setSize(h, e);
- var l = this._bitmapData,
- m = h / k * d,
- p = e / k * d;
- l.width = m;
- l.height = p;
- l.style.width = m + "px";
- l.style.height = p + "px";
- this.begin();
- a._worldTransform.identity();
- l = a._DO_Props_._anchorOffsetX;
- m = a._DO_Props_._anchorOffsetY;
- if (0 != a._DO_Props_._anchorX || 0 != a._DO_Props_._anchorY) l = a._DO_Props_._anchorX * h,
- m = a._DO_Props_._anchorY * e;
- this._offsetX = g + l;
- this._offsetY = n + m;
- a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
- b && (this._offsetX -= g, this._offsetY -= n);
- a.worldAlpha = 1;
- b = c.MainContext.__use_new_draw;
- c.MainContext.__use_new_draw = !1;
- if (a instanceof c.DisplayObjectContainer) for (g = a._children, n = 0, l = g.length; n < l; n++) g[n]._updateTransform();
- this.renderContext.setTransform(a._worldTransform);
- g = c.RenderFilter.getInstance();
- n = g._drawAreaList.concat();
- g._drawAreaList.length = 0;
- l = this.renderContext.gl;
- l.viewport(0, 0, h, e);
- l.bindFramebuffer(l.FRAMEBUFFER, null);
- l.clearColor(0, 0, 0, 0);
- l.clear(l.COLOR_BUFFER_BIT);
- this.renderContext.onRenderStart();
- c.Texture.deleteWebGLTexture(this);
- a._hasFilters() && a._setGlobalFilters(this.renderContext); (l = a.mask || a._DO_Props_._scrollRect) && this.renderContext.pushMask(l);
- a._render(this.renderContext);
- this.renderContext._drawWebGL();
- c.MainContext.__use_new_draw = b;
- l && this.renderContext.popMask();
- a._hasFilters() && a._removeGlobalFilters(this.renderContext);
- c.RenderTexture.identityRectangle.width = h;
- c.RenderTexture.identityRectangle.height = e;
- g.addDrawArea(c.RenderTexture.identityRectangle);
- this.renderContext.onRenderFinish();
- g._drawAreaList = n;
- this._sourceWidth = h / k * d;
- this._sourceHeight = e / k * d;
- this._textureWidth = h * d;
- this._textureHeight = e * d;
- this.canvasContext.drawImage(this._webglBitmapData, 0, 0, h, e, 0, 0, this._sourceWidth, this._sourceHeight);
- return ! 0
- })
- };
- b.createCanvas = function() {
- var a = c.Browser.getInstance().$("#egretCanvas");
- if (!a) {
- var b = document.getElementById(c.StageDelegate.canvas_div_name),
- a = c.Browser.getInstance().$new("canvas");
- a.id = "egretCanvas";
- b.appendChild(a)
- }
- c.MainContext.instance.stage.addEventListener(c.Event.RESIZE, this.onResize, this);
- return a
- };
- b.onResize = function() {
- this.setSize(c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)
- };
- b.setSize = function(a, b) {
- var d = document.getElementById(c.StageDelegate.canvas_div_name);
- this.canvas && (this.canvas.width = a, this.canvas.height = b, this.canvas.style.width = d.style.width, this.canvas.style.height = d.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
- this.html5Canvas && (this.html5Canvas.width = a, this.html5Canvas.height = b, this.html5Canvas.style.width = d.style.width, this.html5Canvas.style.height = d.style.height);
- this.width = a;
- this.height = b
- };
- b.handleContextLost = function() {
- this.contextLost = !0
- };
- b.handleContextRestored = function() {
- this.initWebGL();
- this.shaderManager.setContext(this.gl);
- this.contextLost = !1
- };
- b.initWebGL = function() {
- for (var a = {},
- b, e = ["experimental-webgl", "webgl"], g = 0; g < e.length; g++) {
- try {
- b = this.canvas.getContext(e[g], a)
- } catch(s) {}
- if (b) break
- }
- if (!b) throw Error(c.getString(1021));
- d.glID++;
- this.glID = d.glID;
- this.setContext(b)
- };
- b.setContext = function(a) {
- this.gl = a;
- a.id = this.glContextId++;
- this.vertexBuffer = a.createBuffer();
- this.indexBuffer = a.createBuffer();
- a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
- a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
- a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
- a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
- a.disable(a.DEPTH_TEST);
- a.disable(a.CULL_FACE);
- a.enable(a.BLEND);
- a.colorMask(!0, !0, !0, !0)
- };
- b.start = function() {
- if (!this.contextLost) {
- var a = this.gl;
- a.activeTexture(a.TEXTURE0);
- a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
- a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
- var b;
- b = "colorTransform" == this.filterType ? this.shaderManager.colorTransformShader: "blur" == this.filterType ? this.shaderManager.blurShader: this.shaderManager.defaultShader;
- this.shaderManager.activateShader(b);
- b.syncUniforms();
- a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
- var c = 4 * this.vertSize;
- a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
- a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
- a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
- }
- };
- b.clearScreen = function() {
- var a = this.gl;
- a.colorMask(!0, !0, !0, !0);
- for (var b = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = b.length; d < e; d++) {
- var g = b[d];
- a.viewport(g.x, g.y, g.width, g.height);
- a.bindFramebuffer(a.FRAMEBUFFER, null);
- a.clearColor(0, 0, 0, 0);
- a.clear(a.COLOR_BUFFER_BIT)
- }
- a.viewport(0, 0, this.width, this.height);
- this.renderCost = 0
- };
- b.setBlendMode = function(a) {
- a || (a = c.BlendMode.NORMAL);
- if (this.currentBlendMode != a) {
- var b = c.RendererContext.blendModesForGL[a];
- b && (this._drawWebGL(), this.gl.blendFunc(b[0], b[1]), this.currentBlendMode = a)
- }
- };
- b.drawRepeatImage = function(a, b, d, e, g, n, h, k, l, m) {
- m = c.MainContext.instance.rendererContext._texture_scale_factor;
- e *= m;
- for (g *= m; n < k; n += e) for (var p = h; p < l; p += g) {
- var r = Math.min(e, k - n),
- q = Math.min(g, l - p);
- this.drawImage(a, b, d, r / m, q / m, n, p, r, q)
- }
- };
- b.drawImage = function(a, b, c, d, e, g, h, k, l, m) {
- void 0 === m && (m = void 0);
- if (!this.contextLost) {
- var p = a._bitmapData;
- if (p && p.avaliable) if (void 0 !== m) this.drawRepeatImage(a, b, c, d, e, g, h, k, l, m);
- else {
- if (this.filters) for (m = 0; 1 > m; m++) if ("glow" == this.filters[0].type) {
- this.useGlow(a, b, c, d, e, g, h, k, l);
- return
- }
- this._drawImage(a, b, c, d, e, g, h, k, l)
- }
- }
- };
- b._drawImage = function(a, b, c, d, e, g, h, k, l) {
- this.createWebGLTexture(a);
- var m = a._bitmapData.webGLTexture[this.glID];
- if (m !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._drawWebGL(),
- this.currentBaseTexture = m;
- var p = this.worldTransform,
- r = p.a,
- q = p.b,
- x = p.c,
- z = p.d,
- u = p.tx,
- y = p.ty;
- 0 == g && 0 == h || p.append(1, 0, 0, 1, g, h);
- 1 == d / k && 1 == e / l || p.append(k / d, 0, 0, l / e, 0, 0);
- g = p.a;
- h = p.b;
- k = p.c;
- l = p.d;
- var m = p.tx,
- w = p.ty;
- p.a = r;
- p.b = q;
- p.c = x;
- p.d = z;
- p.tx = u;
- p.ty = y;
- r = a._sourceWidth;
- q = a._sourceHeight;
- a = d;
- p = e;
- b /= r;
- c /= q;
- d /= r;
- e /= q;
- r = this.vertices;
- q = 4 * this.currentBatchSize * this.vertSize;
- x = this.worldAlpha;
- r[q++] = m;
- r[q++] = w;
- r[q++] = b;
- r[q++] = c;
- r[q++] = x;
- r[q++] = g * a + m;
- r[q++] = h * a + w;
- r[q++] = d + b;
- r[q++] = c;
- r[q++] = x;
- r[q++] = g * a + k * p + m;
- r[q++] = l * p + h * a + w;
- r[q++] = d + b;
- r[q++] = e + c;
- r[q++] = x;
- r[q++] = k * p + m;
- r[q++] = l * p + w;
- r[q++] = b;
- r[q++] = e + c;
- r[q++] = x;
- this.currentBatchSize++
- };
- b.useGlow = function(a, b, e, g, s, n, h, k, l) {
- var m = this.filters[0],
- p = m.distance || 0,
- r = m.angle || 0,
- q = 0,
- x = 0;
- 0 != p && 0 != r && (q = Math.ceil(p * c.NumberUtils.cos(r)), x = Math.ceil(p * c.NumberUtils.sin(r)));
- var p = m.quality,
- r = m.blurX / 10,
- z = m.blurY / 10,
- u = k + 2 * r + 20 + Math.abs(q),
- y = l + 2 * z + 20 + Math.abs(x);
- d.initWebGLCanvas();
- var w = c.RenderTexture.WebGLRenderer,
- B = c.RenderTexture.WebGLCanvas,
- A = c.RenderTexture.create();
- A._bitmapData || A.init();
- A.setSize(u, y);
- A._sourceWidth = u;
- A._sourceHeight = y;
- var C = c.RenderTexture.create();
- C._bitmapData || C.init();
- C.setSize(u, y);
- C._sourceWidth = u;
- C._sourceHeight = y;
- w.clearScreen();
- w.filterType = "colorTransform";
- w.setGlobalColorTransform([0, 0, 0, 0, m._red, 0, 0, 0, 0, m._green, 0, 0, 0, 0, m._blue, 0, 0, 0, 0, 255 * m.alpha]);
- w.setAlpha(1, c.BlendMode.NORMAL);
- w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
- w.drawImage(a, b, e, g, s, r + 10, z + 10, k, l);
- w._drawWebGL();
- w.filterType = null;
- A.canvasContext.clearRect(0, 0, u, y);
- A.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
- w.clearScreen();
- w.setAlpha(1, c.BlendMode.NORMAL);
- w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
- w.filterType = "blur";
- w.setBlurData(r, 0);
- c.Texture.deleteWebGLTexture(A);
- w.drawImage(A, r, z, u - 2 * r, y - 2 * z, r, z, u - 2 * r, y - 2 * z);
- w._drawWebGL();
- w.filterType = null;
- C.canvasContext.clearRect(0, 0, u, y);
- C.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
- w.clearScreen();
- w.setAlpha(1, c.BlendMode.NORMAL);
- w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
- w.filterType = "blur";
- w.setBlurData(0, z);
- c.Texture.deleteWebGLTexture(C);
- w.drawImage(C, 0, z, u, y - 2 * z, 0, z + 5, u, y - 2 * z);
- w._drawWebGL();
- w.filterType = null;
- A.canvasContext.clearRect(0, 0, u, y);
- A.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
- w.clearScreen();
- w.setAlpha(1, c.BlendMode.NORMAL);
- w.setTransform(new c.Matrix(1, 0, 0, 1, 0, 0));
- c.Texture.deleteWebGLTexture(A);
- for (m = 0; m < p; m++) w.drawImage(A, 0, 0, u, y, q, x, u, y);
- w._drawWebGL();
- w.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);
- w.currentBlendMode = null;
- w.drawImage(a, b, e, g, s, n + r + 10, h + z + 15, k, l);
- w._drawWebGL();
- C.canvasContext.clearRect(0, 0, u, y);
- C.canvasContext.drawImage(B, 0, 0, u, y, 0, 0, u, y);
- c.Texture.deleteWebGLTexture(C);
- this._drawImage(C, 0, 0, u, y, n - r - 10, h - z - 15, u, y);
- this._drawWebGL();
- c.RenderTexture.release(A);
- c.RenderTexture.release(C)
- };
- b._drawWebGL = function() {
- if (0 != this.currentBatchSize && !this.contextLost) {
- var a = c.getTimer();
- this.start();
- var b = this.gl;
- b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
- var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
- b.bufferSubData(b.ARRAY_BUFFER, 0, d);
- b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
- this.currentBatchSize = 0;
- this.renderCost += c.getTimer() - a;
- c.Profiler.getInstance().onDrawImage()
- }
- };
- b.setTransform = function(a) {
- var b = this.worldTransform;
- b.a = a.a;
- b.b = a.b;
- b.c = a.c;
- b.d = a.d;
- b.tx = a.tx;
- b.ty = a.ty
- };
- b.setAlpha = function(a, b) {
- this.worldAlpha = a;
- this.setBlendMode(b)
- };
- b.createWebGLTexture = function(a) {
- a = a._bitmapData;
- a.webGLTexture || (a.webGLTexture = {});
- if (!a.webGLTexture[this.glID]) {
- var b = this.gl;
- a.webGLTexture[this.glID] = b.createTexture();
- a.webGLTexture[this.glID].glContext = b;
- b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
- b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
- b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
- b.bindTexture(b.TEXTURE_2D, null)
- }
- };
- b.pushMask = function(a) {
- this._drawWebGL();
- var b = this.gl;
- 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
- a = this.getScissorRect(a);
- this.maskList.push(a);
- this.scissor(a.x, a.y, a.width, a.height)
- };
- b.getScissorRect = function(a) {
- var b = this.maskList[this.maskList.length - 1],
- d,
- e,
- g;
- b ? b.intersects(b) ? (d = Math.max(a.x + this.worldTransform.tx, b.x), e = Math.max(a.y + this.worldTransform.ty, b.y), g = Math.min(a.x + this.worldTransform.tx + a.width, b.x + b.width) - d, a = Math.min(a.y + this.worldTransform.ty + a.height, b.y + b.height) - e) : a = g = e = d = 0 : (d = a.x + this.worldTransform.tx, e = a.y + this.worldTransform.ty, g = a.width, a = a.height); (b = this.maskDataFreeList.pop()) ? (b.x = d, b.y = e, b.width = g, b.height = a) : b = new c.Rectangle(d, e, g, a);
- return b
- };
- b.popMask = function() {
- this._drawWebGL();
- var a = this.gl,
- b = this.maskList.pop();
- this.maskDataFreeList.push(b);
- b = this.maskList.length;
- 0 != b ? (b = this.maskList[b - 1], (0 < b.width || 0 < b.height) && this.scissor(b.x, b.y, b.width, b.height)) : a.disable(a.SCISSOR_TEST)
- };
- b.scissor = function(a, b, d, e) {
- var g = this.gl;
- 0 > d && (d = 0);
- 0 > e && (e = 0);
- g.scissor(a, -b + c.MainContext.instance.stage.stageHeight - e, d, e)
- };
- b.setGlobalColorTransform = function(a) {
- if (this.colorTransformMatrix != a && (this._drawWebGL(), this.colorTransformMatrix = a)) {
- a = a.concat();
- var b = this.shaderManager.colorTransformShader;
- b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
- b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
- b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
- b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
- b.uniforms.matrix.value = a
- }
- };
- b.setBlurData = function(a, b) {
- var c = this.shaderManager.blurShader;
- c.uniforms.blur.value.x = a;
- c.uniforms.blur.value.y = b
- };
- b.setGlobalFilters = function(a) {
- this._drawWebGL();
- this.setFilterProperties(a)
- };
- b.setFilterProperties = function(a) {
- if ((this.filters = a) && a.length) for (var b = 0; 1 > b; b++) {
- var c = a[b];
- this.filterType = c.type;
- switch (c.type) {
- case "blur":
- this.setBlurData(c.blurX, c.blurY);
- break;
- case "colorTransform":
- this.setGlobalColorTransform(c._matrix)
- }
- } else this.filterType = null
- };
- b.setupFont = function(a, b) {
- void 0 === b && (b = null);
- this.canvasContext.setupFont(a, b)
- };
- b.measureText = function(a) {
- return this.canvasContext.measureText(a)
- };
- b.renderGraphics = function(a) {
- this._drawWebGL();
- var b = this.gl,
- c = this.shaderManager.primitiveShader;
- this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
- this.updateGraphics(a);
- this.shaderManager.activateShader(c);
- b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
- b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
- b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
- b.uniform2f(c.offsetVector, 0, 0);
- b.uniform3fv(c.tintColor, [1, 1, 1]);
- b.uniform1f(c.alpha, this.worldAlpha);
- b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
- b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
- b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
- b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
- b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
- this.shaderManager.activateShader(this.shaderManager.defaultShader)
- };
- b.updateGraphics = function(a) {
- var b = this.gl;
- this.buildRectangle(a);
- b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
- b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
- b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
- b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
- };
- b.buildRectangle = function(a) {
- var b = a.x,
- c = a.y,
- d = a.w;
- a = a.h;
- var e = this.graphicsStyle.a,
- g = this.graphicsStyle.r * e,
- h = this.graphicsStyle.g * e,
- k = this.graphicsStyle.b * e,
- l = this.graphicsPoints,
- m = this.graphicsIndices,
- p = l.length / 6;
- l.push(b, c);
- l.push(g, h, k, e);
- l.push(b + d, c);
- l.push(g, h, k, e);
- l.push(b, c + a);
- l.push(g, h, k, e);
- l.push(b + d, c + a);
- l.push(g, h, k, e);
- m.push(p, p, p + 1, p + 2, p + 3, p + 3)
- };
- b.setGraphicsStyle = function(a, b, c, d) {
- this.graphicsStyle.r = a;
- this.graphicsStyle.g = b;
- this.graphicsStyle.b = c;
- this.graphicsStyle.a = d
- };
- d.glID = 0;
- d.isInit = !1;
- return d
- } (c.RendererContext);
- c.WebGLRenderer = g;
- g.prototype.__class__ = "egret.WebGLRenderer"
- })(egret || (egret = {}));
- var egret_webgl_graphics; (function(c) {
- c.beginFill = function(c, d) {
- void 0 === d && (d = 1);
- this._pushCommand(new g(this._setStyle, this, [(c >> 16) / 255, ((c & 65280) >> 8) / 255, (c & 255) / 255, d]))
- };
- c.drawRect = function(c, d, b, a) {
- this._pushCommand(new g(function(a) {
- this.renderContext.renderGraphics(a)
- },
- this, [{
- x: c,
- y: d,
- w: b,
- h: a
- }]));
- this._checkRect(c, d, b, a)
- };
- c.drawCircle = function(c, d, b) {};
- c.drawRoundRect = function(c, d, b, a, f, g) {};
- c.drawEllipse = function(c, d, b, a) {};
- c.lineStyle = function(c, d, b, a, f, g, t, s) {};
- c.lineTo = function(c, d) {};
- c.curveTo = function(c, d, b, a) {};
- c.cubicCurveTo = function(c, d, b, a, f, g) {};
- c.moveTo = function(c, d) {};
- c.clear = function() {
- this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
- };
- c.endFill = function() {};
- c._pushCommand = function(c) {
- this.commandQueue.push(c)
- };
- c._draw = function(c) {
- var d = this.commandQueue.length;
- if (0 != d) for (this.renderContext = c, c = 0; c < d; c++) {
- var b = this.commandQueue[c];
- b.method.apply(b.thisObject, b.args)
- }
- };
- var g = function() {
- return function(c, d, b) {
- this.method = c;
- this.thisObject = d;
- this.args = b
- }
- } ();
- g.prototype.__class__ = "egret_webgl_graphics.Command";
- c._setStyle = function(c, d, b, a) {
- this.renderContext.setGraphicsStyle(c, d, b, a)
- };
- c.init = function() {
- for (var e in c) egret.Graphics.prototype[e] = c[e]
- }
- })(egret_webgl_graphics || (egret_webgl_graphics = {})); (function(c) {
- var g = function() {
- function e() {}
- e.compileProgram = function(d, b, a) {
- a = e.compileFragmentShader(d, a);
- b = e.compileVertexShader(d, b);
- var f = d.createProgram();
- d.attachShader(f, b);
- d.attachShader(f, a);
- d.linkProgram(f);
- d.getProgramParameter(f, d.LINK_STATUS) || c.Logger.infoWithErrorId(1020);
- return f
- };
- e.compileFragmentShader = function(c, b) {
- return e._compileShader(c, b, c.FRAGMENT_SHADER)
- };
- e.compileVertexShader = function(c, b) {
- return e._compileShader(c, b, c.VERTEX_SHADER)
- };
- e._compileShader = function(d, b, a) {
- a = d.createShader(a);
- d.shaderSource(a, b);
- d.compileShader(a);
- return d.getShaderParameter(a, d.COMPILE_STATUS) ? a: (c.Logger.info(d.getShaderInfoLog(a)), null)
- };
- e.checkCanUseWebGL = function() {
- if (void 0 == e.canUseWebGL) try {
- var c = document.createElement("canvas");
- e.canUseWebGL = !!window.WebGLRenderingContext && !(!c.getContext("webgl") && !c.getContext("experimental-webgl"))
- } catch(b) {
- e.canUseWebGL = !1
- }
- return e.canUseWebGL
- };
- return e
- } ();
- c.WebGLUtils = g;
- g.prototype.__class__ = "egret.WebGLUtils"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e(b) {
- 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}";
- this.program = this.gl = null;
- this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
- this.uniforms = null;
- this.gl = b;
- this.init()
- }
- var d = e.prototype;
- d.init = function() {
- var b = this.gl,
- a = c.WebGLUtils.compileProgram(b, this.defaultVertexSrc, this.fragmentSrc);
- b.useProgram(a);
- this.uSampler = b.getUniformLocation(a, "uSampler");
- this.projectionVector = b.getUniformLocation(a, "projectionVector");
- this.offsetVector = b.getUniformLocation(a, "offsetVector");
- this.dimensions = b.getUniformLocation(a, "dimensions");
- this.aVertexPosition = b.getAttribLocation(a, "aVertexPosition");
- this.aTextureCoord = b.getAttribLocation(a, "aTextureCoord");
- this.colorAttribute = b.getAttribLocation(a, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
- this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
- for (var d in this.uniforms) this.uniforms[d].uniformLocation = b.getUniformLocation(a, d);
- this.initUniforms();
- this.program = a
- };
- d.initUniforms = function() {
- if (this.uniforms) {
- var b = this.gl,
- a, c;
- for (c in this.uniforms) {
- a = this.uniforms[c];
- var d = a.type;
- "mat2" === d || "mat3" === d || "mat4" === d ? (a.glMatrix = !0, a.glValueLength = 1, "mat2" === d ? a.glFunc = b.uniformMatrix2fv: "mat3" === d ? a.glFunc = b.uniformMatrix3fv: "mat4" === d && (a.glFunc = b.uniformMatrix4fv)) : (a.glFunc = b["uniform" + d], a.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
- }
- }
- };
- d.syncUniforms = function() {
- if (this.uniforms) {
- var b, a = this.gl,
- c;
- for (c in this.uniforms) b = this.uniforms[c],
- 1 === b.glValueLength ? !0 === b.glMatrix ? b.glFunc.call(a, b.uniformLocation, b.transpose, b.value) : b.glFunc.call(a, b.uniformLocation, b.value) : 2 === b.glValueLength ? b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y) : 3 === b.glValueLength ? b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y, b.value.z) : 4 === b.glValueLength && b.glFunc.call(a, b.uniformLocation, b.value.x, b.value.y, b.value.z, b.value.w)
- }
- };
- return e
- } ();
- c.EgretShader = g;
- g.prototype.__class__ = "egret.EgretShader"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b) {
- c.call(this, b);
- this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 texColor = texture2D(uSampler, vTextureCoord);\nvec4 locColor = texColor * matrix;\nif(texColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = vec4(locColor.rgb*locColor.a,locColor.a);\n}";
- this.uniforms = {
- matrix: {
- type: "mat4",
- value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
- },
- colorAdd: {
- type: "4f",
- value: {
- x: 0,
- y: 0,
- z: 0,
- w: 0
- }
- }
- };
- this.init()
- }
- __extends(d, c);
- return d
- } (c.EgretShader);
- c.ColorTransformShader = g;
- g.prototype.__class__ = "egret.ColorTransformShader"
- })(egret || (egret = {})); (function(c) {
- var g = function(c) {
- function d(b) {
- c.call(this, b);
- this.fragmentSrc = "precision mediump float;uniform vec2 blur;uniform sampler2D uSampler;varying vec2 vTextureCoord;void main(){gl_FragColor = vec4(0.0);gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.028 * blur.x, -0.028 * blur.y))) * 0.0044299121055113265;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.024 * blur.x, -0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.020 * blur.x, -0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.016 * blur.x, -0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.012 * blur.x, -0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.008 * blur.x, -0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.004 * blur.x, -0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, vTextureCoord) * 0.159576912161;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.004 * blur.x, 0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.008 * blur.x, 0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.012 * blur.x, 0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.016 * blur.x, 0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.020 * blur.x, 0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.024 * blur.x, 0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.028 * blur.x, 0.028 * blur.y))) * 0.0044299121055113265;}";
- this.uniforms = {
- blur: {
- type: "2f",
- value: {
- x: 2,
- y: 2
- }
- }
- };
- this.init()
- }
- __extends(d, c);
- return d
- } (c.EgretShader);
- c.BlurShader = g;
- g.prototype.__class__ = "egret.BlurShader"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e(c) {
- this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
- this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
- 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}";
- this.gl = c;
- this.init()
- }
- e.prototype.init = function() {
- var d = this.gl,
- b = c.WebGLUtils.compileProgram(d, this.vertexSrc, this.fragmentSrc);
- d.useProgram(b);
- this.projectionVector = d.getUniformLocation(b, "projectionVector");
- this.offsetVector = d.getUniformLocation(b, "offsetVector");
- this.tintColor = d.getUniformLocation(b, "tint");
- this.aVertexPosition = d.getAttribLocation(b, "aVertexPosition");
- this.colorAttribute = d.getAttribLocation(b, "aColor");
- this.attributes = [this.aVertexPosition, this.colorAttribute];
- this.translationMatrix = d.getUniformLocation(b, "translationMatrix");
- this.alpha = d.getUniformLocation(b, "alpha");
- this.program = b
- };
- return e
- } ();
- c.PrimitiveShader = g;
- g.prototype.__class__ = "egret.PrimitiveShader"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e(b) {
- this.gl = null;
- this.maxAttibs = 10;
- this.attribState = [];
- this.tempAttribState = [];
- this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
- for (var a = 0; a < this.maxAttibs; a++) this.attribState[a] = !1;
- this.setContext(b)
- }
- var d = e.prototype;
- d.setContext = function(b) {
- this.gl = b;
- this.primitiveShader = new c.PrimitiveShader(b);
- this.defaultShader = new c.EgretShader(b);
- this.colorTransformShader = new c.ColorTransformShader(b);
- this.blurShader = new c.BlurShader(b);
- this.activateShader(this.defaultShader)
- };
- d.activateShader = function(b) {
- this.currentShader != b && (this.gl.useProgram(b.program), this.setAttribs(b.attributes), this.currentShader = b)
- };
- d.setAttribs = function(b) {
- var a, c;
- c = this.tempAttribState.length;
- for (a = 0; a < c; a++) this.tempAttribState[a] = !1;
- c = b.length;
- for (a = 0; a < c; a++) this.tempAttribState[b[a]] = !0;
- b = this.gl;
- c = this.attribState.length;
- for (a = 0; a < c; a++) this.attribState[a] !== this.tempAttribState[a] && (this.attribState[a] = this.tempAttribState[a], this.tempAttribState[a] ? b.enableVertexAttribArray(a) : b.disableVertexAttribArray(a))
- };
- return e
- } ();
- c.WebGLShaderManager = g;
- g.prototype.__class__ = "egret.WebGLShaderManager"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- c.Texture.createBitmapData = c.Texture._createBitmapDataForCanvasAndWebGl
- }
- __extends(d, e);
- var b = d.prototype;
- b.initVersion = function(a) {
- this._versionCtr = a
- };
- b.proceed = function(a) {
- function b() {
- if (4 == e.readyState) if (e.status != a._status && (a._status = e.status, c.HTTPStatusEvent.dispatchHTTPStatusEvent(a, e.status)), 400 <= e.status || 0 == e.status) c.IOErrorEvent.dispatchIOErrorEvent(a);
- else {
- switch (a.dataFormat) {
- case c.URLLoaderDataFormat.TEXT:
- a.data = e.responseText;
- break;
- case c.URLLoaderDataFormat.VARIABLES:
- a.data = new c.URLVariables(e.responseText);
- break;
- case c.URLLoaderDataFormat.BINARY:
- a.data = e.response;
- break;
- default:
- a.data = e.responseText
- }
- c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
- }
- }
- if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
- else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) c.Html5Capatibility._audioType == c.AudioType.WEB_AUDIO ? this.loadWebAudio(a) : c.Html5Capatibility._audioType == c.AudioType.QQ_AUDIO ? this.loadQQAudio(a) : this.loadSound(a);
- else {
- var d = a._request,
- e = this.getXHR();
- e.onreadystatechange = b;
- var g = this.getVirtualUrl(c.NetContext._getUrl(d));
- e.open(d.method, g, !0);
- this.setResponseType(e, a.dataFormat);
- d.method != c.URLRequestMethod.GET && d.data ? d.data instanceof c.URLVariables ? (e.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), e.send(d.data.toString())) : (e.setRequestHeader("Content-Type", "multipart/form-data"), e.send(d.data)) : e.send()
- }
- };
- b.loadSound = function(a) {
- function b(e) {
- c.clearTimeout(g.__timeoutId);
- g.removeEventListener("canplaythrough", b, !1);
- g.removeEventListener("error", d, !1);
- e = new c.Html5Audio;
- e._setAudio(g);
- var h = new c.Sound;
- h._setAudio(e);
- a.data = h;
- c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
- }
- function d(e) {
- c.clearTimeout(g.__timeoutId);
- g.removeEventListener("canplaythrough", b, !1);
- g.removeEventListener("error", d, !1);
- c.IOErrorEvent.dispatchIOErrorEvent(a)
- }
- var e = this.getVirtualUrl(a._request.url),
- g = new Audio(e);
- g.__timeoutId = c.setTimeout(b, this, 100);
- g.addEventListener("canplaythrough", b, !1);
- g.addEventListener("error", d, !1);
- g.load()
- };
- b.loadQQAudio = function(a) {
- var b = c.Html5Capatibility._QQRootPath + this.getVirtualUrl(a._request.url);
- console.log("loadQQAudio");
- QZAppExternal.preloadSound(function(d) {
- if (0 == d.code) {
- d = new c.QQAudio;
- d._setPath(b);
- var e = new c.Sound;
- e._setAudio(d);
- a.data = e;
- c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
- } else c.IOErrorEvent.dispatchIOErrorEvent(a)
- },
- {
- bid: -1,
- url: b,
- refresh: 1
- })
- };
- b.loadWebAudio = function(a) {
- var b = this.getVirtualUrl(a._request.url),
- d = new XMLHttpRequest;
- d.open("GET", b, !0);
- d.responseType = "arraybuffer";
- console.log("loadWebAudio");
- d.onload = function() {
- var b = new c.WebAudio;
- b._setArrayBuffer(d.response,
- function() {
- var d = new c.Sound;
- d._setAudio(b);
- a.data = d;
- c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
- })
- };
- d.send()
- };
- b.getXHR = function() {
- return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
- };
- b.setResponseType = function(a, b) {
- switch (b) {
- case c.URLLoaderDataFormat.TEXT:
- case c.URLLoaderDataFormat.VARIABLES:
- a.responseType = c.URLLoaderDataFormat.TEXT;
- break;
- case c.URLLoaderDataFormat.BINARY:
- a.responseType = "arraybuffer";
- break;
- default:
- a.responseType = b
- }
- };
- b.loadTexture = function(a) {
- var b = this.getVirtualUrl(a._request.url);
- c.Texture.createBitmapData(b,
- function(b, d) {
- if (0 != b) c.IOErrorEvent.dispatchIOErrorEvent(a);
- else {
- var f = new c.Texture;
- f._setBitmapData(d);
- a.data = f;
- c.__callAsync(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
- }
- })
- };
- b.getVirtualUrl = function(a) {
- return this._versionCtr ? this._versionCtr.getVirtualUrl(a) : a
- };
- return d
- } (c.NetContext);
- c.HTML5NetContext = g;
- g.prototype.__class__ = "egret.HTML5NetContext"
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this._isTouchDown = !1;
- this.rootDiv = null;
- this.rootDiv = document.getElementById(c.StageDelegate.canvas_div_name);
- if (!this.rootDiv) {
- var a = document.getElementById(c.StageDelegate.egret_root_div);
- this.rootDiv = c.Browser.getInstance().$new("div");
- this.rootDiv.id = c.StageDelegate.canvas_div_name;
- a.appendChild(this.rootDiv)
- }
- }
- __extends(d, e);
- var b = d.prototype;
- b.prevent = function(a) {
- a.stopPropagation(); ! 0 == a.isScroll || c.HTMLInput.getInstance().isInputOn() || a.preventDefault()
- };
- b.run = function() {
- var a = this;
- window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown",
- function(b) {
- a._onTouchBegin(b);
- a.prevent(b)
- },
- !1), this.rootDiv.addEventListener("MSPointerMove",
- function(b) {
- a._onTouchMove(b);
- a.prevent(b)
- },
- !1), this.rootDiv.addEventListener("MSPointerUp",
- function(b) {
- a._onTouchEnd(b);
- a.prevent(b)
- },
- !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
- window.addEventListener("mousedown",
- function(b) {
- a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
- });
- window.addEventListener("mouseup",
- function(b) {
- a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
- a._isTouchDown = !1
- })
- };
- b.addMouseListener = function() {
- var a = this;
- this.rootDiv.addEventListener("mousedown",
- function(b) {
- a._onTouchBegin(b)
- });
- this.rootDiv.addEventListener("mousemove",
- function(b) {
- a._onTouchMove(b)
- });
- this.rootDiv.addEventListener("mouseup",
- function(b) {
- a._onTouchEnd(b)
- })
- };
- b.addTouchListener = function() {
- var a = this;
- this.rootDiv.addEventListener("touchstart",
- function(b) {
- for (var c = b.changedTouches.length,
- d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
- a.prevent(b)
- },
- !1);
- this.rootDiv.addEventListener("touchmove",
- function(b) {
- for (var c = b.changedTouches.length,
- d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
- a.prevent(b)
- },
- !1);
- this.rootDiv.addEventListener("touchend",
- function(b) {
- for (var c = b.changedTouches.length,
- d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
- a.prevent(b)
- },
- !1);
- this.rootDiv.addEventListener("touchcancel",
- function(b) {
- for (var c = b.changedTouches.length,
- d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
- a.prevent(b)
- },
- !1)
- };
- b.inOutOfCanvas = function(a) {
- var b = this.getLocation(this.rootDiv, a);
- a = b.x;
- var b = b.y,
- d = c.MainContext.instance.stage;
- return 0 > a || 0 > b || a > d.stageWidth || b > d.stageHeight ? !0 : !1
- };
- b.dispatchLeaveStageEvent = function() {
- this.touchingIdentifiers.length = 0;
- c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
- };
- b._onTouchBegin = function(a) {
- var b = this.getLocation(this.rootDiv, a),
- c = -1;
- a.hasOwnProperty("identifier") && (c = a.identifier);
- this.onTouchBegan(b.x, b.y, c)
- };
- b._onTouchMove = function(a) {
- var b = this.getLocation(this.rootDiv, a),
- c = -1;
- a.hasOwnProperty("identifier") && (c = a.identifier);
- this.onTouchMove(b.x, b.y, c)
- };
- b._onTouchEnd = function(a) {
- var b = this.getLocation(this.rootDiv, a),
- c = -1;
- a.hasOwnProperty("identifier") && (c = a.identifier);
- this.onTouchEnd(b.x, b.y, c)
- };
- b.getLocation = function(a, b) {
- var d = document.documentElement,
- e = window,
- g, n;
- "function" === typeof a.getBoundingClientRect ? (n = a.getBoundingClientRect(), g = n.left, n = n.top) : n = g = 0;
- g += e.pageXOffset - d.clientLeft;
- n += e.pageYOffset - d.clientTop;
- null != b.pageX ? (d = b.pageX, e = b.pageY) : (g -= document.body.scrollLeft, n -= document.body.scrollTop, d = b.clientX, e = b.clientY);
- var h = c.Point.identity;
- h.x = (d - g) / c.StageDelegate.getInstance().getScaleX();
- h.y = (e - n) / c.StageDelegate.getInstance().getScaleY();
- return h
- };
- return d
- } (c.TouchContext);
- c.HTML5TouchContext = g;
- g.prototype.__class__ = "egret.HTML5TouchContext"
- })(egret || (egret = {})); (function(c) {
- var g = function(d) {
- function b() {
- d.call(this);
- this._isNeedShow = !1;
- this.inputDiv = this.inputElement = null;
- this._gscaleY = this._gscaleX = 0;
- this._isNeesHide = !1;
- this.textValue = "";
- this._styleInfoes = {};
- e.getInstance()
- }
- __extends(b, d);
- var a = b.prototype;
- a._initElement = function(a, b, d, e) {
- var g = c.StageDelegate.getInstance().getScaleX(),
- h = c.StageDelegate.getInstance().getScaleY();
- this.inputDiv.style.left = a * g + "px";
- this.inputDiv.style.top = b * h + "px";
- this._gscaleX = g * d;
- this._gscaleY = h * e
- };
- a._show = function(a, b, c, d) {
- this._multiline = a;
- e.getInstance().isCurrentStageText(this) ? this.inputElement.onblur = null: (this.inputElement = e.getInstance().getInputElement(this), this.inputDiv = e.getInstance()._inputDIV);
- this._isNeedShow = e.getInstance()._needShow = !0
- };
- a.onBlurHandler = function() {
- e.getInstance().clearInputElement();
- window.scrollTo(0, 0)
- };
- a.executeShow = function() {
- this.inputElement.value = this._getText();
- null == this.inputElement.onblur && (this.inputElement.onblur = this.onBlurHandler);
- this._resetStageText();
- 0 < this._textfield._TF_Props_._maxChars ? this.inputElement.setAttribute("maxlength", this._textfield._TF_Props_._maxChars) : this.inputElement.removeAttribute("maxlength");
- this.inputElement.selectionStart = this.inputElement.value.length;
- this.inputElement.selectionEnd = this.inputElement.value.length;
- this.inputElement.focus()
- };
- a._hide = function() {
- this._isNeesHide = !0;
- 0 <= c.Browser.getInstance().getUserAgent().indexOf("ios") && e.getInstance().disconnectStageText(this)
- };
- a._getText = function() {
- this.textValue || (this.textValue = "");
- return this.textValue
- };
- a._setText = function(a) {
- this.textValue = a;
- this.resetText()
- };
- a.resetText = function() {
- this.inputElement && (this.inputElement.value = this.textValue)
- };
- a._onInput = function() {
- this.textValue = this.inputElement.value;
- c.Event.dispatchEvent(this, "updateText", !1)
- };
- a._onClickHandler = function(a) {
- this._isNeedShow && (a.stopImmediatePropagation(), this._isNeedShow = !1, this.executeShow(), this.dispatchEvent(new c.Event("focus")))
- };
- a._onDisconnect = function() {
- this.inputElement = null;
- this.dispatchEvent(new c.Event("blur"))
- };
- a.setElementStyle = function(a, b) {
- this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b)
- };
- a._removeInput = function() {
- this.inputElement && e.getInstance().disconnectStageText(this)
- };
- a._resetStageText = function() {
- if (this.inputElement) {
- var a = this._textfield,
- b = a._TF_Props_;
- this.setElementStyle("fontFamily", b._fontFamily);
- this.setElementStyle("fontStyle", b._italic ? "italic": "normal");
- this.setElementStyle("fontWeight", b._bold ? "bold": "normal");
- this.setElementStyle("textAlign", b._textAlign);
- this.setElementStyle("fontSize", b._size * this._gscaleY + "px");
- this.setElementStyle("lineHeight", b._size * this._gscaleY + "px");
- this.setElementStyle("color", b._textColorString);
- this.setElementStyle("width", a._getSize(c.Rectangle.identity).width * this._gscaleX + "px");
- this.setElementStyle("height", a._getSize(c.Rectangle.identity).height * this._gscaleY + "px");
- this.setElementStyle("verticalAlign", b._verticalAlign)
- }
- };
- return b
- } (c.StageText);
- c.HTML5StageText = g;
- g.prototype.__class__ = "egret.HTML5StageText";
- var e = function() {
- function d() {
- this._needShow = !1
- }
- var b = d.prototype;
- b.isInputOn = function() {
- return null != this._stageText
- };
- b.isCurrentStageText = function(a) {
- return this._stageText == a
- };
- b.initValue = function(a) {
- a.style.position = "absolute";
- a.style.left = "0px";
- a.style.top = "0px";
- a.style.border = "none";
- a.style.padding = "0"
- };
- b._initStageDelegateDiv = function() {
- var a = this,
- b = c.Browser.getInstance().$("#StageDelegateDiv");
- b || (b = c.Browser.getInstance().$new("div"), b.id = "StageDelegateDiv", document.getElementById(c.StageDelegate.egret_root_div).appendChild(b), a.initValue(b), b.style.width = "0px", b.style.height = "0px", a._inputDIV = c.Browser.getInstance().$new("div"), a.initValue(a._inputDIV), a._inputDIV.style.width = "0px", a._inputDIV.style.height = "0px", a._inputDIV.style.left = "0px", a._inputDIV.style.top = "-100px", a._inputDIV.style[c.Browser.getInstance().getTrans("transformOrigin")] = "0% 0% 0px", b.appendChild(a._inputDIV), document.getElementById(c.StageDelegate.canvas_div_name).addEventListener("click",
- function(b) {
- a._needShow ? (a._needShow = !1, c.MainContext.instance.stage._changeSizeDispatchFlag = !1, a._stageText._onClickHandler(b), d.getInstance().show()) : a._inputElement && (a.clearInputElement(), a._inputElement.blur(), a._inputElement = null)
- }), a.initInputElement(!0), a.initInputElement(!1))
- };
- b.initInputElement = function(a) {
- var b = this;
- a ? (a = document.createElement("textarea"), a.style.resize = "none", b._multiElement = a, a.id = "egretTextarea") : (a = document.createElement("input"), b._simpleElement = a, a.id = "egretInput");
- a.type = "text";
- b._inputDIV.appendChild(a);
- a.setAttribute("tabindex", "-1");
- a.style.width = "1px";
- a.style.height = "12px";
- b.initValue(a);
- a.style.outline = "thin";
- a.style.background = "none";
- a.style.overflow = "hidden";
- a.style.wordBreak = "break-all";
- a.style.opacity = 0;
- a.oninput = function() {
- b._stageText && b._stageText._onInput()
- }
- };
- b.show = function() {
- var a = this._inputElement;
- c.__callAsync(function() {
- a.style.opacity = 1
- },
- this)
- };
- b.disconnectStageText = function(a) {
- if (null == this._stageText || this._stageText == a) this.clearInputElement(),
- this._inputElement && this._inputElement.blur()
- };
- b.clearInputElement = function() {
- this._inputElement && (this._inputElement.value = "", this._inputElement.onblur = null, this._inputElement.style.width = "1px", this._inputElement.style.height = "12px", this._inputElement.style.left = "0px", this._inputElement.style.top = "0px", this._inputElement.style.opacity = 0, (this._simpleElement == this._inputElement ? this._multiElement: this._simpleElement).style.display = "block", this._inputDIV.style.left = "0px", this._inputDIV.style.top = "-100px");
- this._stageText && (this._stageText._onDisconnect(), this._stageText = null);
- c.MainContext.instance.stage._changeSizeDispatchFlag = !0
- };
- b.getInputElement = function(a) {
- this.clearInputElement();
- this._stageText = a;
- this._inputElement = this._stageText._multiline ? this._multiElement: this._simpleElement; (this._simpleElement == this._inputElement ? this._multiElement: this._simpleElement).style.display = "none";
- return this._inputElement
- };
- d.getInstance = function() {
- null == d._instance && (d._instance = new c.HTMLInput);
- return d._instance
- };
- return d
- } ();
- c.HTMLInput = e;
- e.prototype.__class__ = "egret.HTMLInput"
- })(egret || (egret = {}));
- egret.StageText.create = function() {
- egret.HTMLInput.getInstance()._initStageDelegateDiv();
- return new egret.HTML5StageText
- }; (function(c) {
- var g = function() {
- function e() {
- this._loop = !1;
- this.paused = !0;
- this._listeners = [];
- this._onEndedCall = null;
- this._volume = 1;
- this._startTime = 0
- }
- var d = e.prototype;
- d._play = function(b) {
- this.removeListeners();
- c.Html5Capatibility._System_OS != c.SystemOSType.WPHONE && (this._audio = this._audio.cloneNode());
- this.paused = !1;
- this._audio.autoplay = !0;
- this._audio.volume = this._volume;
- var a = this,
- d = function(b) {
- a._audio.removeEventListener("ended", d);
- a._onEndedCall && a._onEndedCall.call(null, b);
- a.clear()
- };
- this._audio.addEventListener("ended", d);
- this.initStart();
- try {
- this._audio.currentTime = this._startTime
- } catch(e) {} finally {
- this._audio.play()
- }
- };
- d.clear = function() {
- try {
- this._audio.pause()
- } catch(b) {} finally {
- this.removeListeners(),
- this._loop && !this.paused && this._play()
- }
- };
- d._pause = function() {
- this.paused = !0;
- this._audio.pause()
- };
- d._load = function() {
- this._audio.load()
- };
- d._setAudio = function(b) {
- this._audio = b
- };
- d.initStart = function() {
- for (var b = 0; b < this._listeners.length; b++) {
- var a = this._listeners[b];
- this._audio.addEventListener(a.type, a.listener, a.useCapture)
- }
- };
- d._addEventListener = function(b, a, c) {
- void 0 === c && (c = !1);
- "ended" == b ? this._onEndedCall = a: (this._listeners.push({
- type: b,
- listener: a,
- useCapture: c
- }), this._audio && this._audio.addEventListener(b, a, c))
- };
- d.removeListeners = function() {
- for (var b = 0; b < this._listeners.length; b++) {
- var a = this._listeners[b];
- this._audio && this._audio.removeEventListener(a.type, a.listener, a.useCapture)
- }
- };
- d._removeEventListener = function(b, a, c) {
- void 0 === c && (c = !1);
- if ("ended" == b) this._onEndedCall = null;
- else for (var d = 0; d < this._listeners.length; d++) {
- var e = this._listeners[d];
- if (e.listener == a && e.useCapture == c && e.type == b) {
- this._listeners.splice(d, 1);
- this._audio && this._audio.removeEventListener(b, a, c);
- break
- }
- }
- };
- d._preload = function(b, a, d) {
- void 0 === a && (a = null);
- void 0 === d && (d = null);
- c.callLater(a, d)
- };
- d._destroy = function() {};
- d._getVolume = function() {
- return this._volume
- };
- d._setVolume = function(b) {
- this._volume = Math.max(0, Math.min(b, 1));
- this._audio.volume = this._volume
- };
- d._setLoop = function(b) {
- this._loop = b
- };
- d._getCurrentTime = function() {
- return this._audio.currentTime
- };
- d._setCurrentTime = function(b) {
- this._startTime = b
- };
- return e
- } ();
- c.Html5Audio = g;
- g.prototype.__class__ = "egret.Html5Audio"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {
- this.context = e.ctx;
- this.bufferSource = null;
- this.paused = !0;
- this._loop = !1;
- this._listeners = [];
- this._onEndedCall = null;
- this._volume = 1;
- this._currentTime = this._startTime = 0;
- this.gain = e.ctx.createGain ? e.ctx.createGain() : e.ctx.createGainNode()
- }
- var d = e.prototype;
- e.decodeAudios = function() {
- if (! (0 >= e.decodeArr.length || e.isDecoding)) {
- e.isDecoding = !0;
- var b = e.decodeArr.shift();
- e.ctx.decodeAudioData(b.buffer,
- function(a) {
- b.self.audioBuffer = a;
- b.callback && b.callback();
- e.isDecoding = !1;
- e.decodeAudios()
- })
- }
- };
- d._play = function(b) {
- var a = this;
- this.bufferSource && (this.bufferSource.onended = null, this.removeListeners(), this.bufferSource = null);
- b = this.context;
- var c = this.gain,
- d = b.createBufferSource();
- this.bufferSource = d;
- this.addListeners();
- d.buffer = this.audioBuffer;
- d.connect(c);
- c.connect(b.destination);
- d.onended = function(b) {
- a.clear();
- a._onEndedCall && a._onEndedCall.call(null, b);
- a._loop && !a.paused && a._play()
- };
- this.paused = !1;
- this._startTime = Date.now();
- this.gain.gain.value = this._volume;
- d.start(0, this._currentTime);
- this._currentTime = 0
- };
- d.clear = function() {
- if (this.bufferSource) {
- this.removeListeners();
- var b = this.bufferSource;
- b.stop ? b.stop(0) : b.noteOff(0);
- this.bufferSource.disconnect();
- this.bufferSource = null
- }
- };
- d.addListeners = function() {
- for (var b = 0; b < this._listeners.length; b++) {
- var a = this._listeners[b];
- this.bufferSource.addEventListener(a.type, a.listener, a.useCapture)
- }
- };
- d.removeListeners = function() {
- for (var b = 0; b < this._listeners.length; b++) {
- var a = this._listeners[b];
- this.bufferSource.removeEventListener(a.type, a.listener, a.useCapture)
- }
- };
- d._pause = function() {
- this.paused = !0;
- this.clear()
- };
- d._addEventListener = function(b, a, c) {
- void 0 === c && (c = !1);
- "ended" == b ? this._onEndedCall = a: (this._listeners.push({
- type: b,
- listener: a,
- useCapture: c
- }), this.bufferSource && this.bufferSource.addEventListener(b, a, c))
- };
- d._removeEventListener = function(b, a, c) {
- void 0 === c && (c = !1);
- if ("ended" == b) this._onEndedCall = null;
- else for (var d = 0; d < this._listeners.length; d++) {
- var e = this._listeners[d];
- if (e.listener == a && e.useCapture == c && e.type == b) {
- this._listeners.splice(d, 1);
- this.bufferSource && this.bufferSource.removeEventListener(b, a, c);
- break
- }
- }
- };
- d._load = function() {
- this._setArrayBuffer(this._arrayBuffer, null)
- };
- d._setArrayBuffer = function(b, a) {
- this._arrayBuffer = b;
- e.decodeArr.push({
- buffer: b,
- callback: a,
- self: this
- });
- e.decodeAudios()
- };
- d._preload = function(b, a, d) {
- void 0 === a && (a = null);
- void 0 === d && (d = null);
- c.callLater(a, d)
- };
- d._getVolume = function() {
- return this._volume
- };
- d._setVolume = function(b) {
- this._volume = b;
- this.gain.gain.value = b
- };
- d._setLoop = function(b) {
- this._loop = b
- };
- d._getCurrentTime = function() {
- return this.bufferSource ? (Date.now() - this._startTime) / 1E3: 0
- };
- d._setCurrentTime = function(b) {
- this._currentTime = b
- };
- d._destroy = function() {};
- e.canUseWebAudio = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;
- e.ctx = e.canUseWebAudio ? new(window.AudioContext || window.webkitAudioContext || window.mozAudioContext) : void 0;
- e.decodeArr = [];
- e.isDecoding = !1;
- return e
- } ();
- c.WebAudio = g;
- g.prototype.__class__ = "egret.WebAudio"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function e() {
- this._loop = !1;
- this._currentTime = 0
- }
- var d = e.prototype;
- d._play = function(b) {
- this._type = b;
- b == c.Sound.EFFECT ? QZAppExternal.playLocalSound(function(a) {
- alert(JSON.stringify(a))
- },
- {
- bid: -1,
- url: this._path,
- loop: this._loop ? -1 : 0
- }) : QZAppExternal.playLocalBackSound({
- bid: -1,
- url: this._path,
- loop: this._loop ? -1 : 0
- })
- };
- d._pause = function() {
- this._type == c.Sound.EFFECT ? QZAppExternal.stopSound() : QZAppExternal.stopBackSound()
- };
- d._addEventListener = function(b, a, c) {};
- d._removeEventListener = function(b, a, c) {};
- d._load = function() {};
- d._preload = function(b, a, d) {
- void 0 === a && (a = null);
- void 0 === d && (d = null);
- c.callLater(a, d)
- };
- d._setPath = function(b) {
- this._path = b
- };
- d._getVolume = function() {
- return 1
- };
- d._setVolume = function(b) {};
- d._setLoop = function(b) {
- this._loop = b
- };
- d._getCurrentTime = function() {
- return 0
- };
- d._setCurrentTime = function(b) {
- this._currentTime = b
- };
- d._destroy = function() {};
- return e
- } ();
- c.QQAudio = g;
- g.prototype.__class__ = "egret.QQAudio"
- })(egret || (egret = {})); (function(c) {
- var g = function() {
- function b() {}
- b.QQ_AUDIO = 1;
- b.WEB_AUDIO = 2;
- b.HTML5_AUDIO = 3;
- return b
- } ();
- c.AudioType = g;
- g.prototype.__class__ = "egret.AudioType";
- var e = function() {
- function b() {}
- b.WPHONE = 1;
- b.IOS = 2;
- b.ADNROID = 3;
- return b
- } ();
- c.SystemOSType = e;
- e.prototype.__class__ = "egret.SystemOSType";
- var d = function(b) {
- function a() {
- b.call(this)
- }
- __extends(a, b);
- a._init = function() {
- var b = navigator.userAgent.toLowerCase();
- a.ua = b;
- a._canUseBlob = !1;
- a._audioType = g.HTML5_AUDIO;
- a._AudioClass = c.Html5Audio;
- if (0 <= b.indexOf("windows phone")) a._System_OS = e.WPHONE;
- else if (0 <= b.indexOf("android")) a._System_OS = e.ADNROID,
- window.hasOwnProperty("QZAppExternal") && 0 <= b.indexOf("qzone") && (a._AudioClass = c.QQAudio, a._audioType = g.QQ_AUDIO, (b = document.getElementsByTagName("base")) && 0 < b.length ? a._QQRootPath = b[0].baseURI: (b = window.location.href.indexOf("?"), -1 == b && (b = window.location.href.length), b = window.location.href.substring(0, b), b = b.substring(0, b.lastIndexOf("/")), a._QQRootPath = b + "/"));
- else if (0 <= b.indexOf("iphone") || 0 <= b.indexOf("ipad") || 0 <= b.indexOf("ipod")) a._System_OS = e.IOS,
- 7 <= a.getIOSVersion() && (a._canUseBlob = !0, a._AudioClass = c.WebAudio, a._audioType = g.WEB_AUDIO);
- window.URL || window.webkitURL || (a._canUseBlob = !1);
- window.AudioContext || window.webkitAudioContext || window.mozAudioContext || a._audioType != g.WEB_AUDIO || (a._audioType = g.HTML5_AUDIO, a._AudioClass = c.Html5Audio)
- };
- a.getIOSVersion = function() {
- var b = a.ua.toLowerCase().match(/cpu [^\d]*\d.*like mac os x/)[0];
- return parseInt(b.match(/\d(_\d)*/)[0]) || 0
- };
- a._canUseBlob = !1;
- a._audioType = 0;
- a._QQRootPath = "";
- a._System_OS = 0;
- a.ua = "";
- return a
- } (c.HashObject);
- c.Html5Capatibility = d;
- d.prototype.__class__ = "egret.Html5Capatibility";
- d._init()
- })(egret || (egret = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.localVersionDataPath = "localVersion.manifest";
- this.localVersionData = null;
- this.changeVersionDataPath = "version.manifest";
- this.changeVersionData = null;
- this.baseVersionDataPath = "base.manifest";
- this.baseVersionData = null;
- this.localVersionCodePath = "localCode.manifest";
- this.serverVersionCodePath = "code.manifest";
- this._call = this._load = null
- }
- __extends(d, e);
- var b = d.prototype;
- b.fetchVersion = function() {
- this._load = new c.NativeResourceLoader;
- this._load.addEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
- this._load.addEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
- this.initLocalVersionData()
- };
- b.initLocalVersionData = function() {
- var a = this.getData("appVersion.manifest", !0);
- if (a) {
- if (1 == a.debug) {
- this.baseVersionData = null;
- if (a = this.getData(this.localVersionDataPath, !1)) for (var b in a) this.deleteFile(b);
- this.deleteFile(this.localVersionDataPath);
- this.deleteFile(this.localVersionCodePath);
- this.loadOver();
- return
- }
- var c = this.getData("appVersion.manifest", !1);
- if (null == c || c.version != a.version) {
- this.localVersionData = this.getData(this.localVersionDataPath, !0);
- null == this.localVersionData && (this.localVersionData = {});
- this.deleteFile(this.localVersionCodePath);
- this.save("appVersion.manifest", JSON.stringify(a));
- if (a = this.getData(this.localVersionCodePath, !1)) for (b in a) a[b] != this.localVersionData[b] && this.deleteFile(b);
- else a = {};
- for (b in this.localVersionData) a[b] != this.localVersionData[b] && this.deleteFile(b);
- this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData));
- this.loadCodeVersion();
- return
- }
- }
- this.localVersionData = this.getLocalData(this.localVersionDataPath);
- null == this.localVersionData && (this.localVersionData = this.getLocalData(this.baseVersionDataPath), null == this.localVersionData && (this.localVersionData = {}), this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData)));
- this.loadCodeVersion()
- };
- b.deleteFile = function(a) {
- egret_native.deleteUpdateFile && egret_native.deleteUpdateFile(a)
- };
- b.loadCodeVersion = function() {
- var a = 1;
- this.newCode = 1;
- var b = this.getLocalData(this.localVersionCodePath);
- null != b && (a = b.code);
- b = this.getLocalData(this.serverVersionCodePath);
- null != b && (this.newCode = b.code);
- this.loadBaseVersion(a != this.newCode)
- };
- b.loadBaseVersion = function(a) {
- this.baseVersionData = this.getLocalData(this.baseVersionDataPath);
- this.changeVersionData = this.getLocalData(this.changeVersionDataPath);
- var b = this;
- null == b.baseVersionData || a ? b.loadFile(b.baseVersionDataPath,
- function() {
- b.baseVersionData = b.getLocalData(b.baseVersionDataPath);
- b.loadBaseOver()
- }) : b.loadBaseOver()
- };
- b.loadBaseOver = function() {
- this.save(this.localVersionCodePath, JSON.stringify({
- code: this.newCode
- }));
- this.loadOver()
- };
- b.loadFile = function(a, b) {
- void 0 === b && (b = null);
- this._call = b;
- this._load.load(a, 1E3)
- };
- b.fileLoadComplete = function(a) {
- this._call && this._call()
- };
- b.loadError = function(a) {
- this._load.removeEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
- this._load.removeEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
- this.dispatchEvent(a)
- };
- b.loadOver = function() {
- this._load.removeEventListener(c.IOErrorEvent.IO_ERROR, this.loadError, this);
- this._load.removeEventListener(c.Event.COMPLETE, this.fileLoadComplete, this);
- this.dispatchEvent(new c.Event(c.Event.COMPLETE))
- };
- b.save = function(a, b) {
- egret_native.writeFileSync ? egret_native.writeFileSync(a, b) : egret_native.saveRecord && egret_native.saveRecord(a, b)
- };
- b.getData = function(a, b) {
- if (egret_native.readUpdateFileSync && egret_native.readResourceFileSync) {
- var c = b ? egret_native.readResourceFileSync(a) : egret_native.readUpdateFileSync(a);
- return null != c ? JSON.parse(c) : null
- }
- return this.getLocalDataByOld(a)
- };
- b.getLocalData = function(a) {
- if (egret_native.readUpdateFileSync && egret_native.readResourceFileSync) {
- var b = egret_native.readUpdateFileSync(a);
- if (null != b) return JSON.parse(b);
- b = egret_native.readResourceFileSync(a);
- return null != b ? JSON.parse(b) : null
- }
- return this.getLocalDataByOld(a)
- };
- b.getLocalDataByOld = function(a) {
- var b = null;
- egret_native.isRecordExists(a) ? (a = egret_native.loadRecord(a), b = JSON.parse(a)) : egret_native.isFileExists(a) && (a = egret_native.readFileSync(a), b = JSON.parse(a));
- return b
- };
- b.getChangeList = function() {
- if (!this.baseVersionData) return [];
- var a = {},
- b;
- for (b in this.changeVersionData) 1 == this.changeVersionData[b].d ? delete this.baseVersionData[b] : this.baseVersionData[b] = this.changeVersionData[b];
- for (b in this.baseVersionData) null != this.localVersionData[b] && this.compareVersion(this.localVersionData, this.baseVersionData, b) || (a[b] = {
- url: b,
- size: this.baseVersionData[b].s
- });
- var c = [];
- for (b in a) c.push(a[b]);
- return c
- };
- b.compareVersion = function(a, b, c) {
- return null == a[c] || null == b[c] ? !1 : a[c].v == b[c].v
- };
- b.checkIsNewVersion = function(a) {
- return this.baseVersionData ? null != this.changeVersionData[a] ? this.compareVersion(this.changeVersionData, this.localVersionData, a) : null != this.baseVersionData[a] ? this.compareVersion(this.baseVersionData, this.localVersionData, a) : !0 : !0
- };
- b.saveVersion = function(a) {
- if (this.baseVersionData) {
- var b = !1;
- null != this.changeVersionData[a] ? this.compareVersion(this.changeVersionData, this.localVersionData, a) || (b = !0, this.localVersionData[a] = this.changeVersionData[a]) : null == this.baseVersionData[a] || this.compareVersion(this.baseVersionData, this.localVersionData, a) || (b = !0, this.localVersionData[a] = this.baseVersionData[a]);
- b && this.save(this.localVersionDataPath, JSON.stringify(this.localVersionData))
- }
- };
- b.getVirtualUrl = function(a) {
- return a
- };
- return d
- } (c.EventDispatcher);
- c.NativeVersionController = g;
- g.prototype.__class__ = "egret.NativeVersionController"
- })(egret || (egret = {}));
- var RES; (function(c) {
- var g = function(c) {
- function d(b, a, d) {
- void 0 === a && (a = !1);
- void 0 === d && (d = !1);
- c.call(this, b, a, d);
- this.itemsTotal = this.itemsLoaded = 0;
- this.groupName = "";
- this.resItem = null
- }
- __extends(d, c);
- d.dispatchResourceEvent = function(b, a, c, e, g, s) {
- void 0 === c && (c = "");
- void 0 === e && (e = null);
- void 0 === g && (g = 0);
- void 0 === s && (s = 0);
- var n = egret.Event._getPropertyData(d);
- n.groupName = c;
- n.resItem = e;
- n.itemsLoaded = g;
- n.itemsTotal = s;
- egret.Event._dispatchByTarget(d, b, a, n)
- };
- d.ITEM_LOAD_ERROR = "itemLoadError";
- d.CONFIG_COMPLETE = "configComplete";
- d.CONFIG_LOAD_ERROR = "configLoadError";
- d.GROUP_PROGRESS = "groupProgress";
- d.GROUP_COMPLETE = "groupComplete";
- d.GROUP_LOAD_ERROR = "groupLoadError";
- return d
- } (egret.Event);
- c.ResourceEvent = g;
- g.prototype.__class__ = "RES.ResourceEvent"
- })(RES || (RES = {})); (function(c) {
- var g = function() {
- function c(b, a, d) {
- this.groupName = "";
- this.data = null;
- this._loaded = !1;
- this.name = b;
- this.url = a;
- this.type = d
- }
- var d = c.prototype;
- Object.defineProperty(d, "loaded", {
- get: function() {
- return this.data ? this.data.loaded: this._loaded
- },
- set: function(b) {
- this.data && (this.data.loaded = b);
- this._loaded = b
- },
- enumerable: !0,
- configurable: !0
- });
- d.toString = function() {
- return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
- };
- c.TYPE_XML = "xml";
- c.TYPE_IMAGE = "image";
- c.TYPE_BIN = "bin";
- c.TYPE_TEXT = "text";
- c.TYPE_JSON = "json";
- c.TYPE_SHEET = "sheet";
- c.TYPE_FONT = "font";
- c.TYPE_SOUND = "sound";
- return c
- } ();
- c.ResourceItem = g;
- g.prototype.__class__ = "RES.ResourceItem"
- })(RES || (RES = {})); (function(c) {
- var g = function() {
- function e() {
- this.keyMap = {};
- this.groupDic = {};
- c.configInstance = this
- }
- var d = e.prototype;
- d.getGroupByName = function(b) {
- var a = [];
- if (!this.groupDic[b]) return a;
- b = this.groupDic[b];
- for (var c = b.length,
- d = 0; d < c; d++) a.push(this.parseResourceItem(b[d]));
- return a
- };
- d.getRawGroupByName = function(b) {
- return this.groupDic[b] ? this.groupDic[b] : []
- };
- d.createGroup = function(b, a, c) {
- void 0 === c && (c = !1);
- if (!c && this.groupDic[b] || !a || 0 == a.length) return ! 1;
- c = this.groupDic;
- for (var d = [], e = a.length, g = 0; g < e; g++) {
- var n = a[g],
- h = c[n];
- if (h) for (var n = h.length,
- k = 0; k < n; k++) {
- var l = h[k]; - 1 == d.indexOf(l) && d.push(l)
- } else(l = this.keyMap[n]) ? -1 == d.indexOf(l) && d.push(l) : egret.Logger.warningWithErrorId(2E3, n)
- }
- if (0 == d.length) return ! 1;
- this.groupDic[b] = d;
- return ! 0
- };
- d.parseConfig = function(b, a) {
- if (b) {
- var c = b.resources;
- if (c) for (var d = c.length,
- e = 0; e < d; e++) {
- var g = c[e],
- n = g.url;
- n && -1 == n.indexOf("://") && (g.url = a + n);
- this.addItemToKeyMap(g)
- }
- if (c = b.groups) for (d = c.length, e = 0; e < d; e++) {
- for (var n = c[e], h = [], k = n.keys.split(","), l = k.length, m = 0; m < l; m++) g = k[m].trim(),
- (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
- this.groupDic[n.name] = h
- }
- }
- };
- d.addSubkey = function(b, a) {
- var c = this.keyMap[a];
- c && !this.keyMap[b] && (this.keyMap[b] = c)
- };
- d.addItemToKeyMap = function(b) {
- this.keyMap[b.name] || (this.keyMap[b.name] = b);
- if (b.hasOwnProperty("subkeys")) {
- var a = b.subkeys.split(",");
- b.subkeys = a;
- for (var c = a.length,
- d = 0; d < c; d++) {
- var e = a[d];
- null == this.keyMap[e] && (this.keyMap[e] = b)
- }
- }
- };
- d.getName = function(b) {
- return (b = this.keyMap[b]) ? b.name: ""
- };
- d.getType = function(b) {
- return (b = this.keyMap[b]) ? b.type: ""
- };
- d.getRawResourceItem = function(b) {
- return this.keyMap[b]
- };
- d.getResourceItem = function(b) {
- return (b = this.keyMap[b]) ? this.parseResourceItem(b) : null
- };
- d.parseResourceItem = function(b) {
- var a = new c.ResourceItem(b.name, b.url, b.type);
- a.data = b;
- return a
- };
- return e
- } ();
- c.ResourceConfig = g;
- g.prototype.__class__ = "RES.ResourceConfig"
- })(RES || (RES = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.thread = 2;
- this.loadingCount = 0;
- this.resInstance = this.callBack = null;
- this.groupTotalDic = {};
- this.numLoadedDic = {};
- this.itemListDic = {};
- this.groupErrorDic = {};
- this.retryTimesDic = {};
- this.maxRetryTimes = 3;
- this.failedList = [];
- this.priorityQueue = {};
- this.lazyLoadList = [];
- this.analyzerDic = {};
- this.queueIndex = 0
- }
- __extends(d, e);
- var b = d.prototype;
- b.isGroupInLoading = function(a) {
- return void 0 !== this.itemListDic[a]
- };
- b.loadGroup = function(a, b, d) {
- void 0 === d && (d = 0);
- if (!this.itemListDic[b] && b) if (a && 0 != a.length) {
- this.priorityQueue[d] ? this.priorityQueue[d].push(b) : this.priorityQueue[d] = [b];
- this.itemListDic[b] = a;
- d = a.length;
- for (var e = 0; e < d; e++) a[e].groupName = b;
- this.groupTotalDic[b] = a.length;
- this.numLoadedDic[b] = 0;
- this.next()
- } else egret.Logger.warningWithErrorId(2001, b),
- a = new c.ResourceEvent(c.ResourceEvent.GROUP_LOAD_ERROR),
- a.groupName = b,
- this.dispatchEvent(a)
- };
- b.loadItem = function(a) {
- this.lazyLoadList.push(a);
- a.groupName = "";
- this.next()
- };
- b.next = function() {
- for (; this.loadingCount < this.thread;) {
- var a = this.getOneResourceItem();
- if (!a) break;
- this.loadingCount++;
- if (a.loaded) this.onItemComplete(a);
- else {
- var b = this.analyzerDic[a.type];
- b || (b = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
- b.loadFile(a, this.onItemComplete, this)
- }
- }
- };
- b.getOneResourceItem = function() {
- if (0 < this.failedList.length) return this.failedList.shift();
- var a = Number.NEGATIVE_INFINITY,
- b;
- for (b in this.priorityQueue) a = Math.max(a, b);
- a = this.priorityQueue[a];
- if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
- b = a.length;
- for (var c, d = 0; d < b; d++) {
- this.queueIndex >= b && (this.queueIndex = 0);
- c = this.itemListDic[a[this.queueIndex]];
- if (0 < c.length) break;
- this.queueIndex++
- }
- return 0 == c.length ? null: c.shift()
- };
- b.onItemComplete = function(a) {
- this.loadingCount--;
- var b = a.groupName;
- if (!a.loaded) {
- var d = this.retryTimesDic[a.name] || 1;
- if (d > this.maxRetryTimes) delete this.retryTimesDic[a.name],
- c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, b, a);
- else {
- this.retryTimesDic[a.name] = d + 1;
- this.failedList.push(a);
- this.next();
- return
- }
- }
- if (b) {
- this.numLoadedDic[b]++;
- var d = this.numLoadedDic[b],
- e = this.groupTotalDic[b];
- a.loaded || (this.groupErrorDic[b] = !0);
- c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, b, a, d, e);
- d == e && (a = this.groupErrorDic[b], this.removeGroupName(b), delete this.groupTotalDic[b], delete this.numLoadedDic[b], delete this.itemListDic[b], delete this.groupErrorDic[b], a ? c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_LOAD_ERROR, b) : c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, b))
- } else this.callBack.call(this.resInstance, a);
- this.next()
- };
- b.removeGroupName = function(a) {
- for (var b in this.priorityQueue) {
- for (var c = this.priorityQueue[b], d = c.length, e = 0, g = !1, d = c.length, h = 0; h < d; h++) {
- if (c[h] == a) {
- c.splice(e, 1);
- g = !0;
- break
- }
- e++
- }
- if (g) {
- 0 == c.length && delete this.priorityQueue[b];
- break
- }
- }
- };
- return d
- } (egret.EventDispatcher);
- c.ResourceLoader = g;
- g.prototype.__class__ = "RES.ResourceLoader"
- })(RES || (RES = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.resourceConfig = null;
- this.resourceConfig = c.configInstance
- }
- __extends(d, e);
- var b = d.prototype;
- b.addSubkey = function(a, b) {
- this.resourceConfig.addSubkey(a, b)
- };
- b.loadFile = function(a, b, c) {};
- b.getRes = function(a) {};
- b.destroyRes = function(a) {
- return ! 1
- };
- d.getStringPrefix = function(a) {
- if (!a) return "";
- var b = a.indexOf(".");
- return - 1 != b ? a.substring(0, b) : ""
- };
- d.getStringTail = function(a) {
- if (!a) return "";
- var b = a.indexOf(".");
- return - 1 != b ? a.substring(b + 1) : ""
- };
- return d
- } (egret.HashObject);
- c.AnalyzerBase = g;
- g.prototype.__class__ = "RES.AnalyzerBase"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this.fileDic = {};
- this.resItemDic = [];
- this._dataFormat = egret.URLLoaderDataFormat.BINARY;
- this.recycler = new egret.Recycler
- }
- __extends(d, c);
- var b = d.prototype;
- b.loadFile = function(a, b, c) {
- if (this.fileDic[a.name]) b.call(c, a);
- else {
- var d = this.getLoader();
- this.resItemDic[d.hashCode] = {
- item: a,
- func: b,
- thisObject: c
- };
- d.load(new egret.URLRequest(a.url))
- }
- };
- b.getLoader = function() {
- var a = this.recycler.pop();
- a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
- a.dataFormat = this._dataFormat;
- return a
- };
- b.onLoadFinish = function(a) {
- var b = a.target,
- c = this.resItemDic[b.hashCode];
- delete this.resItemDic[b.hashCode];
- var d = c.item,
- e = c.func;
- d.loaded = a.type == egret.Event.COMPLETE;
- d.loaded && this.analyzeData(d, b.data);
- this.recycler.push(b);
- e.call(c.thisObject, d)
- };
- b.analyzeData = function(a, b) {
- var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
- };
- b.getRes = function(a) {
- return this.fileDic[a]
- };
- b.hasRes = function(a) {
- return null != this.getRes(a)
- };
- b.destroyRes = function(a) {
- return this.fileDic[a] ? (this.onResourceDestroy(this.fileDic[a]), delete this.fileDic[a], !0) : !1
- };
- b.onResourceDestroy = function(a) {};
- return d
- } (c.AnalyzerBase);
- c.BinAnalyzer = g;
- g.prototype.__class__ = "RES.BinAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
- }
- __extends(d, c);
- var b = d.prototype;
- b.analyzeData = function(a, b) {
- var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
- };
- b.onResourceDestroy = function(a) {
- a.dispose()
- };
- return d
- } (c.BinAnalyzer);
- c.ImageAnalyzer = g;
- g.prototype.__class__ = "RES.ImageAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._dataFormat = egret.URLLoaderDataFormat.TEXT
- }
- __extends(d, c);
- d.prototype.analyzeData = function(b, a) {
- var c = b.name;
- if (!this.fileDic[c] && a) try {
- this.fileDic[c] = JSON.parse(a)
- } catch(d) {
- egret.Logger.warningWithErrorId(1017, b.url, a)
- }
- };
- return d
- } (c.BinAnalyzer);
- c.JsonAnalyzer = g;
- g.prototype.__class__ = "RES.JsonAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._dataFormat = egret.URLLoaderDataFormat.TEXT
- }
- __extends(d, c);
- return d
- } (c.BinAnalyzer);
- c.TextAnalyzer = g;
- g.prototype.__class__ = "RES.TextAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(e) {
- function d() {
- e.call(this);
- this.sheetMap = {};
- this.textureMap = {};
- this._dataFormat = egret.URLLoaderDataFormat.TEXT
- }
- __extends(d, e);
- var b = d.prototype;
- b.getRes = function(a) {
- var b = this.fileDic[a];
- b || (b = this.textureMap[a]); ! b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.fileDic[b]) && (a = c.AnalyzerBase.getStringTail(a), b = b.getTexture(a));
- return b
- };
- b.onLoadFinish = function(a) {
- var b = a.target,
- c = this.resItemDic[b.hashCode];
- delete this.resItemDic[b.hashCode];
- var d = c.item,
- e = c.func;
- d.loaded = a.type == egret.Event.COMPLETE;
- if (d.loaded) if ("string" == typeof b.data) {
- if (d.loaded = !1, a = this.analyzeConfig(d, b.data)) {
- b = d.url;
- d.url = a;
- this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
- this.loadFile(d, e, c.thisObject);
- this._dataFormat = egret.URLLoaderDataFormat.TEXT;
- d.url = b;
- return
- }
- } else this.analyzeBitmap(d, b.data);
- this.recycler.push(b);
- e.call(c.thisObject, d)
- };
- b.analyzeConfig = function(a, b) {
- var c = a.name,
- d, e = "";
- try {
- d = JSON.parse(b)
- } catch(g) {
- egret.Logger.warningWithErrorId(1017, a.url, b)
- }
- d && (this.sheetMap[c] = d, e = this.getRelativePath(a.url, d.file));
- return e
- };
- b.analyzeBitmap = function(a, b) {
- var c = a.name;
- if (!this.fileDic[c] && b) {
- var d = this.sheetMap[c];
- delete this.sheetMap[c];
- d = this.parseSpriteSheet(b, d, a.data && a.data.subkeys ? "": c);
- this.fileDic[c] = d
- }
- };
- b.getRelativePath = function(a, b) {
- a = a.split("\\").join("/");
- var c = a.lastIndexOf("/");
- return a = -1 != c ? a.substring(0, c + 1) + b: b
- };
- b.parseSpriteSheet = function(a, b, c) {
- b = b.frames;
- if (!b) return null;
- var d = new egret.SpriteSheet(a),
- e = this.textureMap,
- g;
- for (g in b) {
- var h = b[g];
- a = d.createTexture(g, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH);
- h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
- null == e[g] && (e[g] = a, c && this.addSubkey(g, c))
- }
- return d
- };
- b.destroyRes = function(a) {
- var b = this.fileDic[a];
- if (b) {
- delete this.fileDic[a];
- for (var c in b._textureMap) this.textureMap[c] && delete this.textureMap[c];
- this.onResourceDestroy(b);
- return ! 0
- }
- return ! 1
- };
- b.onResourceDestroy = function(a) {
- a.dispose()
- };
- return d
- } (c.BinAnalyzer);
- c.SheetAnalyzer = g;
- g.prototype.__class__ = "RES.SheetAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this)
- }
- __extends(d, c);
- var b = d.prototype;
- b.analyzeConfig = function(a, b) {
- var c = a.name,
- d, e = "";
- try {
- d = JSON.parse(b)
- } catch(g) {}
- d ? e = this.getRelativePath(a.url, d.file) : (d = b, e = this.getTexturePath(a.url, d));
- this.sheetMap[c] = d;
- return e
- };
- b.analyzeBitmap = function(a, b) {
- var c = a.name;
- if (!this.fileDic[c] && b) {
- var d = this.sheetMap[c];
- delete this.sheetMap[c];
- d = new egret.BitmapFont(b, d);
- this.fileDic[c] = d
- }
- };
- b.getTexturePath = function(a, b) {
- var c = "",
- d = b.split("\n")[2],
- e = d.indexOf('file="'); - 1 != e && (d = d.substring(e + 6), e = d.indexOf('"'), c = d.substring(0, e));
- a = a.split("\\").join("/");
- e = a.lastIndexOf("/");
- return a = -1 != e ? a.substring(0, e + 1) + c: c
- };
- b.onResourceDestroy = function(a) {
- a.dispose()
- };
- return d
- } (c.SheetAnalyzer);
- c.FontAnalyzer = g;
- g.prototype.__class__ = "RES.FontAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._dataFormat = egret.URLLoaderDataFormat.SOUND
- }
- __extends(d, c);
- d.prototype.analyzeData = function(b, a) {
- var c = b.name; ! this.fileDic[c] && a && (this.fileDic[c] = a, (c = b.data) && c.soundType ? a.preload(c.soundType) : a.preload(egret.Sound.EFFECT))
- };
- return d
- } (c.BinAnalyzer);
- c.SoundAnalyzer = g;
- g.prototype.__class__ = "RES.SoundAnalyzer"
- })(RES || (RES = {})); (function(c) {
- var g = function(c) {
- function d() {
- c.call(this);
- this._dataFormat = egret.URLLoaderDataFormat.TEXT
- }
- __extends(d, c);
- d.prototype.analyzeData = function(b, a) {
- var c = b.name;
- if (!this.fileDic[c] && a) try {
- var d = egret.XML.parse(a);
- this.fileDic[c] = d
- } catch(e) {}
- };
- return d
- } (c.BinAnalyzer);
- c.XMLAnalyzer = g;
- g.prototype.__class__ = "RES.XMLAnalyzer"
- })(RES || (RES = {})); (function(c) {
- c.loadConfig = function(c, b, a) {
- void 0 === b && (b = "");
- void 0 === a && (a = "json");
- e.loadConfig(c, b, a)
- };
- c.loadGroup = function(c, b) {
- void 0 === b && (b = 0);
- e.loadGroup(c, b)
- };
- c.isGroupLoaded = function(c) {
- return e.isGroupLoaded(c)
- };
- c.getGroupByName = function(c) {
- return e.getGroupByName(c)
- };
- c.createGroup = function(c, b, a) {
- void 0 === a && (a = !1);
- return e.createGroup(c, b, a)
- };
- c.hasRes = function(c) {
- return e.hasRes(c)
- };
- c.parseConfig = function(c, b) {
- void 0 === b && (b = "");
- e.parseConfig(c, b)
- };
- c.getRes = function(c) {
- return e.getRes(c)
- };
- c.getResAsync = function(c, b, a) {
- e.getResAsync(c, b, a)
- };
- c.getResByUrl = function(c, b, a, f) {
- void 0 === f && (f = "");
- e.getResByUrl(c, b, a, f)
- };
- c.destroyRes = function(c, b) {
- return e.destroyRes(c, b)
- };
- c.setMaxLoadingThread = function(c) {
- e.setMaxLoadingThread(c)
- };
- c.setMaxRetryTimes = function(c) {
- e.setMaxRetryTimes(c)
- };
- c.addEventListener = function(c, b, a, f, g) {
- void 0 === f && (f = !1);
- void 0 === g && (g = 0);
- e.addEventListener(c, b, a, f, g)
- };
- c.removeEventListener = function(c, b, a, f) {
- void 0 === f && (f = !1);
- e.removeEventListener(c, b, a, f)
- };
- var g = function(d) {
- function b() {
- d.call(this);
- this.analyzerDic = {};
- this.configItemList = [];
- this.configComplete = this.callLaterFlag = !1;
- this.loadedGroups = [];
- this.groupNameList = [];
- this.asyncDic = {};
- this.init()
- }
- __extends(b, d);
- var a = b.prototype;
- a.getAnalyzerByType = function(a) {
- var b = this.analyzerDic[a];
- b || (b = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
- return b
- };
- a.init = function() {
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
- egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
- this.resConfig = new c.ResourceConfig;
- this.resLoader = new c.ResourceLoader;
- this.resLoader.callBack = this.onResourceItemComp;
- this.resLoader.resInstance = this;
- this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
- this.resLoader.addEventListener(c.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
- };
- a.loadConfig = function(a, b, c) {
- void 0 === c && (c = "json");
- this.configItemList.push({
- url: a,
- resourceRoot: b,
- type: c
- });
- this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
- };
- a.startLoadConfig = function() {
- this.callLaterFlag = !1;
- var a = this.configItemList;
- this.configItemList = [];
- this.loadingConfigList = a;
- for (var d = a.length,
- e = [], g = 0; g < d; g++) {
- var n = a[g],
- n = new c.ResourceItem(n.url, n.url, n.type);
- e.push(n)
- }
- this.resLoader.loadGroup(e, b.GROUP_CONFIG, Number.MAX_VALUE)
- };
- a.isGroupLoaded = function(a) {
- return - 1 != this.loadedGroups.indexOf(a)
- };
- a.getGroupByName = function(a) {
- return this.resConfig.getGroupByName(a)
- };
- a.loadGroup = function(a, b) {
- void 0 === b && (b = 0);
- if ( - 1 != this.loadedGroups.indexOf(a)) c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, a);
- else if (!this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
- var d = this.resConfig.getGroupByName(a);
- this.resLoader.loadGroup(d, a, b)
- } else this.groupNameList.push({
- name: a,
- priority: b
- })
- };
- a.createGroup = function(a, b, c) {
- void 0 === c && (c = !1);
- if (c) {
- var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
- }
- return this.resConfig.createGroup(a, b, c)
- };
- a.onGroupComp = function(a) {
- if (a.groupName == b.GROUP_CONFIG) {
- a = this.loadingConfigList.length;
- for (var d = 0; d < a; d++) {
- var e = this.loadingConfigList[d],
- g = this.getAnalyzerByType(e.type),
- n = g.getRes(e.url);
- g.destroyRes(e.url);
- this.resConfig.parseConfig(n, e.resourceRoot)
- }
- this.configComplete = !0;
- this.loadingConfigList = null;
- c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
- this.loadDelayGroups()
- } else this.loadedGroups.push(a.groupName),
- this.dispatchEvent(a)
- };
- a.loadDelayGroups = function() {
- var a = this.groupNameList;
- this.groupNameList = [];
- for (var b = a.length,
- c = 0; c < b; c++) {
- var d = a[c];
- this.loadGroup(d.name, d.priority)
- }
- };
- a.onGroupError = function(a) {
- a.groupName == b.GROUP_CONFIG ? (this.loadingConfigList = null, c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
- };
- a.hasRes = function(a) {
- var b = this.resConfig.getType(a);
- return "" == b && (a = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(a), "" == b) ? !1 : !0
- };
- a.parseConfig = function(a, b) {
- this.resConfig.parseConfig(a, b);
- this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
- };
- a.getRes = function(a) {
- var b = this.resConfig.getType(a);
- return "" == b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(b), "" == b) ? null: this.getAnalyzerByType(b).getRes(a)
- };
- a.getResAsync = function(a, b, d) {
- var e = this.resConfig.getType(a),
- g = this.resConfig.getName(a);
- if ("" == e && (g = c.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(g), "" == e)) {
- b.call(d, null);
- return
- } (e = this.getAnalyzerByType(e).getRes(a)) ? b.call(d, e) : (a = {
- key: a,
- compFunc: b,
- thisObject: d
- },
- this.asyncDic[g] ? this.asyncDic[g].push(a) : (this.asyncDic[g] = [a], g = this.resConfig.getResourceItem(g), this.resLoader.loadItem(g)))
- };
- a.getResByUrl = function(a, b, d, e) {
- void 0 === e && (e = "");
- if (a) {
- e || (e = this.getTypeByUrl(a));
- var g = this.getAnalyzerByType(e).getRes(a);
- g ? b.call(d, g) : (b = {
- key: a,
- compFunc: b,
- thisObject: d
- },
- this.asyncDic[a] ? this.asyncDic[a].push(b) : (this.asyncDic[a] = [b], a = new c.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
- } else b.call(d, null)
- };
- a.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
- switch (a) {
- case c.ResourceItem.TYPE_XML:
- case c.ResourceItem.TYPE_JSON:
- case c.ResourceItem.TYPE_SHEET:
- break;
- case "png":
- case "jpg":
- case "gif":
- case "jpeg":
- case "bmp":
- a = c.ResourceItem.TYPE_IMAGE;
- break;
- case "fnt":
- a = c.ResourceItem.TYPE_FONT;
- break;
- case "txt":
- a = c.ResourceItem.TYPE_TEXT;
- break;
- case "mp3":
- case "ogg":
- case "mpeg":
- case "wav":
- case "m4a":
- case "mp4":
- case "aiff":
- case "wma":
- case "mid":
- a = c.ResourceItem.TYPE_SOUND;
- break;
- default:
- a = c.ResourceItem.TYPE_BIN
- }
- return a
- };
- a.onResourceItemComp = function(a) {
- var b = this.asyncDic[a.name];
- delete this.asyncDic[a.name];
- a = this.getAnalyzerByType(a.type);
- for (var c = b.length,
- d = 0; d < c; d++) {
- var e = b[d],
- g = a.getRes(e.key);
- e.compFunc.call(e.thisObject, g, e.key)
- }
- };
- a.destroyRes = function(a, b) {
- void 0 === b && (b = !0);
- var c = this.resConfig.getRawGroupByName(a);
- if (c && 0 < c.length) {
- var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
- for (var e = c.length,
- g = 0; g < e; g++) if (d = c[g], b || !this.isResInLoadedGroup(d.name)) {
- d.loaded = !1;
- var k = this.getAnalyzerByType(d.type);
- k.destroyRes(d.name);
- this.removeLoadedGroupsByItemName(d.name)
- }
- return ! 0
- }
- c = this.resConfig.getType(a);
- if ("" == c) return ! 1;
- d = this.resConfig.getRawResourceItem(a);
- d.loaded = !1;
- k = this.getAnalyzerByType(c);
- c = k.destroyRes(a);
- this.removeLoadedGroupsByItemName(d.name);
- return c
- };
- a.removeLoadedGroupsByItemName = function(a) {
- for (var b = this.loadedGroups,
- c = b.length,
- d = 0; d < c; d++) for (var e = this.resConfig.getRawGroupByName(b[d]), g = e.length, k = 0; k < g; k++) if (e[k].name == a) {
- b.splice(d, 1);
- d--;
- c = b.length;
- break
- }
- };
- a.isResInLoadedGroup = function(a) {
- for (var b = this.loadedGroups,
- c = b.length,
- d = 0; d < c; d++) for (var e = this.resConfig.getRawGroupByName(b[d]), g = e.length, k = 0; k < g; k++) if (e[k].name == a) return ! 0;
- return ! 1
- };
- a.setMaxLoadingThread = function(a) {
- 1 > a && (a = 1);
- this.resLoader.thread = a
- };
- a.setMaxRetryTimes = function(a) {
- a = Math.max(a, 0);
- this.resLoader.maxRetryTimes = a
- };
- b.GROUP_CONFIG = "RES__CONFIG";
- return b
- } (egret.EventDispatcher);
- g.prototype.__class__ = "RES.Resource";
- var e = new g
- })(RES || (RES = {}));
- var egret_4399_h5api = function() {
- return {
- initGame: function(c, g, e, d) {
-
- },
- progress: function(c) {
-
- },
- isWeixinBrowser: function() {
- return;
- },
- share: function(c) {
- dp_share();
- },
- moreGame: function() {
- clickMore();
- },
- submitScore: function(c, g, e) {
- dp_submitScore(c);
- },
- getRank: function(c, g) {
-
- }
- }
- } (),
- map = function(c) {
- function g() {
- c.call(this);
- var e = new egret.Bitmap(RES.getRes("bg"));
- this.addChild(e);
- e = new egret.Bitmap(RES.getRes("bg"));
- this.addChild(e);
- e.y = e.height;
- var d = new egret.Shape;
- d.graphics.beginFill(13685240, 1);
- d.graphics.drawRect(0, 0, 480, 20);
- d.graphics.endFill();
- this.addChild(d);
- d.y = e.y - 10
- }
- __extends(g, c);
- return g
- } (egret.Sprite);
- map.prototype.__class__ = "map";
- var Game = function(c) {
- function g() {
- c.call(this);
- this.speed = 0.1;
- this.speedsteps = 0.2;
- this.endPoint = -1;
- this.score = 0;
- this.scoretext = new egret.BitmapText;
- this.level = 0;
- this.fx = new egret.Shape;
- g.self = this;
- this.player = new man;
- this.bgmap = new map;
- this.gameEnemy = new enemy(this.player);
- this.fx.graphics.beginFill(16777215, 1);
- this.fx.graphics.drawRect(0, 0, 480, 800);
- this.fx.graphics.endFill();
- this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
- }
- __extends(g, c);
- var e = g.prototype;
- e.onAddToStage = function(c) {
- this.addChild(this.bgmap);
- c = new egret.Bitmap(RES.getRes("top"));
- c.y = 30;
- c.x = (this.stage.stageWidth - c.width) / 2;
- var b = RES.getRes("text");
- this.scoretext.font = b;
- this.scoretext.x = c.x + 100;
- this.scoretext.y = c.y + 14;
- this.scoretext.text = "0";
- this.addChild(this.gameEnemy);
- this.addChild(c);
- this.addChild(this.scoretext);
- this.addChild(this.player);
- this.gameEnemy.addEventListener("gameover", this.gameover, this);
- this.player.x = this.stage.width / 2 - 80;
- this.player.y = 200;
- this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
- this.addEventListener(egret.Event.ENTER_FRAME, this.GameEnterFrames, this)
- };
- e.onTouchBegin = function(c) {
- this.player.open();
- this.endPoint = 0 < this.player.y - 100 ? this.player.y - 100 : 0
- };
- e.gameover = function(c) {
- this.removeEventListener(egret.Event.ENTER_FRAME, this.GameEnterFrames, this);
- this.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
- this.gameEnemy.stop();
- this.stage.addChild(this.fx);
- this.fx.alpha = 0;
- var b = this;
- egret.Tween.get(this.fx).to({
- alpha: 1
- },
- 80).call(function() {
- egret.Tween.get(b.fx).to({
- alpha: 0
- },
- 260);
- egret.Tween.get(b.player).to({
- y: 800
- },
- 500).call(function() {
- b.dispatchEvent(new egret.Event("over", !1, !1))
- })
- })
- };
- e.changelevel = function() {
- 0 == this.score % 80 && 0 < this.score && 8 >= this.level && (this.level += 0.1)
- };
- e.GameEnterFrames = function(c) {
- this.changelevel();
- if ( - 1 >= this.endPoint) 10 > this.speed && (this.speed += this.speedsteps),
- 350 > this.player.y ? this.player.y += this.speed: (this.score += 1, this.scoretext.text = this.score.toString()),
- this.maprun(this.speed),
- this.gameEnemy.speed = this.speed;
- else if (this.player.y -= (this.player.y - this.endPoint) / 10, this.gameEnemy.speed = 0, this.player.y <= this.endPoint + 4 || 0 >= this.player.y) this.speed = 0.1,
- this.endPoint = -1,
- this.player.close()
- };
- e.maprun = function(c) {
- this.bgmap.y -= c;
- this.bgmap.y <= -this.stage.stageHeight && (this.bgmap.y = -(Math.abs(this.bgmap.y) - this.stage.stageHeight))
- };
- return g
- } (egret.Sprite);
- Game.prototype.__class__ = "Game";
- var man = function(c) {
- function g() {
- c.call(this);
- this.p = new egret.Bitmap;
- this.addChild(this.p);
- this.p.texture = RES.getRes("man_close");
- this.p.name = "close"
- }
- __extends(g, c);
- var e = g.prototype;
- e.open = function() {
- this.p.texture = RES.getRes("man_open")
- };
- e.close = function() {
- this.p.texture = RES.getRes("man_close")
- };
- return g
- } (egret.Sprite);
- man.prototype.__class__ = "man";
- var overview = function(c) {
- function g(e) {
- c.call(this);
- this.scoretext = new egret.BitmapText;
- this.scoretext2 = new egret.BitmapText;
- var d = new egret.Shape;
- d.graphics.beginFill(0, 0.6);
- d.graphics.drawRect(0, 0, 480, 800);
- d.graphics.endFill();
- this.addChild(d);
- d = new egret.Bitmap(RES.getRes("over"));
- this.addChild(d);
- var b = new egret.Bitmap(RES.getRes("top"));
- b.y = 380;
- b.x = (480 - b.width) / 2;
- d = RES.getRes("text");
- this.scoretext.font = d;
- this.scoretext.x = b.x + 100;
- this.scoretext.y = b.y + 14;
- this.scoretext.text = e.toString();
- this.addChild(b);
- this.addChild(this.scoretext);
- d = new egret.Bitmap(RES.getRes("over"));
- this.addChild(d);
- b = new egret.Bitmap(RES.getRes("pm"));
- b.y = 440;
- b.x = (480 - b.width) / 2;
- d = RES.getRes("text");
- this.scoretext2.font = d;
- this.scoretext2.x = b.x + 200;
- this.scoretext2.y = b.y + 14;
- var a = this;
- egret_4399_h5api.submitScore(e,
- function() {
-
- },
- this)
- }
- __extends(g, c);
- return g
- } (egret.Sprite);
- overview.prototype.__class__ = "overview";
- var startview = function(c) {
- function g() {
- c.call(this);
- this.top = new egret.Bitmap(RES.getRes("start_top"));
- this.bottom = new egret.Bitmap(RES.getRes("start_bottom"));
- this.bottom.y = this.top.height;
- this.bg = new map;
- this.addChild(this.bg);
- this.addEventListener(egret.Event.ENTER_FRAME, this.onFrame, this);
- this.addChild(this.top);
- this.addChild(this.bottom)
- }
- __extends(g, c);
- var e = g.prototype;
- e.onFrame = function(c) {
- this.bg.y -= 5; - 800 >= this.bg.y && (this.bg.y = -(Math.abs(this.bg.y) - 800))
- };
- e.over = function(c) {
- var b = this;
- egret.Tween.get(this.top).to({
- y: -this.top.height
- },
- 400);
- egret.Tween.get(this.bottom).to({
- y: 800
- },
- 400).call(function() {
- b.removeEventListener(egret.Event.ENTER_FRAME, b.onFrame, b);
- c()
- })
- };
- return g
- } (egret.Sprite);
- startview.prototype.__class__ = "startview";
- var enemy = function(c) {
- function g(d) {
- c.call(this);
- this.list = [];
- this.speed = -1;
- this.player = d;
- this.addEventListener(egret.Event.ENTER_FRAME, this.onEnemyFrames, this)
- }
- __extends(g, c);
- var e = g.prototype;
- e.stop = function() {
- this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnemyFrames, this)
- };
- e.onEnemyFrames = function(c) {
- if (0 < this.list.length) for (3 != this.list[this.list.length - 1].id && this.list[this.list.length - 1].y < 500 + 20 * Game.self.level && this.createEnemy(), c = 0; c < this.list.length; c++) {
- this.list[c].play();
- this.list[c].y -= this.speed;
- if (this.list[c].hit(this.player, this.list[c].y)) {
- // alert("结束"+parseInt(Game.self.scoretext.text));
-
- this.dispatchEvent(new egret.Event("gameover", !1, !1));
- break
- }
- this.list[c].y < -this.list[c].height && (console.log("delete"), this.removeChild(this.list[c]), this.list.splice(c, 1), Game.self.score += 100, Game.self.scoretext.text = Game.self.score.toString())
- } else this.createEnemy()
- };
- e.createEnemy = function() {
- this.list.push(new prop);
- this.list[this.list.length - 1].y = 900;
- this.addChild(this.list[this.list.length - 1])
- };
- return g
- } (egret.Sprite);
- enemy.prototype.__class__ = "enemy";
- var prop = function(c) {
- function g(d) {
- c.call(this);
- this.list = [];
- this.on = !1;
- this.delay = 60;
- this.mfStop = 30;
- this.speed = 3;
- this.fd_x = this.angle = 0;
- d ? this.id = d: this.id = Math.floor(3 * Math.random());
- switch (this.id) {
- case 0:
- d = new egret.Bitmap(RES.getRes("z0"));
- this.addChild(d);
- d.x = -d.width;
- this.list.push(d);
- d = new egret.Bitmap(RES.getRes("z0"));
- d.scaleX = -1;
- d.anchorX = 1;
- d.x = 480;
- this.addChild(d);
- this.list.push(d);
- break;
- case 1:
- d = new egret.Bitmap(RES.getRes("line"));
- this.addChild(d);
- d = new egret.Bitmap(RES.getRes("z1"));
- this.list.push(d);
- this.addChild(d);
- d.anchorX = 0.5;
- d.y = -25;
- this.speed = 3 + Game.self.level;
- this.list[0].x = 800;
- this.delay = 0;
- break;
- case 2:
- d = new egret.Bitmap;
- d.texture = RES.getRes("z2");
- this.addChild(d);
- d.anchorX = 0.5;
- this.list.push(d);
- this.speed = 3 + Game.self.level;
- d.x = -400;
- break;
- case 3:
- d = new egret.Bitmap(RES.getRes("z3")),
- d.anchorX = d.anchorY = 0.5,
- this.addChild(d),
- this.fd_x = 0 == Math.floor(2 * Math.random()) ? this.fd_x = 0 : this.fd_x = 480,
- d.x = this.fd_x,
- this.list.push(d),
- this.radius = 240
- }
- }
- __extends(g, c);
- var e = g.prototype;
- e.hit = function(c, b) {
- switch (this.id) {
- case 0:
- if (c.y >= b - (c.height - this.height) && c.y <= b + this.list[0].height - c.height / 2 && -20 < this.list[0].x) return console.log("hit 0"),
- !0;
- break;
- case 1:
- if (c.y >= b - (c.height - this.height) && c.y <= b + this.list[0].height - c.height / 2 && 145 < this.list[0].x && 335 > this.list[0].x) return ! 0;
- break;
- case 2:
- if (c.y >= b - (c.height - this.list[0].height) + this.list[0].y && c.y <= b + this.list[0].height + this.list[0].y && 160 < this.list[0].x && 310 > this.list[0].x) return ! 0;
- break;
- case 3:
- if (210 < this.list[0].x && 280 > this.list[0].x && c.y > b + this.list[0].y - this.list[0].height / 3 && c.y < b + this.list[0].y + this.list[0].height / 3) return ! 0
- }
- return ! 1
- };
- e.play = function() {
- switch (this.id) {
- case 0:
- this.on ? (this.list[0].x -= (this.list[0].x + 250) / (18 - Game.self.level), this.list[1].x += (490 - this.list[1].x) / (18 - Game.self.level), this.list[0].x <= -this.list[0].width && (this.on = !1)) : (this.list[0].x += (10 - this.list[0].x) / (18 - Game.self.level), this.list[1].x -= (this.list[1].x - 230) / (18 - Game.self.level), 0 <= this.list[0].x && (this.on = !0));
- break;
- case 1:
- 0 == this.delay ? (0 == Math.floor(2 * Math.random()) ? (this.list[0].x = 480, this.list[0].scaleX = 1, this.on = !1, this.speed = -Math.abs(this.speed)) : (this.list[0].x = -this.list[0].width, this.list[0].scaleX = -1, this.speed = Math.abs(this.speed), this.on = !0), this.list[0].x += this.speed) : 0 > this.delay && (this.list[0].x += this.speed, this.on && this.list[0].x >= 480 + this.list[0].width && (this.delay = 100 - 10 * Game.self.level), !this.on && this.list[0].x <= -this.list[0].width && (this.delay = 100 - 10 * Game.self.level));
- this.delay -= 1;
- break;
- case 2:
- 0 == this.delay ? (0 == Math.floor(2 * Math.random()) ? (this.list[0].x = 480, this.list[0].scaleX = 1, this.on = !1, this.speed = -Math.abs(this.speed)) : (this.list[0].x = -this.list[0].width, this.list[0].scaleX = -1, this.speed = Math.abs(this.speed), this.on = !0), this.list[0].x += this.speed) : 0 >= this.delay && (this.list[0].y = 50 * Math.sin(this.angle), this.angle += 0.1, this.list[0].x += this.speed, this.on && this.list[0].x >= 480 + this.list[0].width && (this.delay = 10 * Game.self.level), !this.on && this.list[0].x <= -this.list[0].width && (this.delay = 10 * Game.self.level));
- this.delay -= 1;
- break;
- case 3:
- this.list[0].x = this.fd_x + Math.sin(this.angle) * this.radius,
- this.list[0].y = Math.cos(this.angle) * this.radius,
- this.angle += 0.02
- }
- };
- return g
- } (egret.Sprite);
- prop.prototype.__class__ = "prop";
- var Main = function(c) {
- function g() {
- c.call(this);
- this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
- }
- __extends(g, c);
- var e = g.prototype;
- e.onAddToStage = function(c) {
- RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
- RES.loadConfig("resource/resource.json", "resource/");
- egret_4399_h5api.initGame(100040989, "\u5c0f\u56e7\u718a\u8df3\u4f1e", this.stage.stageWidth, this.stage.stageHeight)
- };
- e.onConfigComplete = function(c) {
- RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
- RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
- RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
- RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
- RES.loadGroup("preload")
- };
- e.onResourceLoadComplete = function(c) {
- "preload" == c.groupName && (this.startview = new startview, this.stage.addChild(this.startview), this.startview.touchEnabled = !0, this.startview.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this))
- };
- e.onTouch = function(c) {
- c = new egret.Sound;
- c = RES.getRes("bgss");
- c.play(!0);
- var b = this;
- this.startview.over(function() {
- //alert("开始");
-
- b.stage.removeChild(b.startview);
- b.game = new Game;
- b.addChild(b.game);
- b.game.addEventListener("over", b.over, b)
- })
- };
- e.over = function(c) {
- updateShare(this.game.score);
- Play68.setRankingScoreDesc(this.game.score);
- this.overs = new overview(this.game.score);
- this.stage.addChild(this.overs);
- this.overs.touchEnabled = !0;
- this.overs.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rstart, this)
- };
- e.rstart = function(c) {
- //alert("再来一次");
-
- console.log(c.stageX, c.stageY);
- 540 > c.stageY || 150 > c.stageX || 340 < c.stageX || 620 < c.stageY || (console.log("rstart"), this.stage.removeChild(this.overs), this.over = null, this.removeChild(this.game), this.game = null, this.game = new Game, this.game.addEventListener("over", this.over2, this), this.addChild(this.game))
- if((c.stageX>185&&c.stageY> 640)&&(c.stageX<290&&c.stageY<680)){
- play68_submitScore(this.game.score);
- }
- if((c.stageX>185&&c.stageY> 725)&&(c.stageX<290&&c.stageY<750)){
- clickMore();
- }
- };
- e.over2 = function(c) {
- updateShare(this.game.score);
- Play68.setRankingScoreDesc(this.game.score);
- this.overs = new overview(this.game.score);
- this.stage.addChild(this.overs);
- this.overs.touchEnabled = !0;
- this.overs.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.rstart, this)
- };
- e.onResourceLoadError = function(c) {
- console.warn("Group:" + c.groupName + " has failed to load");
- this.onResourceLoadComplete(c)
- };
- e.onResourceProgress = function(c) {
- "preload" == c.groupName && egret_4399_h5api.progress(c.itemsLoaded / c.itemsTotal * 100)
- };
- return g
- } (egret.DisplayObjectContainer);
- Main.prototype.__class__ = "Main";
|