game-min.js 340 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689
  1. var egret;
  2. (function(b) {
  3. var e = function() {
  4. function b() {
  5. this._hashCode = b.hashCount++
  6. }
  7. Object.defineProperty(b.prototype, "hashCode", {
  8. get: function() {
  9. return this._hashCode
  10. },
  11. enumerable: !0,
  12. configurable: !0
  13. });
  14. b.hashCount = 1;
  15. return b
  16. }();
  17. b.HashObject = e;
  18. e.prototype.__class__ = "egret.HashObject"
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends || function(b, e) {
  21. function d() {
  22. this.constructor = b
  23. }
  24. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  25. d.prototype = e.prototype;
  26. b.prototype = new d
  27. };
  28. (function(b) {
  29. var e = function(b) {
  30. function a(c) {
  31. void 0 === c && (c = 300);
  32. b.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > c && (c = 1);
  36. this.autoDisposeTime = c;
  37. this.frameCount = 0
  38. }
  39. __extends(a, b);
  40. a.prototype._checkFrame = function() {
  41. this.frameCount--;
  42. 0 >= this.frameCount && this.dispose()
  43. };
  44. Object.defineProperty(a.prototype, "length", {
  45. get: function() {
  46. return this._length
  47. },
  48. enumerable: !0,
  49. configurable: !0
  50. });
  51. a.prototype.push = function(c) {
  52. var l = this.objectPool; - 1 == l.indexOf(c) && (l.push(c), this._length++, 0 == this.frameCount && (this.frameCount =
  53. this.autoDisposeTime, a._callBackList.push(this)))
  54. };
  55. a.prototype.pop = function() {
  56. if (0 == this._length) return null;
  57. this._length--;
  58. return this.objectPool.pop()
  59. };
  60. a.prototype.dispose = function() {
  61. 0 < this._length && (this.objectPool = [], this._length = 0);
  62. this.frameCount = 0;
  63. var c = a._callBackList,
  64. l = c.indexOf(this); - 1 != l && c.splice(l, 1)
  65. };
  66. a._callBackList = [];
  67. return a
  68. }(b.HashObject);
  69. b.Recycler = e;
  70. e.prototype.__class__ = "egret.Recycler"
  71. })(egret || (egret = {}));
  72. (function(b) {
  73. b.__START_TIME;
  74. b.getTimer = function() {
  75. return Date.now() - b.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(b) {
  79. b.__callLaterFunctionList = [];
  80. b.__callLaterThisList = [];
  81. b.__callLaterArgsList = [];
  82. b.callLater = function(e, d) {
  83. for (var a = [], c = 2; c < arguments.length; c++) a[c - 2] = arguments[c];
  84. b.__callLaterFunctionList.push(e);
  85. b.__callLaterThisList.push(d);
  86. b.__callLaterArgsList.push(a)
  87. };
  88. b.__callAsyncFunctionList = [];
  89. b.__callAsyncThisList = [];
  90. b.__callAsyncArgsList = [];
  91. b.__callAsync = function(e, d) {
  92. for (var a = [], c = 2; c < arguments.length; c++) a[c - 2] = arguments[c];
  93. b.__callAsyncFunctionList.push(e);
  94. b.__callAsyncThisList.push(d);
  95. b.__callAsyncArgsList.push(a)
  96. }
  97. })(egret || (egret = {}));
  98. var egret_dom;
  99. (function(b) {
  100. function e() {
  101. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], c = 0; c < a.length; c++)
  102. if (a[c] + "ransform" in b) return a[c];
  103. return a[0]
  104. }
  105. b.header = "";
  106. b.getHeader = e;
  107. b.getTrans = function(d) {
  108. "" == b.header && (b.header = e());
  109. return b.header + d.substring(1, d.length)
  110. }
  111. })(egret_dom || (egret_dom = {}));
  112. __extends = this.__extends || function(b, e) {
  113. function d() {
  114. this.constructor = b
  115. }
  116. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  117. d.prototype = e.prototype;
  118. b.prototype = new d
  119. };
  120. (function(b) {
  121. var e = function(d) {
  122. function a(c, a, g) {
  123. void 0 === a && (a = !1);
  124. void 0 === g && (g = !1);
  125. d.call(this);
  126. this._eventPhase = 2;
  127. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  128. this.isNew = !0;
  129. this._type = c;
  130. this._bubbles = a;
  131. this._cancelable = g
  132. }
  133. __extends(a, d);
  134. Object.defineProperty(a.prototype, "type", {
  135. get: function() {
  136. return this._type
  137. },
  138. enumerable: !0,
  139. configurable: !0
  140. });
  141. Object.defineProperty(a.prototype, "bubbles", {
  142. get: function() {
  143. return this._bubbles
  144. },
  145. enumerable: !0,
  146. configurable: !0
  147. });
  148. Object.defineProperty(a.prototype, "cancelable", {
  149. get: function() {
  150. return this._cancelable
  151. },
  152. enumerable: !0,
  153. configurable: !0
  154. });
  155. Object.defineProperty(a.prototype, "eventPhase", {
  156. get: function() {
  157. return this._eventPhase
  158. },
  159. enumerable: !0,
  160. configurable: !0
  161. });
  162. Object.defineProperty(a.prototype, "currentTarget", {
  163. get: function() {
  164. return this._currentTarget
  165. },
  166. enumerable: !0,
  167. configurable: !0
  168. });
  169. Object.defineProperty(a.prototype, "target", {
  170. get: function() {
  171. return this._target
  172. },
  173. enumerable: !0,
  174. configurable: !0
  175. });
  176. a.prototype.isDefaultPrevented =
  177. function() {
  178. return this._isDefaultPrevented
  179. };
  180. a.prototype.preventDefault = function() {
  181. this._cancelable && (this._isDefaultPrevented = !0)
  182. };
  183. a.prototype.stopPropagation = function() {
  184. this._bubbles && (this._isPropagationStopped = !0)
  185. };
  186. a.prototype.stopImmediatePropagation = function() {
  187. this._bubbles && (this._isPropagationImmediateStopped = !0)
  188. };
  189. a.prototype._reset = function() {
  190. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target =
  191. null, this._eventPhase = 2)
  192. };
  193. a._dispatchByTarget = function(c, a, g, d, e, f) {
  194. void 0 === e && (e = !1);
  195. void 0 === f && (f = !1);
  196. var k = c.eventRecycler;
  197. k || (k = c.eventRecycler = new b.Recycler);
  198. var m = k.pop();
  199. m ? m._type = g : m = new c(g);
  200. m._bubbles = e;
  201. m._cancelable = f;
  202. if (d)
  203. for (var p in d) m[p] = d[p], null !== m[p] && (d[p] = null);
  204. c = a.dispatchEvent(m);
  205. k.push(m);
  206. return c
  207. };
  208. a._getPropertyData = function(c) {
  209. var a = c._props;
  210. a || (a = c._props = {});
  211. return a
  212. };
  213. a.dispatchEvent = function(c, l, g, b) {
  214. void 0 === g && (g = !1);
  215. var d = a._getPropertyData(a);
  216. b && (d.data = b);
  217. a._dispatchByTarget(a,
  218. c, l, d, g)
  219. };
  220. a.ADDED_TO_STAGE = "addedToStage";
  221. a.REMOVED_FROM_STAGE = "removedFromStage";
  222. a.ADDED = "added";
  223. a.REMOVED = "removed";
  224. a.COMPLETE = "complete";
  225. a.ENTER_FRAME = "enterFrame";
  226. a.RENDER = "render";
  227. a.FINISH_RENDER = "finishRender";
  228. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  229. a.LEAVE_STAGE = "leaveStage";
  230. a.RESIZE = "resize";
  231. a.CHANGE = "change";
  232. a.ACTIVATE = "activate";
  233. a.DEACTIVATE = "deactivate";
  234. a.CLOSE = "close";
  235. a.CONNECT = "connect";
  236. return a
  237. }(b.HashObject);
  238. b.Event = e;
  239. e.prototype.__class__ = "egret.Event"
  240. })(egret || (egret = {}));
  241. __extends = this.__extends || function(b, e) {
  242. function d() {
  243. this.constructor = b
  244. }
  245. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  246. d.prototype = e.prototype;
  247. b.prototype = new d
  248. };
  249. (function(b) {
  250. var e = function(b) {
  251. function a(c, a, g) {
  252. void 0 === a && (a = !1);
  253. void 0 === g && (g = !1);
  254. b.call(this, c, a, g);
  255. this._status = 0
  256. }
  257. __extends(a, b);
  258. Object.defineProperty(a.prototype, "status", {
  259. get: function() {
  260. return this._status
  261. },
  262. enumerable: !0,
  263. configurable: !0
  264. });
  265. a.dispatchHTTPStatusEvent = function(c, l) {
  266. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  267. a.httpStatusEvent._status = l;
  268. c.dispatchEvent(a.httpStatusEvent)
  269. };
  270. a.HTTP_STATUS = "httpStatus";
  271. a.httpStatusEvent = null;
  272. return a
  273. }(b.Event);
  274. b.HTTPStatusEvent =
  275. e;
  276. e.prototype.__class__ = "egret.HTTPStatusEvent"
  277. })(egret || (egret = {}));
  278. __extends = this.__extends || function(b, e) {
  279. function d() {
  280. this.constructor = b
  281. }
  282. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  283. d.prototype = e.prototype;
  284. b.prototype = new d
  285. };
  286. (function(b) {
  287. var e = function(d) {
  288. function a(c, a, g) {
  289. void 0 === a && (a = !1);
  290. void 0 === g && (g = !1);
  291. d.call(this, c, a, g)
  292. }
  293. __extends(a, d);
  294. a.dispatchIOErrorEvent = function(c) {
  295. b.Event._dispatchByTarget(a, c, a.IO_ERROR)
  296. };
  297. a.IO_ERROR = "ioError";
  298. return a
  299. }(b.Event);
  300. b.IOErrorEvent = e;
  301. e.prototype.__class__ = "egret.IOErrorEvent"
  302. })(egret || (egret = {}));
  303. __extends = this.__extends || function(b, e) {
  304. function d() {
  305. this.constructor = b
  306. }
  307. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  308. d.prototype = e.prototype;
  309. b.prototype = new d
  310. };
  311. (function(b) {
  312. var e = function(d) {
  313. function a(c, a, g, b, e, f, k, m, p, q) {
  314. void 0 === a && (a = !0);
  315. void 0 === g && (g = !0);
  316. void 0 === b && (b = 0);
  317. void 0 === e && (e = 0);
  318. void 0 === f && (f = 0);
  319. void 0 === k && (k = !1);
  320. void 0 === m && (m = !1);
  321. void 0 === q && (q = !1);
  322. d.call(this, c, a, g);
  323. this._stageY = this._stageX = 0;
  324. this.touchPointID = b;
  325. this._stageX = e;
  326. this._stageY = f;
  327. this.ctrlKey = k;
  328. this.altKey = m;
  329. this.touchDown = q
  330. }
  331. __extends(a, d);
  332. Object.defineProperty(a.prototype, "stageX", {
  333. get: function() {
  334. return this._stageX
  335. },
  336. enumerable: !0,
  337. configurable: !0
  338. });
  339. Object.defineProperty(a.prototype,
  340. "stageY", {
  341. get: function() {
  342. return this._stageY
  343. },
  344. enumerable: !0,
  345. configurable: !0
  346. });
  347. Object.defineProperty(a.prototype, "localX", {
  348. get: function() {
  349. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  350. },
  351. enumerable: !0,
  352. configurable: !0
  353. });
  354. Object.defineProperty(a.prototype, "localY", {
  355. get: function() {
  356. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  357. },
  358. enumerable: !0,
  359. configurable: !0
  360. });
  361. a.dispatchTouchEvent = function(c, l, g, d, e, f, k, m, p) {
  362. void 0 === g && (g = 0);
  363. void 0 === d && (d = 0);
  364. void 0 === e && (e = 0);
  365. void 0 === f && (f = !1);
  366. void 0 === k && (k = !1);
  367. void 0 === m && (m = !1);
  368. void 0 === p && (p = !1);
  369. var q = b.Event._getPropertyData(a);
  370. q.touchPointID = g;
  371. q._stageX = d;
  372. q._stageY = e;
  373. q.ctrlKey = f;
  374. q.altKey = k;
  375. q.shiftKey = m;
  376. q.touchDown = p;
  377. b.Event._dispatchByTarget(a, c, l, q, !0, !0)
  378. };
  379. a.TOUCH_TAP = "touchTap";
  380. a.TOUCH_MOVE = "touchMove";
  381. a.TOUCH_BEGIN = "touchBegin";
  382. a.TOUCH_END = "touchEnd";
  383. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  384. a.TOUCH_ROLL_OUT = "touchRollOut";
  385. a.TOUCH_ROLL_OVER = "touchRollOver";
  386. a.TOUCH_OUT =
  387. "touchOut";
  388. a.TOUCH_OVER = "touchOver";
  389. return a
  390. }(b.Event);
  391. b.TouchEvent = e;
  392. e.prototype.__class__ = "egret.TouchEvent"
  393. })(egret || (egret = {}));
  394. __extends = this.__extends || function(b, e) {
  395. function d() {
  396. this.constructor = b
  397. }
  398. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  399. d.prototype = e.prototype;
  400. b.prototype = new d
  401. };
  402. (function(b) {
  403. var e = function(d) {
  404. function a(c, a, g) {
  405. void 0 === a && (a = !1);
  406. void 0 === g && (g = !1);
  407. d.call(this, c, a, g)
  408. }
  409. __extends(a, d);
  410. a.dispatchTimerEvent = function(c, l) {
  411. b.Event._dispatchByTarget(a, c, l)
  412. };
  413. a.TIMER = "timer";
  414. a.TIMER_COMPLETE = "timerComplete";
  415. return a
  416. }(b.Event);
  417. b.TimerEvent = e;
  418. e.prototype.__class__ = "egret.TimerEvent"
  419. })(egret || (egret = {}));
  420. __extends = this.__extends || function(b, e) {
  421. function d() {
  422. this.constructor = b
  423. }
  424. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  425. d.prototype = e.prototype;
  426. b.prototype = new d
  427. };
  428. (function(b) {
  429. var e = function(d) {
  430. function a(c, a, g, b, e) {
  431. void 0 === a && (a = !1);
  432. void 0 === g && (g = !1);
  433. void 0 === b && (b = 0);
  434. void 0 === e && (e = 0);
  435. d.call(this, c, a, g);
  436. this.bytesLoaded = b;
  437. this.bytesTotal = e
  438. }
  439. __extends(a, d);
  440. a.dispatchProgressEvent = function(c, l, g, d) {
  441. void 0 === g && (g = 0);
  442. void 0 === d && (d = 0);
  443. b.Event._dispatchByTarget(a, c, l, {
  444. bytesLoaded: g,
  445. bytesTotal: d
  446. })
  447. };
  448. a.PROGRESS = "progress";
  449. a.SOCKET_DATA = "socketData";
  450. return a
  451. }(b.Event);
  452. b.ProgressEvent = e;
  453. e.prototype.__class__ = "egret.ProgressEvent"
  454. })(egret || (egret = {}));
  455. (function(b) {
  456. var e = function() {
  457. function b() {}
  458. b.CAPTURING_PHASE = 1;
  459. b.AT_TARGET = 2;
  460. b.BUBBLING_PHASE = 3;
  461. return b
  462. }();
  463. b.EventPhase = e;
  464. e.prototype.__class__ = "egret.EventPhase"
  465. })(egret || (egret = {}));
  466. __extends = this.__extends || function(b, e) {
  467. function d() {
  468. this.constructor = b
  469. }
  470. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  471. d.prototype = e.prototype;
  472. b.prototype = new d
  473. };
  474. (function(b) {
  475. var e = function(d) {
  476. function a(c) {
  477. void 0 === c && (c = null);
  478. d.call(this);
  479. this._eventTarget = c ? c : this
  480. }
  481. __extends(a, d);
  482. a.prototype.addEventListener = function(c, a, g, d, e) {
  483. void 0 === d && (d = !1);
  484. void 0 === e && (e = 0);
  485. "undefined" === typeof d && (d = !1);
  486. "undefined" === typeof e && (e = 0);
  487. a || b.Logger.fatal("addEventListener侦听函数不能为空");
  488. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  489. var f = d[c];
  490. f || (f = d[c] = []);
  491. this._insertEventBin(f, a, g, e)
  492. };
  493. a.prototype._insertEventBin = function(c, a, g, b, d) {
  494. void 0 === d && (d = void 0);
  495. for (var e = -1, k = c.length, m = 0; m < k; m++) {
  496. var p = c[m];
  497. if (p.listener === a && p.thisObject === g && p.display === d) return !1; - 1 == e && p.priority < b && (e = m)
  498. }
  499. a = {
  500. listener: a,
  501. thisObject: g,
  502. priority: b
  503. };
  504. d && (a.display = d); - 1 != e ? c.splice(e, 0, a) : c.push(a);
  505. return !0
  506. };
  507. a.prototype.removeEventListener = function(c, a, g, b) {
  508. void 0 === b && (b = !1);
  509. if (b = b ? this._captureEventsMap : this._eventsMap) {
  510. var d = b[c];
  511. d && (this._removeEventBin(d,
  512. a, g), 0 == d.length && delete b[c])
  513. }
  514. };
  515. a.prototype._removeEventBin = function(c, a, g, b) {
  516. void 0 === b && (b = void 0);
  517. for (var d = c.length, e = 0; e < d; e++) {
  518. var k = c[e];
  519. if (k.listener === a && k.thisObject === g && k.display === b) return c.splice(e, 1), !0
  520. }
  521. return !1
  522. };
  523. a.prototype.hasEventListener = function(c) {
  524. return this._eventsMap && this._eventsMap[c] || this._captureEventsMap && this._captureEventsMap[c]
  525. };
  526. a.prototype.willTrigger = function(c) {
  527. return this.hasEventListener(c)
  528. };
  529. a.prototype.dispatchEvent = function(c) {
  530. c._reset();
  531. c._target = this._eventTarget;
  532. c._currentTarget = this._eventTarget;
  533. return this._notifyListener(c)
  534. };
  535. a.prototype._notifyListener = function(c) {
  536. var a = 1 == c._eventPhase ? this._captureEventsMap : this._eventsMap;
  537. if (!a) return !0;
  538. a = a[c._type];
  539. if (!a) return !0;
  540. var g = a.length;
  541. if (0 == g) return !0;
  542. for (var a = a.concat(), b = 0; b < g; b++) {
  543. var d = a[b];
  544. d.listener.call(d.thisObject, c);
  545. if (c._isPropagationImmediateStopped) break
  546. }
  547. return !c._isDefaultPrevented
  548. };
  549. a.prototype.dispatchEventWith = function(c, a, g) {
  550. void 0 === a && (a = !1);
  551. b.Event.dispatchEvent(this, c, a, g)
  552. };
  553. return a
  554. }(b.HashObject);
  555. b.EventDispatcher = e;
  556. e.prototype.__class__ = "egret.EventDispatcher"
  557. })(egret || (egret = {}));
  558. __extends = this.__extends || function(b, e) {
  559. function d() {
  560. this.constructor = b
  561. }
  562. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  563. d.prototype = e.prototype;
  564. b.prototype = new d
  565. };
  566. (function(b) {
  567. var e = function(d) {
  568. function a() {
  569. d.call(this);
  570. this.reuseEvent = new b.Event("")
  571. }
  572. __extends(a, d);
  573. a.prototype.run = function() {
  574. b.Ticker.getInstance().run();
  575. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  576. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  577. this.touchContext.run()
  578. };
  579. a.prototype.renderLoop = function(c) {
  580. if (0 < b.__callLaterFunctionList.length) {
  581. var l = b.__callLaterFunctionList;
  582. b.__callLaterFunctionList = [];
  583. var g = b.__callLaterThisList;
  584. b.__callLaterThisList = [];
  585. var d = b.__callLaterArgsList;
  586. b.__callLaterArgsList = []
  587. }
  588. c = this.stage;
  589. var e = a.cachedEvent;
  590. e._type = b.Event.RENDER;
  591. this.dispatchEvent(e);
  592. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  593. l && this.doCallLaterList(l, g, d);
  594. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  595. l = this.rendererContext;
  596. l.onRenderStart();
  597. l.clearScreen();
  598. c._updateTransform();
  599. e._type = b.Event.FINISH_UPDATE_TRANSFORM;
  600. this.dispatchEvent(e);
  601. c._draw(l);
  602. e._type = b.Event.FINISH_RENDER;
  603. this.dispatchEvent(e);
  604. l.onRenderFinish()
  605. };
  606. a.prototype.broadcastEnterFrame = function(c) {
  607. c = this.reuseEvent;
  608. c._type = b.Event.ENTER_FRAME;
  609. this.dispatchEvent(c);
  610. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), g = a.length, d = 0; d < g; d++) {
  611. var e = a[d];
  612. c._target = e.display;
  613. c._currentTarget = e.display;
  614. e.listener.call(e.thisObject, c)
  615. }
  616. a = b.Recycler._callBackList;
  617. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  618. };
  619. a.prototype.broadcastRender = function() {
  620. var c = this.reuseEvent;
  621. c._type = b.Event.RENDER;
  622. for (var a = b.DisplayObject._renderCallBackList.concat(),
  623. g = a.length, d = 0; d < g; d++) {
  624. var e = a[d],
  625. f = e.display;
  626. c._target = f;
  627. c._currentTarget = f;
  628. e.listener.call(e.thisObject, c)
  629. }
  630. };
  631. a.prototype.doCallLaterList = function(c, a, g) {
  632. for (var b = c.length, d = 0; d < b; d++) {
  633. var e = c[d];
  634. null != e && e.apply(a[d], g[d])
  635. }
  636. };
  637. a.prototype.doCallAsyncList = function() {
  638. var c = b.__callAsyncFunctionList.concat(),
  639. a = b.__callAsyncThisList.concat(),
  640. g = b.__callAsyncArgsList.concat();
  641. b.__callAsyncFunctionList.length = 0;
  642. b.__callAsyncThisList.length = 0;
  643. for (var d = b.__callAsyncArgsList.length = 0; d < c.length; d++) {
  644. var e =
  645. c[d];
  646. null != e && e.apply(a[d], g[d])
  647. }
  648. };
  649. a.DEVICE_PC = "web";
  650. a.DEVICE_MOBILE = "native";
  651. a.RUNTIME_HTML5 = "runtime_html5";
  652. a.RUNTIME_NATIVE = "runtime_native";
  653. a.cachedEvent = new b.Event("");
  654. return a
  655. }(b.EventDispatcher);
  656. b.MainContext = e;
  657. e.prototype.__class__ = "egret.MainContext"
  658. })(egret || (egret = {}));
  659. var testDeviceType = function() {
  660. if (!this.navigator) return !0;
  661. var b = navigator.userAgent.toLowerCase();
  662. return -1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  663. },
  664. testRuntimeType = function() {
  665. return this.navigator ? !0 : !1
  666. };
  667. egret.MainContext.instance = new egret.MainContext;
  668. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  669. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5 : egret.MainContext.RUNTIME_NATIVE;
  670. delete testDeviceType;
  671. delete testRuntimeType;
  672. (function(b) {
  673. var e = function() {
  674. function d() {
  675. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  676. this._maxDeltaTime = 500;
  677. this._totalDeltaTime = 0
  678. }
  679. d.getInstance = function() {
  680. null == d.instance && (d.instance = new d);
  681. return d.instance
  682. };
  683. d.prototype.run = function() {
  684. b.Ticker.getInstance().register(this.update, this);
  685. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, b.MainContext.instance.stage.addChild(this._txt));
  686. var a = b.MainContext.instance;
  687. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  688. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  689. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  690. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  691. };
  692. d.prototype.onEnterFrame = function(a) {
  693. this._lastTime = b.getTimer()
  694. };
  695. d.prototype.onStartRender = function(a) {
  696. a = b.getTimer();
  697. this._logicPerformanceCost = a - this._lastTime;
  698. this._lastTime = a
  699. };
  700. d.prototype.onFinishUpdateTransform =
  701. function(a) {
  702. a = b.getTimer();
  703. this._updateTransformPerformanceCost = a - this._lastTime;
  704. this._lastTime = a
  705. };
  706. d.prototype.onFinishRender = function(a) {
  707. a = b.getTimer();
  708. this._renderPerformanceCost = a - this._lastTime;
  709. this._lastTime = a
  710. };
  711. d.prototype.update = function(a) {
  712. this._tick++;
  713. this._totalDeltaTime += a;
  714. if (this._totalDeltaTime >= this._maxDeltaTime) {
  715. a = (this._preDrawCount - 1).toString();
  716. var c = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  717. "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  718. this._txt.text = "draw:" + a + "\ncost:" + c + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  719. this._tick = this._totalDeltaTime = 0
  720. }
  721. this._preDrawCount = 0
  722. };
  723. d.prototype.onDrawImage = function() {
  724. this._preDrawCount++
  725. };
  726. return d
  727. }();
  728. b.Profiler = e;
  729. e.prototype.__class__ = "egret.Profiler"
  730. })(egret || (egret = {}));
  731. __extends = this.__extends || function(b, e) {
  732. function d() {
  733. this.constructor = b
  734. }
  735. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  736. d.prototype = e.prototype;
  737. b.prototype = new d
  738. };
  739. (function(b) {
  740. var e = function(d) {
  741. function a() {
  742. d.apply(this, arguments);
  743. this._timeScale = 1;
  744. this._paused = !1;
  745. this.callBackList = []
  746. }
  747. __extends(a, d);
  748. a.prototype.run = function() {
  749. b.__START_TIME = (new Date).getTime();
  750. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  751. };
  752. a.prototype.update = function(c) {
  753. var a = this.callBackList.concat(),
  754. g = a.length;
  755. c *= this._timeScale;
  756. c *= this._timeScale;
  757. for (var b = 0; b < g; b++) {
  758. var d = a[b];
  759. d.listener.call(d.thisObject, c)
  760. }
  761. };
  762. a.prototype.register = function(c, a, g) {
  763. void 0 === g &&
  764. (g = 0);
  765. this._insertEventBin(this.callBackList, c, a, g)
  766. };
  767. a.prototype.unregister = function(c, a) {
  768. this._removeEventBin(this.callBackList, c, a)
  769. };
  770. a.prototype.setTimeout = function(c, a, g) {
  771. for (var d = [], e = 3; e < arguments.length; e++) d[e - 3] = arguments[e];
  772. b.Logger.warning("Ticker#setTimeout方法即将废弃,请使用egret.setTimeout");
  773. b.setTimeout.apply(null, [c, a, g].concat(d))
  774. };
  775. a.prototype.setTimeScale = function(c) {
  776. this._timeScale = c
  777. };
  778. a.prototype.getTimeScale = function() {
  779. return this._timeScale
  780. };
  781. a.prototype.pause = function() {
  782. this._paused = !0
  783. };
  784. a.prototype.resume = function() {
  785. this._paused = !1
  786. };
  787. a.getInstance = function() {
  788. null == a.instance && (a.instance = new a);
  789. return a.instance
  790. };
  791. return a
  792. }(b.EventDispatcher);
  793. b.Ticker = e;
  794. e.prototype.__class__ = "egret.Ticker"
  795. })(egret || (egret = {}));
  796. (function(b) {
  797. var e = function() {
  798. function b() {}
  799. b.LEFT = "left";
  800. b.RIGHT = "right";
  801. b.CENTER = "center";
  802. b.JUSTIFY = "justify";
  803. b.CONTENT_JUSTIFY = "contentJustify";
  804. return b
  805. }();
  806. b.HorizontalAlign = e;
  807. e.prototype.__class__ = "egret.HorizontalAlign"
  808. })(egret || (egret = {}));
  809. (function(b) {
  810. var e = function() {
  811. function b() {}
  812. b.TOP = "top";
  813. b.BOTTOM = "bottom";
  814. b.MIDDLE = "middle";
  815. b.JUSTIFY = "justify";
  816. b.CONTENT_JUSTIFY = "contentJustify";
  817. return b
  818. }();
  819. b.VerticalAlign = e;
  820. e.prototype.__class__ = "egret.VerticalAlign"
  821. })(egret || (egret = {}));
  822. __extends = this.__extends || function(b, e) {
  823. function d() {
  824. this.constructor = b
  825. }
  826. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  827. d.prototype = e.prototype;
  828. b.prototype = new d
  829. };
  830. (function(b) {
  831. var e = function(d) {
  832. function a(c, a) {
  833. void 0 === a && (a = 0);
  834. d.call(this);
  835. this._currentCount = 0;
  836. this.delay = c;
  837. this.repeatCount = a
  838. }
  839. __extends(a, d);
  840. a.prototype.currentCount = function() {
  841. return this._currentCount
  842. };
  843. Object.defineProperty(a.prototype, "running", {
  844. get: function() {
  845. return this._running
  846. },
  847. enumerable: !0,
  848. configurable: !0
  849. });
  850. a.prototype.reset = function() {
  851. this.stop();
  852. this._currentCount = 0
  853. };
  854. a.prototype.start = function() {
  855. this._running || (this.lastTime = b.getTimer(), 0 != this._currentCount && (this._currentCount =
  856. 0), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  857. };
  858. a.prototype.stop = function() {
  859. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  860. };
  861. a.prototype.onEnterFrame = function(c) {
  862. c = b.getTimer();
  863. c - this.lastTime > this.delay && (this.lastTime = c, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER_COMPLETE)))
  864. };
  865. return a
  866. }(b.EventDispatcher);
  867. b.Timer = e;
  868. e.prototype.__class__ = "egret.Timer"
  869. })(egret || (egret = {}));
  870. (function(b) {
  871. function e(b) {
  872. b = b.prototype ? b.prototype : b.__proto__;
  873. if (b.hasOwnProperty("__class__")) return b.__class__;
  874. var a = b.constructor.toString(),
  875. c = a.indexOf("("),
  876. a = a.substring(9, c);
  877. Object.defineProperty(b, "__class__", {
  878. value: a,
  879. enumerable: !1,
  880. writable: !0
  881. });
  882. return a
  883. }
  884. b.getQualifiedClassName = e;
  885. b.getQualifiedSuperclassName = function(b) {
  886. b = b.prototype ? b.prototype : b.__proto__;
  887. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  888. var a = Object.getPrototypeOf(b);
  889. if (null == a) return null;
  890. a = e(a.constructor);
  891. if (!a) return null;
  892. Object.defineProperty(b, "__superclass__", {
  893. value: a,
  894. enumerable: !1,
  895. writable: !0
  896. });
  897. return a
  898. }
  899. })(egret || (egret = {}));
  900. (function(b) {
  901. var e = {};
  902. b.getDefinitionByName = function(b) {
  903. if (!b) return null;
  904. var a = e[b];
  905. if (a) return a;
  906. for (var c = b.split("."), l = c.length, a = __global, g = 0; g < l; g++)
  907. if (a = a[c[g]], !a) return null;
  908. return e[b] = a
  909. }
  910. })(egret || (egret = {}));
  911. var __global = __global || this;
  912. (function(b) {
  913. function e(c) {
  914. for (var a in d) {
  915. var b = d[a];
  916. b.delay -= c;
  917. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete d[a])
  918. }
  919. }
  920. var d = {},
  921. a = 0;
  922. b.setTimeout = function(c, l, g) {
  923. for (var n = [], h = 3; h < arguments.length; h++) n[h - 3] = arguments[h];
  924. n = {
  925. listener: c,
  926. thisObject: l,
  927. delay: g,
  928. params: n
  929. };
  930. 0 == a && b.Ticker.getInstance().register(e, null);
  931. a++;
  932. d[a] = n;
  933. return a
  934. };
  935. b.clearTimeout = function(c) {
  936. delete d[c]
  937. }
  938. })(egret || (egret = {}));
  939. (function(b) {
  940. b.hasDefinition = function(e) {
  941. return b.getDefinitionByName(e) ? !0 : !1
  942. }
  943. })(egret || (egret = {}));
  944. (function(b) {
  945. b.toColorString = function(b) {
  946. if (isNaN(b) || 0 > b) b = 0;
  947. 16777215 < b && (b = 16777215);
  948. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  949. return "#" + b
  950. }
  951. })(egret || (egret = {}));
  952. __extends = this.__extends || function(b, e) {
  953. function d() {
  954. this.constructor = b
  955. }
  956. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  957. d.prototype = e.prototype;
  958. b.prototype = new d
  959. };
  960. (function(b) {
  961. var e = function(d) {
  962. function a(c, a, b, e, h, f) {
  963. void 0 === c && (c = 1);
  964. void 0 === a && (a = 0);
  965. void 0 === b && (b = 0);
  966. void 0 === e && (e = 1);
  967. void 0 === h && (h = 0);
  968. void 0 === f && (f = 0);
  969. d.call(this);
  970. this.a = c;
  971. this.b = a;
  972. this.c = b;
  973. this.d = e;
  974. this.tx = h;
  975. this.ty = f
  976. }
  977. __extends(a, d);
  978. a.prototype.prepend = function(c, a, b, d, e, f) {
  979. var k = this.tx;
  980. if (1 != c || 0 != a || 0 != b || 1 != d) {
  981. var m = this.a,
  982. p = this.c;
  983. this.a = m * c + this.b * b;
  984. this.b = m * a + this.b * d;
  985. this.c = p * c + this.d * b;
  986. this.d = p * a + this.d * d
  987. }
  988. this.tx = k * c + this.ty * b + e;
  989. this.ty = k * a + this.ty * d + f;
  990. return this
  991. };
  992. a.prototype.append =
  993. function(c, a, b, d, e, f) {
  994. var k = this.a,
  995. m = this.b,
  996. p = this.c,
  997. q = this.d;
  998. if (1 != c || 0 != a || 0 != b || 1 != d) this.a = c * k + a * p, this.b = c * m + a * q, this.c = b * k + d * p, this.d = b * m + d * q;
  999. this.tx = e * k + f * p + this.tx;
  1000. this.ty = e * m + f * q + this.ty;
  1001. return this
  1002. };
  1003. a.prototype.prependTransform = function(c, l, b, d, e, f, k, m, p) {
  1004. if (e % 360) {
  1005. var q = e * a.DEG_TO_RAD;
  1006. e = Math.cos(q);
  1007. q = Math.sin(q)
  1008. } else e = 1, q = 0; if (m || p) this.tx -= m, this.ty -= p;
  1009. f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(e * b, q * b, -q * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f),
  1010. c, l)) : this.prepend(e * b, q * b, -q * d, e * d, c, l);
  1011. return this
  1012. };
  1013. a.prototype.appendTransform = function(c, l, b, d, e, f, k, m, p) {
  1014. if (e % 360) {
  1015. var q = e * a.DEG_TO_RAD;
  1016. e = Math.cos(q);
  1017. q = Math.sin(q)
  1018. } else e = 1, q = 0;
  1019. f || k ? (f *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(f), Math.cos(f), c, l), this.append(e * b, q * b, -q * d, e * d, 0, 0)) : this.append(e * b, q * b, -q * d, e * d, c, l);
  1020. if (m || p) this.tx -= m * this.a + p * this.c, this.ty -= m * this.b + p * this.d;
  1021. return this
  1022. };
  1023. a.prototype.rotate = function(c) {
  1024. var a = Math.cos(c);
  1025. c = Math.sin(c);
  1026. var b = this.a,
  1027. d = this.c,
  1028. e = this.tx;
  1029. this.a = b * a - this.b * c;
  1030. this.b = b * c + this.b * a;
  1031. this.c = d * a - this.d * c;
  1032. this.d = d * c + this.d * a;
  1033. this.tx = e * a - this.ty * c;
  1034. this.ty = e * c + this.ty * a;
  1035. return this
  1036. };
  1037. a.prototype.skew = function(c, l) {
  1038. c *= a.DEG_TO_RAD;
  1039. l *= a.DEG_TO_RAD;
  1040. this.append(Math.cos(l), Math.sin(l), -Math.sin(c), Math.cos(c), 0, 0);
  1041. return this
  1042. };
  1043. a.prototype.scale = function(c, a) {
  1044. this.a *= c;
  1045. this.d *= a;
  1046. this.c *= c;
  1047. this.b *= a;
  1048. this.tx *= c;
  1049. this.ty *= a;
  1050. return this
  1051. };
  1052. a.prototype.translate = function(c, a) {
  1053. this.tx += c;
  1054. this.ty += a;
  1055. return this
  1056. };
  1057. a.prototype.identity = function() {
  1058. this.a =
  1059. this.d = 1;
  1060. this.b = this.c = this.tx = this.ty = 0;
  1061. return this
  1062. };
  1063. a.prototype.identityMatrix = function(c) {
  1064. this.a = c.a;
  1065. this.b = c.b;
  1066. this.c = c.c;
  1067. this.d = c.d;
  1068. this.tx = c.tx;
  1069. this.ty = c.ty;
  1070. return this
  1071. };
  1072. a.prototype.invert = function() {
  1073. var c = this.a,
  1074. a = this.b,
  1075. b = this.c,
  1076. d = this.d,
  1077. e = this.tx,
  1078. f = c * d - a * b;
  1079. this.a = d / f;
  1080. this.b = -a / f;
  1081. this.c = -b / f;
  1082. this.d = c / f;
  1083. this.tx = (b * this.ty - d * e) / f;
  1084. this.ty = -(c * this.ty - a * e) / f;
  1085. return this
  1086. };
  1087. a.transformCoords = function(c, a, g) {
  1088. var d = b.Point.identity;
  1089. d.x = c.a * a + c.c * g + c.tx;
  1090. d.y = c.d * g + c.b * a + c.ty;
  1091. return d
  1092. };
  1093. a.prototype.toArray =
  1094. function(c) {
  1095. this.array || (this.array = new Float32Array(9));
  1096. c ? (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);
  1097. this.array[8] = 1;
  1098. return this.array
  1099. };
  1100. a.identity = new a;
  1101. a.DEG_TO_RAD = Math.PI / 180;
  1102. return a
  1103. }(b.HashObject);
  1104. b.Matrix = e;
  1105. e.prototype.__class__ =
  1106. "egret.Matrix"
  1107. })(egret || (egret = {}));
  1108. __extends = this.__extends || function(b, e) {
  1109. function d() {
  1110. this.constructor = b
  1111. }
  1112. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1113. d.prototype = e.prototype;
  1114. b.prototype = new d
  1115. };
  1116. (function(b) {
  1117. var e = function(b) {
  1118. function a(c, a) {
  1119. void 0 === c && (c = 0);
  1120. void 0 === a && (a = 0);
  1121. b.call(this);
  1122. this.x = c;
  1123. this.y = a
  1124. }
  1125. __extends(a, b);
  1126. a.prototype.clone = function() {
  1127. return new a(this.x, this.y)
  1128. };
  1129. a.prototype.equals = function(c) {
  1130. return this.x == c.x && this.y == c.y
  1131. };
  1132. a.distance = function(c, a) {
  1133. return Math.sqrt((c.x - a.x) * (c.x - a.x) + (c.y - a.y) * (c.y - a.y))
  1134. };
  1135. a.identity = new a(0, 0);
  1136. return a
  1137. }(b.HashObject);
  1138. b.Point = e;
  1139. e.prototype.__class__ = "egret.Point"
  1140. })(egret || (egret = {}));
  1141. __extends = this.__extends || function(b, e) {
  1142. function d() {
  1143. this.constructor = b
  1144. }
  1145. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1146. d.prototype = e.prototype;
  1147. b.prototype = new d
  1148. };
  1149. (function(b) {
  1150. var e = function(b) {
  1151. function a(c, a, g, e) {
  1152. void 0 === c && (c = 0);
  1153. void 0 === a && (a = 0);
  1154. void 0 === g && (g = 0);
  1155. void 0 === e && (e = 0);
  1156. b.call(this);
  1157. this.x = c;
  1158. this.y = a;
  1159. this.width = g;
  1160. this.height = e
  1161. }
  1162. __extends(a, b);
  1163. Object.defineProperty(a.prototype, "right", {
  1164. get: function() {
  1165. return this.x + this.width
  1166. },
  1167. set: function(c) {
  1168. this.width = c - this.x
  1169. },
  1170. enumerable: !0,
  1171. configurable: !0
  1172. });
  1173. Object.defineProperty(a.prototype, "bottom", {
  1174. get: function() {
  1175. return this.y + this.height
  1176. },
  1177. set: function(c) {
  1178. this.height = c - this.y
  1179. },
  1180. enumerable: !0,
  1181. configurable: !0
  1182. });
  1183. a.prototype.initialize = function(c, a, b, d) {
  1184. this.x = c;
  1185. this.y = a;
  1186. this.width = b;
  1187. this.height = d;
  1188. return this
  1189. };
  1190. a.prototype.contains = function(c, a) {
  1191. return this.x <= c && this.x + this.width >= c && this.y <= a && this.y + this.height >= a
  1192. };
  1193. a.prototype.intersects = function(c) {
  1194. var a = c.right,
  1195. b = c.bottom,
  1196. d = this.right,
  1197. e = this.bottom;
  1198. return this.contains(c.x, c.y) || this.contains(c.x, b) || this.contains(a, c.y) || this.contains(a, b) || c.contains(this.x, this.y) || c.contains(this.x, e) || c.contains(d, this.y) || c.contains(d, e) ? !0 : !1
  1199. };
  1200. a.prototype.clone =
  1201. function() {
  1202. return new a(this.x, this.y, this.width, this.height)
  1203. };
  1204. a.prototype.containsPoint = function(c) {
  1205. return this.x < c.x && this.x + this.width > c.x && this.y < c.y && this.y + this.height > c.y ? !0 : !1
  1206. };
  1207. a.identity = new a(0, 0, 0, 0);
  1208. return a
  1209. }(b.HashObject);
  1210. b.Rectangle = e;
  1211. e.prototype.__class__ = "egret.Rectangle"
  1212. })(egret || (egret = {}));
  1213. (function(b) {
  1214. var e = function() {
  1215. function d() {}
  1216. d.fatal = function(a, c) {
  1217. void 0 === c && (c = null);
  1218. b.Logger.traceToConsole("Fatal", a, c);
  1219. throw Error(b.Logger.getTraceCode("Fatal", a, c));
  1220. };
  1221. d.info = function(a, c) {
  1222. void 0 === c && (c = null);
  1223. b.Logger.traceToConsole("Info", a, c)
  1224. };
  1225. d.warning = function(a, c) {
  1226. void 0 === c && (c = null);
  1227. b.Logger.traceToConsole("Warning", a, c)
  1228. };
  1229. d.traceToConsole = function(a, c, l) {
  1230. console.log(b.Logger.getTraceCode(a, c, l))
  1231. };
  1232. d.getTraceCode = function(a, c, l) {
  1233. return "[" + a + "]" + c + ":" + (null == l ? "" : l)
  1234. };
  1235. return d
  1236. }();
  1237. b.Logger =
  1238. e;
  1239. e.prototype.__class__ = "egret.Logger"
  1240. })(egret || (egret = {}));
  1241. __extends = this.__extends || function(b, e) {
  1242. function d() {
  1243. this.constructor = b
  1244. }
  1245. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1246. d.prototype = e.prototype;
  1247. b.prototype = new d
  1248. };
  1249. (function(b) {
  1250. var e = function(d) {
  1251. function a() {
  1252. d.call(this);
  1253. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1254. this._xmlDict = {};
  1255. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1256. }
  1257. __extends(a, d);
  1258. a.getInstance = function() {
  1259. a._instance || (a._instance = new a);
  1260. return a._instance
  1261. };
  1262. a.prototype.parserXML = function(c) {
  1263. for (var a = 0;
  1264. "\n" == c.charAt(a) || "\t" == c.charAt(a) || "\r" == c.charAt(a) || " " == c.charAt(a);) a++;
  1265. 0 != a && (c = c.substring(a, c.length));
  1266. this._isSupportDOMParser ?
  1267. a = this._parser.parseFromString(c, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(c));
  1268. null == a && b.Logger.info("xml not found!");
  1269. return a
  1270. };
  1271. a._instance = null;
  1272. return a
  1273. }(b.HashObject);
  1274. b.SAXParser = e;
  1275. e.prototype.__class__ = "egret.SAXParser"
  1276. })(egret || (egret = {}));
  1277. __extends = this.__extends || function(b, e) {
  1278. function d() {
  1279. this.constructor = b
  1280. }
  1281. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1282. d.prototype = e.prototype;
  1283. b.prototype = new d
  1284. };
  1285. (function(b) {
  1286. var e = function(c) {
  1287. function l() {
  1288. c.call(this);
  1289. this._designHeight = this._designWidth = 0;
  1290. this._scaleY = this._scaleX = 1;
  1291. this._stageHeight = this._stageWidth = this._offSetY = 0
  1292. }
  1293. __extends(l, c);
  1294. l.getInstance = function() {
  1295. null == l.instance && (a.initialize(), l.instance = new l);
  1296. return l.instance
  1297. };
  1298. l.prototype.setDesignSize = function(c, a, l) {
  1299. this._designWidth = c;
  1300. this._designHeight = a;
  1301. l && (b.Logger.warning("该方法目前不应传入 resolutionPolicy 参数,请在 docs/1.0_Final_ReleaseNote中查看如何升级"),
  1302. this._setResolutionPolicy(l))
  1303. };
  1304. l.prototype._setResolutionPolicy = function(c) {
  1305. this._resolutionPolicy = c;
  1306. c.init(this);
  1307. c._apply(this, this._designWidth, this._designHeight)
  1308. };
  1309. l.prototype.getScaleX = function() {
  1310. return this._scaleX
  1311. };
  1312. l.prototype.getScaleY = function() {
  1313. return this._scaleY
  1314. };
  1315. l.prototype.getOffSetY = function() {
  1316. return this._offSetY
  1317. };
  1318. l.canvas_name = "egretCanvas";
  1319. l.canvas_div_name = "gameDiv";
  1320. return l
  1321. }(b.HashObject);
  1322. b.StageDelegate = e;
  1323. e.prototype.__class__ = "egret.StageDelegate";
  1324. var d = function() {
  1325. function c(a,
  1326. l) {
  1327. this._containerStrategy = a;
  1328. this._contentStrategy = l
  1329. }
  1330. c.prototype.init = function(c) {
  1331. this._containerStrategy.init(c);
  1332. this._contentStrategy.init(c)
  1333. };
  1334. c.prototype._apply = function(c, a, l) {
  1335. this._containerStrategy._apply(c, a, l);
  1336. this._contentStrategy._apply(c, a, l)
  1337. };
  1338. return c
  1339. }();
  1340. b.ResolutionPolicy = d;
  1341. d.prototype.__class__ = "egret.ResolutionPolicy";
  1342. var a = function() {
  1343. function a() {}
  1344. a.initialize = function() {
  1345. a.EQUAL_TO_FRAME = new c
  1346. };
  1347. a.prototype.init = function(c) {};
  1348. a.prototype._apply = function(c, a, l) {};
  1349. a.prototype._setupContainer =
  1350. function() {
  1351. var c = document.body,
  1352. a;
  1353. c && (a = c.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1354. };
  1355. return a
  1356. }();
  1357. b.ContainerStrategy = a;
  1358. a.prototype.__class__ = "egret.ContainerStrategy";
  1359. var c = function(c) {
  1360. function a() {
  1361. c.apply(this, arguments)
  1362. }
  1363. __extends(a, c);
  1364. a.prototype._apply = function(c) {
  1365. this._setupContainer()
  1366. };
  1367. return a
  1368. }(a);
  1369. b.EqualToFrame = c;
  1370. c.prototype.__class__ = "egret.EqualToFrame";
  1371. d = function() {
  1372. function c() {}
  1373. c.prototype.init = function(c) {};
  1374. c.prototype._apply = function(c, a, l) {};
  1375. c.prototype.setEgretSize = function(c, a, l, g, d, p) {
  1376. void 0 === p && (p = 0);
  1377. b.StageDelegate.getInstance()._stageWidth = Math.round(c);
  1378. b.StageDelegate.getInstance()._stageHeight =
  1379. Math.round(a);
  1380. c = document.getElementById(e.canvas_div_name);
  1381. c.style.width = l + "px";
  1382. c.style.height = g + "px";
  1383. c.style.top = p + "px"
  1384. };
  1385. c.prototype._getClientWidth = function() {
  1386. return document.documentElement.clientWidth
  1387. };
  1388. c.prototype._getClientHeight = function() {
  1389. return document.documentElement.clientHeight
  1390. };
  1391. return c
  1392. }();
  1393. b.ContentStrategy = d;
  1394. d.prototype.__class__ = "egret.ContentStrategy";
  1395. var l = function(c) {
  1396. function a(l) {
  1397. void 0 === l && (l = 0);
  1398. c.call(this);
  1399. this.minWidth = l
  1400. }
  1401. __extends(a, c);
  1402. a.prototype._apply = function(c, a, l) {
  1403. a =
  1404. this._getClientWidth();
  1405. var b = this._getClientHeight(),
  1406. g = b / l,
  1407. d = a / g,
  1408. e = 1;
  1409. 0 != this.minWidth && (e = Math.min(1, d / this.minWidth));
  1410. this.setEgretSize(d / e, l, a, b * e);
  1411. c._scaleX = g * e;
  1412. c._scaleY = g * e
  1413. };
  1414. return a
  1415. }(d);
  1416. b.FixedHeight = l;
  1417. l.prototype.__class__ = "egret.FixedHeight";
  1418. l = function(c) {
  1419. function a(l) {
  1420. void 0 === l && (l = 0);
  1421. c.call(this);
  1422. this.minHeight = l
  1423. }
  1424. __extends(a, c);
  1425. a.prototype._apply = function(c, a, l) {
  1426. l = this._getClientWidth();
  1427. var b = this._getClientHeight(),
  1428. g = l / a,
  1429. d = b / g,
  1430. e = 1;
  1431. 0 != this.minHeight && (e = Math.min(1, d / this.minHeight));
  1432. this.setEgretSize(a,
  1433. d / e, l * e, b, l * (1 - e) / 2);
  1434. c._scaleX = g * e;
  1435. c._scaleY = g * e
  1436. };
  1437. return a
  1438. }(d);
  1439. b.FixedWidth = l;
  1440. l.prototype.__class__ = "egret.FixedWidth";
  1441. l = function(c) {
  1442. function a(l, b) {
  1443. c.call(this);
  1444. this.width = l;
  1445. this.height = b
  1446. }
  1447. __extends(a, c);
  1448. a.prototype._apply = function(c, a, l) {
  1449. l = this.width;
  1450. var b = this.height,
  1451. g = l / a;
  1452. this.setEgretSize(a, b / g, l, b);
  1453. c._scaleX = g;
  1454. c._scaleY = g
  1455. };
  1456. return a
  1457. }(d);
  1458. b.FixedSize = l;
  1459. l.prototype.__class__ = "egret.FixedSize";
  1460. l = function(c) {
  1461. function a() {
  1462. c.call(this)
  1463. }
  1464. __extends(a, c);
  1465. a.prototype._apply = function(c, a, l) {
  1466. this.setEgretSize(a,
  1467. l, a, l, Math.floor((a - a) / 2));
  1468. c._scaleX = 1;
  1469. c._scaleY = 1
  1470. };
  1471. return a
  1472. }(d);
  1473. b.NoScale = l;
  1474. l.prototype.__class__ = "egret.NoScale";
  1475. l = function(c) {
  1476. function a() {
  1477. c.call(this)
  1478. }
  1479. __extends(a, c);
  1480. a.prototype._apply = function(c, a, l) {
  1481. var b = this._getClientWidth(),
  1482. g = this._getClientHeight(),
  1483. d = b,
  1484. e = g,
  1485. n = d / a < e / l ? d / a : e / l,
  1486. d = a * n,
  1487. e = l * n,
  1488. b = Math.floor((b - d) / 2);
  1489. c._offSetY = Math.floor((g - e) / 2);
  1490. this.setEgretSize(a, l / 1, 1 * d, e, b, c._offSetY);
  1491. c._scaleX = 1 * n;
  1492. c._scaleY = 1 * n
  1493. };
  1494. return a
  1495. }(d);
  1496. b.ShowAll = l;
  1497. l.prototype.__class__ = "egret.ShowAll";
  1498. d = function(c) {
  1499. function a() {
  1500. c.call(this)
  1501. }
  1502. __extends(a, c);
  1503. a.prototype._apply = function(c, a, l) {
  1504. var b = this._getClientWidth(),
  1505. g = this._getClientHeight(),
  1506. b = b / a,
  1507. g = g / l;
  1508. this.setEgretSize(a, l, a * b, l * g);
  1509. c._scaleX = b;
  1510. c._scaleY = g
  1511. };
  1512. return a
  1513. }(d);
  1514. b.FullScreen = d;
  1515. d.prototype.__class__ = "egret.FullScreen"
  1516. })(egret || (egret = {}));
  1517. __extends = this.__extends || function(b, e) {
  1518. function d() {
  1519. this.constructor = b
  1520. }
  1521. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1522. d.prototype = e.prototype;
  1523. b.prototype = new d
  1524. };
  1525. (function(b) {
  1526. var e = function(d) {
  1527. function a() {
  1528. d.call(this);
  1529. this._originalData = {};
  1530. this._drawAreaList = []
  1531. }
  1532. __extends(a, d);
  1533. a.getInstance = function() {
  1534. null == a.instance && (a.instance = new a);
  1535. return a.instance
  1536. };
  1537. a.prototype.addDrawArea = function(c) {
  1538. this._drawAreaList.push(c)
  1539. };
  1540. a.prototype.clearDrawArea = function() {
  1541. this._drawAreaList = []
  1542. };
  1543. a.prototype.drawImage = function(c, a, g, d, e, f, k, m, p, q, r) {
  1544. void 0 === r && (r = void 0);
  1545. k = k || 0;
  1546. m = m || 0;
  1547. var s = a._texture_to_render;
  1548. if (null != s && 0 != f && 0 != e && 0 != p && 0 != q)
  1549. if (0 != this._drawAreaList.length &&
  1550. b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1551. var t = b.DisplayObject.getTransformBounds(a._getSize(b.Rectangle.identity), a._worldTransform);
  1552. a._worldBounds.initialize(t.x, t.y, t.width, t.height);
  1553. t = this._originalData;
  1554. t.sourceX = g;
  1555. t.sourceY = d;
  1556. t.sourceWidth = e;
  1557. t.sourceHeight = f;
  1558. t.destX = k;
  1559. t.destY = m;
  1560. t.destWidth = p;
  1561. t.destHeight = q;
  1562. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++)
  1563. if (!this.ignoreRender(a, u[v], t.destX, t.destY)) {
  1564. c.drawImage(s, g, d, e, f, k, m, p, q, r);
  1565. break
  1566. }
  1567. } else c.drawImage(s, g, d, e, f, k, m,
  1568. p, q, r)
  1569. };
  1570. a.prototype.ignoreRender = function(c, a, b, d) {
  1571. var e = c._worldBounds;
  1572. b *= c._worldTransform.a;
  1573. d *= c._worldTransform.d;
  1574. return e.x + e.width + b <= a.x || e.x + b >= a.x + a.width || e.y + e.height + d <= a.y || e.y + d >= a.y + a.height ? !0 : !1
  1575. };
  1576. a.prototype.getDrawAreaList = function() {
  1577. var c;
  1578. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  1579. this.onResize, this)), c = this._defaultDrawAreaList) : c = this._drawAreaList;
  1580. return c
  1581. };
  1582. a.prototype.onResize = function() {
  1583. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1584. this._defaultDrawAreaList = null
  1585. };
  1586. return a
  1587. }(b.HashObject);
  1588. b.RenderFilter = e;
  1589. e.prototype.__class__ = "egret.RenderFilter"
  1590. })(egret || (egret = {}));
  1591. (function(b) {
  1592. var e = function() {
  1593. function d() {}
  1594. d.mapClass = function(a, c, l) {
  1595. void 0 === l && (l = "");
  1596. a = this.getKey(a) + "#" + l;
  1597. this.mapClassDic[a] = c
  1598. };
  1599. d.getKey = function(a) {
  1600. return "string" == typeof a ? a : b.getQualifiedClassName(a)
  1601. };
  1602. d.mapValue = function(a, c, l) {
  1603. void 0 === l && (l = "");
  1604. a = this.getKey(a) + "#" + l;
  1605. this.mapValueDic[a] = c
  1606. };
  1607. d.hasMapRule = function(a, c) {
  1608. void 0 === c && (c = "");
  1609. var l = this.getKey(a) + "#" + c;
  1610. return this.mapValueDic[l] || this.mapClassDic[l] ? !0 : !1
  1611. };
  1612. d.getInstance = function(a, c) {
  1613. void 0 === c && (c = "");
  1614. var l = this.getKey(a) + "#" +
  1615. c;
  1616. if (this.mapValueDic[l]) return this.mapValueDic[l];
  1617. var b = this.mapClassDic[l];
  1618. if (b) return b = new b, this.mapValueDic[l] = b, delete this.mapClassDic[l], b;
  1619. throw Error("调用了未配置的注入规则:" + l + "。 请先在项目初始化里配置指定的注入规则,再调用对应单例。");
  1620. };
  1621. d.mapClassDic = {};
  1622. d.mapValueDic = {};
  1623. return d
  1624. }();
  1625. b.Injector = e;
  1626. e.prototype.__class__ = "egret.Injector"
  1627. })(egret ||
  1628. (egret = {}));
  1629. (function(b) {
  1630. var e = function() {
  1631. function b() {}
  1632. b.NORMAL = "normal";
  1633. b.ADD = "add";
  1634. return b
  1635. }();
  1636. b.BlendMode = e;
  1637. e.prototype.__class__ = "egret.BlendMode"
  1638. })(egret || (egret = {}));
  1639. __extends = this.__extends || function(b, e) {
  1640. function d() {
  1641. this.constructor = b
  1642. }
  1643. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  1644. d.prototype = e.prototype;
  1645. b.prototype = new d
  1646. };
  1647. (function(b) {
  1648. var e = function(d) {
  1649. function a() {
  1650. d.call(this);
  1651. this.__hack_local_matrix = null;
  1652. this._sizeDirty = this._normalDirty = !0;
  1653. this._parent = this._texture_to_render = null;
  1654. this._y = this._x = 0;
  1655. this._scaleY = this._scaleX = 1;
  1656. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1657. this._visible = !0;
  1658. this._rotation = 0;
  1659. this._alpha = 1;
  1660. this._skewY = this._skewX = 0;
  1661. this._touchEnabled = !1;
  1662. this._scrollRect = this.blendMode = null;
  1663. this._hasHeightSet = this._hasWidthSet = !1;
  1664. this._worldBounds = this.mask = null;
  1665. this.worldAlpha =
  1666. 1;
  1667. this._rectH = this._rectW = 0;
  1668. this._stage = null;
  1669. this._cacheDirty = this._cacheAsBitmap = !1;
  1670. this._colorTransform = null;
  1671. this._worldTransform = new b.Matrix;
  1672. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1673. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1674. }
  1675. __extends(a, d);
  1676. a.prototype._setDirty = function() {
  1677. this._normalDirty = !0
  1678. };
  1679. a.prototype.getDirty = function() {
  1680. return this._normalDirty || this._sizeDirty
  1681. };
  1682. a.prototype._setParentSizeDirty = function() {
  1683. var c = this._parent;
  1684. !c || c._hasWidthSet || c._hasHeightSet || c._setSizeDirty()
  1685. };
  1686. a.prototype._setSizeDirty =
  1687. function() {
  1688. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty())
  1689. };
  1690. a.prototype._clearDirty = function() {
  1691. this._normalDirty = !1
  1692. };
  1693. a.prototype._clearSizeDirty = function() {
  1694. this._sizeDirty = !1
  1695. };
  1696. Object.defineProperty(a.prototype, "parent", {
  1697. get: function() {
  1698. return this._parent
  1699. },
  1700. enumerable: !0,
  1701. configurable: !0
  1702. });
  1703. a.prototype._parentChanged = function(c) {
  1704. this._parent = c
  1705. };
  1706. Object.defineProperty(a.prototype, "x", {
  1707. get: function() {
  1708. return this._x
  1709. },
  1710. set: function(c) {
  1711. this._setX(c)
  1712. },
  1713. enumerable: !0,
  1714. configurable: !0
  1715. });
  1716. a.prototype._setX = function(c) {
  1717. b.NumberUtils.isNumber(c) && this._x != c && (this._x = c, this._setDirty(), this._setParentSizeDirty())
  1718. };
  1719. Object.defineProperty(a.prototype, "y", {
  1720. get: function() {
  1721. return this._y
  1722. },
  1723. set: function(c) {
  1724. this._setY(c)
  1725. },
  1726. enumerable: !0,
  1727. configurable: !0
  1728. });
  1729. a.prototype._setY = function(c) {
  1730. b.NumberUtils.isNumber(c) && this._y != c && (this._y = c, this._setDirty(), this._setParentSizeDirty())
  1731. };
  1732. Object.defineProperty(a.prototype, "scaleX", {
  1733. get: function() {
  1734. return this._scaleX
  1735. },
  1736. set: function(c) {
  1737. b.NumberUtils.isNumber(c) &&
  1738. this._scaleX != c && (this._scaleX = c, this._setDirty(), this._setParentSizeDirty())
  1739. },
  1740. enumerable: !0,
  1741. configurable: !0
  1742. });
  1743. Object.defineProperty(a.prototype, "scaleY", {
  1744. get: function() {
  1745. return this._scaleY
  1746. },
  1747. set: function(c) {
  1748. b.NumberUtils.isNumber(c) && this._scaleY != c && (this._scaleY = c, this._setDirty(), this._setParentSizeDirty())
  1749. },
  1750. enumerable: !0,
  1751. configurable: !0
  1752. });
  1753. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1754. get: function() {
  1755. return this._anchorOffsetX
  1756. },
  1757. set: function(c) {
  1758. b.NumberUtils.isNumber(c) && this._anchorOffsetX !=
  1759. c && (this._anchorOffsetX = c, this._setDirty(), this._setParentSizeDirty())
  1760. },
  1761. enumerable: !0,
  1762. configurable: !0
  1763. });
  1764. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1765. get: function() {
  1766. return this._anchorOffsetY
  1767. },
  1768. set: function(c) {
  1769. b.NumberUtils.isNumber(c) && this._anchorOffsetY != c && (this._anchorOffsetY = c, this._setDirty(), this._setParentSizeDirty())
  1770. },
  1771. enumerable: !0,
  1772. configurable: !0
  1773. });
  1774. Object.defineProperty(a.prototype, "anchorX", {
  1775. get: function() {
  1776. return this._anchorX
  1777. },
  1778. set: function(c) {
  1779. this._setAnchorX(c)
  1780. },
  1781. enumerable: !0,
  1782. configurable: !0
  1783. });
  1784. a.prototype._setAnchorX = function(c) {
  1785. b.NumberUtils.isNumber(c) && this._anchorX != c && (this._anchorX = c, this._setDirty(), this._setParentSizeDirty())
  1786. };
  1787. Object.defineProperty(a.prototype, "anchorY", {
  1788. get: function() {
  1789. return this._anchorY
  1790. },
  1791. set: function(c) {
  1792. this._setAnchorY(c)
  1793. },
  1794. enumerable: !0,
  1795. configurable: !0
  1796. });
  1797. a.prototype._setAnchorY = function(c) {
  1798. b.NumberUtils.isNumber(c) && this._anchorY != c && (this._anchorY = c, this._setDirty(), this._setParentSizeDirty())
  1799. };
  1800. Object.defineProperty(a.prototype, "visible", {
  1801. get: function() {
  1802. return this._visible
  1803. },
  1804. set: function(c) {
  1805. this._setVisible(c)
  1806. },
  1807. enumerable: !0,
  1808. configurable: !0
  1809. });
  1810. a.prototype._setVisible = function(c) {
  1811. this._visible != c && (this._visible = c, this._setSizeDirty())
  1812. };
  1813. Object.defineProperty(a.prototype, "rotation", {
  1814. get: function() {
  1815. return this._rotation
  1816. },
  1817. set: function(c) {
  1818. b.NumberUtils.isNumber(c) && this._rotation != c && (this._rotation = c, this._setSizeDirty())
  1819. },
  1820. enumerable: !0,
  1821. configurable: !0
  1822. });
  1823. Object.defineProperty(a.prototype, "alpha", {
  1824. get: function() {
  1825. return this._alpha
  1826. },
  1827. set: function(c) {
  1828. b.NumberUtils.isNumber(c) &&
  1829. this._alpha != c && (this._alpha = c, this._setDirty(), this._setCacheDirty())
  1830. },
  1831. enumerable: !0,
  1832. configurable: !0
  1833. });
  1834. Object.defineProperty(a.prototype, "skewX", {
  1835. get: function() {
  1836. return this._skewX
  1837. },
  1838. set: function(c) {
  1839. b.NumberUtils.isNumber(c) && this._skewX != c && (this._skewX = c, this._setSizeDirty())
  1840. },
  1841. enumerable: !0,
  1842. configurable: !0
  1843. });
  1844. Object.defineProperty(a.prototype, "skewY", {
  1845. get: function() {
  1846. return this._skewY
  1847. },
  1848. set: function(c) {
  1849. b.NumberUtils.isNumber(c) && this._skewY != c && (this._skewY = c, this._setSizeDirty())
  1850. },
  1851. enumerable: !0,
  1852. configurable: !0
  1853. });
  1854. Object.defineProperty(a.prototype, "touchEnabled", {
  1855. get: function() {
  1856. return this._touchEnabled
  1857. },
  1858. set: function(c) {
  1859. this._setTouchEnabled(c)
  1860. },
  1861. enumerable: !0,
  1862. configurable: !0
  1863. });
  1864. a.prototype._setTouchEnabled = function(c) {
  1865. this._touchEnabled = c
  1866. };
  1867. Object.defineProperty(a.prototype, "scrollRect", {
  1868. get: function() {
  1869. return this._scrollRect
  1870. },
  1871. set: function(c) {
  1872. this._setScrollRect(c)
  1873. },
  1874. enumerable: !0,
  1875. configurable: !0
  1876. });
  1877. a.prototype._setScrollRect = function(c) {
  1878. this._scrollRect = c;
  1879. this._setSizeDirty()
  1880. };
  1881. Object.defineProperty(a.prototype,
  1882. "measuredWidth", {
  1883. get: function() {
  1884. return this._measureBounds().width
  1885. },
  1886. enumerable: !0,
  1887. configurable: !0
  1888. });
  1889. Object.defineProperty(a.prototype, "measuredHeight", {
  1890. get: function() {
  1891. return this._measureBounds().height
  1892. },
  1893. enumerable: !0,
  1894. configurable: !0
  1895. });
  1896. Object.defineProperty(a.prototype, "explicitWidth", {
  1897. get: function() {
  1898. return this._explicitWidth
  1899. },
  1900. enumerable: !0,
  1901. configurable: !0
  1902. });
  1903. Object.defineProperty(a.prototype, "explicitHeight", {
  1904. get: function() {
  1905. return this._explicitHeight
  1906. },
  1907. enumerable: !0,
  1908. configurable: !0
  1909. });
  1910. Object.defineProperty(a.prototype,
  1911. "width", {
  1912. get: function() {
  1913. return this._getSize(b.Rectangle.identity).width
  1914. },
  1915. set: function(c) {
  1916. this._setWidth(c)
  1917. },
  1918. enumerable: !0,
  1919. configurable: !0
  1920. });
  1921. Object.defineProperty(a.prototype, "height", {
  1922. get: function() {
  1923. return this._getSize(b.Rectangle.identity).height
  1924. },
  1925. set: function(c) {
  1926. this._setHeight(c)
  1927. },
  1928. enumerable: !0,
  1929. configurable: !0
  1930. });
  1931. a.prototype._setWidth = function(c) {
  1932. this._setSizeDirty();
  1933. this._setCacheDirty();
  1934. this._explicitWidth = c;
  1935. this._hasWidthSet = b.NumberUtils.isNumber(c)
  1936. };
  1937. a.prototype._setHeight = function(c) {
  1938. this._setSizeDirty();
  1939. this._setCacheDirty();
  1940. this._explicitHeight = c;
  1941. this._hasHeightSet = b.NumberUtils.isNumber(c)
  1942. };
  1943. a.prototype._draw = function(c) {
  1944. if (this._visible && !this.drawCacheTexture(c)) {
  1945. this._colorTransform && c.setGlobalColorTransform(this._colorTransform.matrix);
  1946. c.setAlpha(this.worldAlpha, this.blendMode);
  1947. c.setTransform(this._worldTransform);
  1948. var a = this.mask || this._scrollRect;
  1949. a && c.pushMask(a);
  1950. this._render(c);
  1951. a && c.popMask();
  1952. this._colorTransform && c.setGlobalColorTransform(null)
  1953. }
  1954. this.destroyCacheBounds()
  1955. };
  1956. a.prototype.drawCacheTexture =
  1957. function(c) {
  1958. if (!1 == this._cacheAsBitmap) return !1;
  1959. if (this._cacheDirty || null == this._texture_to_render || Math.round(this.width) != Math.round(this._texture_to_render._sourceWidth) || Math.round(this.height) != Math.round(this._texture_to_render._sourceHeight)) this._cacheDirty = !this._makeBitmapCache();
  1960. if (null == this._texture_to_render) return !1;
  1961. var a = this._texture_to_render,
  1962. g = a._offsetX,
  1963. d = a._offsetY,
  1964. e = a._textureWidth,
  1965. a = a._textureHeight;
  1966. this._updateTransform();
  1967. c.setAlpha(this.worldAlpha, this.blendMode);
  1968. c.setTransform(this._worldTransform);
  1969. var f = b.MainContext.instance.rendererContext.texture_scale_factor;
  1970. b.RenderFilter.getInstance().drawImage(c, this, 0, 0, e * f, a * f, g, d, e, a);
  1971. return !0
  1972. };
  1973. a.prototype._updateTransform = function() {
  1974. this._calculateWorldTransform()
  1975. };
  1976. a.prototype._calculateWorldTransform = function() {
  1977. var c = this._worldTransform,
  1978. a = this._parent;
  1979. c.identityMatrix(a._worldTransform);
  1980. this._getMatrix(c);
  1981. var b = this._scrollRect;
  1982. b && c.append(1, 0, 0, 1, -b.x, -b.y);
  1983. this.worldAlpha = a.worldAlpha * this._alpha
  1984. };
  1985. a.prototype._render = function(c) {};
  1986. a.prototype.getBounds =
  1987. function(c, a) {
  1988. void 0 === a && (a = !0);
  1989. var g = this._measureBounds(),
  1990. d = this._hasWidthSet ? this._explicitWidth : g.width,
  1991. e = this._hasHeightSet ? this._explicitHeight : g.height;
  1992. this._rectW = g.width;
  1993. this._rectH = g.height;
  1994. this._clearSizeDirty();
  1995. var f = g.x,
  1996. g = g.y,
  1997. k = 0,
  1998. m = 0;
  1999. a && (0 != this._anchorX || 0 != this._anchorY ? (k = d * this._anchorX, m = e * this._anchorY) : (k = this._anchorOffsetX, m = this._anchorOffsetY));
  2000. this._cacheBounds.initialize(f - k, g - m, d, e);
  2001. d = this._cacheBounds;
  2002. c || (c = new b.Rectangle);
  2003. return c.initialize(d.x, d.y, d.width, d.height)
  2004. };
  2005. a.prototype.destroyCacheBounds = function() {
  2006. this._cacheBounds.x = 0;
  2007. this._cacheBounds.y = 0;
  2008. this._cacheBounds.width = 0;
  2009. this._cacheBounds.height = 0
  2010. };
  2011. a.prototype._getConcatenatedMatrix = function() {
  2012. for (var c = a.identityMatrixForGetConcatenated.identity(), l = this; null != l;) {
  2013. if (0 != l._anchorX || 0 != l._anchorY) {
  2014. var g = l._getSize(b.Rectangle.identity);
  2015. c.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, g.width * l._anchorX, g.height * l._anchorY)
  2016. } else c.prependTransform(l._x, l._y, l._scaleX, l._scaleY,
  2017. l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
  2018. l = l._parent
  2019. }
  2020. return c
  2021. };
  2022. a.prototype.localToGlobal = function(c, a, g) {
  2023. void 0 === c && (c = 0);
  2024. void 0 === a && (a = 0);
  2025. var d = this._getConcatenatedMatrix();
  2026. d.append(1, 0, 0, 1, c, a);
  2027. g || (g = new b.Point);
  2028. g.x = d.tx;
  2029. g.y = d.ty;
  2030. return g
  2031. };
  2032. a.prototype.globalToLocal = function(c, a, g) {
  2033. void 0 === c && (c = 0);
  2034. void 0 === a && (a = 0);
  2035. var d = this._getConcatenatedMatrix();
  2036. d.invert();
  2037. d.append(1, 0, 0, 1, c, a);
  2038. g || (g = new b.Point);
  2039. g.x = d.tx;
  2040. g.y = d.ty;
  2041. return g
  2042. };
  2043. a.prototype.hitTest = function(c, a, g) {
  2044. void 0 ===
  2045. g && (g = !1);
  2046. if (!this._visible || !g && !this._touchEnabled) return null;
  2047. g = this._getSize(b.Rectangle.identity);
  2048. return 0 <= c && c < g.width && 0 <= a && a < g.height ? this.mask || this._scrollRect ? this._scrollRect && c > this._scrollRect.x && a > this._scrollRect.y && c < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= c && c < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
  2049. };
  2050. a.prototype.hitTestPoint = function(c, a, g) {
  2051. c = this.globalToLocal(c,
  2052. a);
  2053. return g ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), g = this._hitTestPointTexture, g.drawToTexture(this), 0 != g.getPixel32(c.x - this._hitTestPointTexture._offsetX, c.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(c.x, c.y, !0)
  2054. };
  2055. a.prototype._getMatrix = function(c) {
  2056. c || (c = b.Matrix.identity.identity());
  2057. var a, g;
  2058. g = this._getOffsetPoint();
  2059. a = g.x;
  2060. g = g.y;
  2061. var d = this.__hack_local_matrix;
  2062. d ? (c.append(d.a, d.b, d.c, d.d, d.tx, d.ty), c.append(1, 0, 0, 1, -a, -g)) : c.appendTransform(this._x,
  2063. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, g);
  2064. return c
  2065. };
  2066. a.prototype._getSize = function(c) {
  2067. return this._hasHeightSet && this._hasWidthSet ? c.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(c)
  2068. };
  2069. a.prototype._measureSize = function(c) {
  2070. this._sizeDirty ? (c = this._measureBounds(), this._rectW = c.width, this._rectH = c.height, this._clearSizeDirty()) : (c.width = this._rectW, c.height = this._rectH);
  2071. c.x = 0;
  2072. c.y = 0;
  2073. return c
  2074. };
  2075. a.prototype._measureBounds = function() {
  2076. return b.Rectangle.identity.initialize(0,
  2077. 0, 0, 0)
  2078. };
  2079. a.prototype._getOffsetPoint = function() {
  2080. var c = this._anchorOffsetX,
  2081. a = this._anchorOffsetY;
  2082. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity), c = this._anchorX * a.width, a = this._anchorY * a.height;
  2083. var g = b.Point.identity;
  2084. g.x = c;
  2085. g.y = a;
  2086. return g
  2087. };
  2088. a.prototype._onAddToStage = function() {
  2089. this._stage = b.MainContext.instance.stage;
  2090. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2091. };
  2092. a.prototype._onRemoveFromStage = function() {
  2093. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2094. };
  2095. Object.defineProperty(a.prototype, "stage", {
  2096. get: function() {
  2097. return this._stage
  2098. },
  2099. enumerable: !0,
  2100. configurable: !0
  2101. });
  2102. a.prototype.addEventListener = function(c, l, g, e, h) {
  2103. void 0 === e && (e = !1);
  2104. void 0 === h && (h = 0);
  2105. d.prototype.addEventListener.call(this, c, l, g, e, h);
  2106. ((e = c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, l, g, h, this)
  2107. };
  2108. a.prototype.removeEventListener = function(c, l, g, e) {
  2109. void 0 === e && (e = !1);
  2110. d.prototype.removeEventListener.call(this, c, l, g, e);
  2111. ((e =
  2112. c == b.Event.ENTER_FRAME) || c == b.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, l, g, this)
  2113. };
  2114. a.prototype.dispatchEvent = function(c) {
  2115. if (!c._bubbles) return d.prototype.dispatchEvent.call(this, c);
  2116. for (var a = [], b = this; b;) a.push(b), b = b._parent;
  2117. c._reset();
  2118. this._dispatchPropagationEvent(c, a);
  2119. return !c._isDefaultPrevented
  2120. };
  2121. a.prototype._dispatchPropagationEvent = function(c, a, b) {
  2122. b = a.length;
  2123. for (var d = 1, e = b - 1; 0 <= e; e--) {
  2124. var f = a[e];
  2125. c._currentTarget = f;
  2126. c._target = this;
  2127. c._eventPhase = d;
  2128. f._notifyListener(c);
  2129. if (c._isPropagationStopped || c._isPropagationImmediateStopped) return
  2130. }
  2131. f = a[0];
  2132. c._currentTarget = f;
  2133. c._target = this;
  2134. c._eventPhase = 2;
  2135. f._notifyListener(c);
  2136. if (!c._isPropagationStopped && !c._isPropagationImmediateStopped)
  2137. for (d = 3, e = 1; e < b && (f = a[e], c._currentTarget = f, c._target = this, c._eventPhase = d, f._notifyListener(c), !c._isPropagationStopped && !c._isPropagationImmediateStopped); e++);
  2138. };
  2139. a.prototype.willTrigger = function(c) {
  2140. for (var a = this; a;) {
  2141. if (a.hasEventListener(c)) return !0;
  2142. a = a._parent
  2143. }
  2144. return !1
  2145. };
  2146. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2147. get: function() {
  2148. return this._cacheAsBitmap
  2149. },
  2150. set: function(c) {
  2151. (this._cacheAsBitmap = c) ? b.callLater(this._makeBitmapCache, this): this._texture_to_render = null
  2152. },
  2153. enumerable: !0,
  2154. configurable: !0
  2155. });
  2156. a.prototype._makeBitmapCache = function() {
  2157. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2158. var c = this.renderTexture.drawToTexture(this);
  2159. this._texture_to_render = c ? this.renderTexture : null;
  2160. return c
  2161. };
  2162. a.prototype._setCacheDirty = function(c) {
  2163. void 0 === c && (c = !0);
  2164. this._cacheDirty =
  2165. c
  2166. };
  2167. a.getTransformBounds = function(c, a) {
  2168. var b = c.x,
  2169. d = c.y,
  2170. e = c.width,
  2171. f = c.height;
  2172. (b || d) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -d);
  2173. var k = e * a.a,
  2174. e = e * a.b,
  2175. m = f * a.c,
  2176. f = f * a.d,
  2177. p = a.tx,
  2178. q = a.ty,
  2179. r = p,
  2180. s = p,
  2181. t = q,
  2182. u = q;
  2183. (b = k + p) < r ? r = b : b > s && (s = b);
  2184. (b = k + m + p) < r ? r = b : b > s && (s = b);
  2185. (b = m + p) < r ? r = b : b > s && (s = b);
  2186. (d = e + q) < t ? t = d : d > u && (u = d);
  2187. (d = e + f + q) < t ? t = d : d > u && (u = d);
  2188. (d = f + q) < t ? t = d : d > u && (u = d);
  2189. return c.initialize(r, t, s - r, u - t)
  2190. };
  2191. Object.defineProperty(a.prototype, "colorTransform", {
  2192. get: function() {
  2193. return this._colorTransform
  2194. },
  2195. set: function(c) {
  2196. this._colorTransform =
  2197. c
  2198. },
  2199. enumerable: !0,
  2200. configurable: !0
  2201. });
  2202. a.identityMatrixForGetConcatenated = new b.Matrix;
  2203. a._enterFrameCallBackList = [];
  2204. a._renderCallBackList = [];
  2205. return a
  2206. }(b.EventDispatcher);
  2207. b.DisplayObject = e;
  2208. e.prototype.__class__ = "egret.DisplayObject";
  2209. e = function() {
  2210. function b() {
  2211. this.matrix = null
  2212. }
  2213. b.prototype.updateColor = function(a, c, l, b, d, e, f, k) {};
  2214. return b
  2215. }();
  2216. b.ColorTransform = e;
  2217. e.prototype.__class__ = "egret.ColorTransform"
  2218. })(egret || (egret = {}));
  2219. __extends = this.__extends || function(b, e) {
  2220. function d() {
  2221. this.constructor = b
  2222. }
  2223. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  2224. d.prototype = e.prototype;
  2225. b.prototype = new d
  2226. };
  2227. (function(b) {
  2228. var e = function(d) {
  2229. function a() {
  2230. d.call(this);
  2231. this._touchChildren = !0;
  2232. this._children = []
  2233. }
  2234. __extends(a, d);
  2235. Object.defineProperty(a.prototype, "touchChildren", {
  2236. get: function() {
  2237. return this._touchChildren
  2238. },
  2239. set: function(c) {
  2240. this._touchChildren = c
  2241. },
  2242. enumerable: !0,
  2243. configurable: !0
  2244. });
  2245. Object.defineProperty(a.prototype, "numChildren", {
  2246. get: function() {
  2247. return this._children.length
  2248. },
  2249. enumerable: !0,
  2250. configurable: !0
  2251. });
  2252. a.prototype.setChildIndex = function(c, a) {
  2253. this.doSetChildIndex(c, a)
  2254. };
  2255. a.prototype.doSetChildIndex = function(c,
  2256. a) {
  2257. var g = this._children.indexOf(c);
  2258. 0 > g && b.Logger.fatal("child不在当前容器内");
  2259. this._children.splice(g, 1);
  2260. 0 > a || this._children.length <= a ? this._children.push(c) : this._children.splice(a, 0, c)
  2261. };
  2262. a.prototype.addChild = function(c) {
  2263. var a = this._children.length;
  2264. c._parent == this && a--;
  2265. return this._doAddChild(c, a)
  2266. };
  2267. a.prototype.addChildAt = function(c, a) {
  2268. return this._doAddChild(c, a)
  2269. };
  2270. a.prototype._doAddChild = function(c, l, g) {
  2271. void 0 === g && (g = !0);
  2272. if (c == this) return c;
  2273. if (0 > l || l > this._children.length) return b.Logger.fatal("提供的索引超出范围"),
  2274. c;
  2275. var d = c._parent;
  2276. if (d == this) return this.doSetChildIndex(c, l), c;
  2277. d && (l = d._children.indexOf(c), 0 <= l && d._doRemoveChild(l));
  2278. this._children.splice(l, 0, c);
  2279. c._parentChanged(this);
  2280. g && c.dispatchEventWith(b.Event.ADDED, !0);
  2281. if (this._stage)
  2282. for (c._onAddToStage(), l = a.__EVENT__ADD_TO_STAGE_LIST; 0 < l.length;) l.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2283. c._setDirty();
  2284. this._setSizeDirty();
  2285. return c
  2286. };
  2287. a.prototype.removeChild = function(c) {
  2288. c = this._children.indexOf(c);
  2289. if (0 <= c) return this._doRemoveChild(c);
  2290. b.Logger.fatal("child未被addChild到该parent");
  2291. return null
  2292. };
  2293. a.prototype.removeChildAt = function(c) {
  2294. if (0 <= c && c < this._children.length) return this._doRemoveChild(c);
  2295. b.Logger.fatal("提供的索引超出范围");
  2296. return null
  2297. };
  2298. a.prototype._doRemoveChild = function(c, l) {
  2299. void 0 === l && (l = !0);
  2300. var g = this._children,
  2301. d = g[c];
  2302. l && d.dispatchEventWith(b.Event.REMOVED, !0);
  2303. if (this._stage) {
  2304. d._onRemoveFromStage();
  2305. for (var e = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < e.length;) {
  2306. var f = e.shift();
  2307. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2308. f._stage = null
  2309. }
  2310. }
  2311. d._parentChanged(null);
  2312. g.splice(c, 1);
  2313. this._setSizeDirty();
  2314. return d
  2315. };
  2316. a.prototype.getChildAt = function(c) {
  2317. if (0 <= c && c < this._children.length) return this._children[c];
  2318. b.Logger.fatal("提供的索引超出范围");
  2319. return null
  2320. };
  2321. a.prototype.contains = function(c) {
  2322. for (; c;) {
  2323. if (c == this) return !0;
  2324. c = c._parent
  2325. }
  2326. return !1
  2327. };
  2328. a.prototype.swapChildrenAt = function(c, a) {
  2329. 0 <= c && c < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(c, a) : b.Logger.fatal("提供的索引超出范围")
  2330. };
  2331. a.prototype.swapChildren = function(c, a) {
  2332. var g = this._children.indexOf(c),
  2333. d = this._children.indexOf(a); - 1 == g || -1 == d ? b.Logger.fatal("child未被addChild到该parent") : this._swapChildrenAt(g, d)
  2334. };
  2335. a.prototype._swapChildrenAt = function(c, a) {
  2336. if (c != a) {
  2337. var b = this._children,
  2338. d = b[c];
  2339. b[c] = b[a];
  2340. b[a] = d
  2341. }
  2342. };
  2343. a.prototype.getChildIndex = function(c) {
  2344. return this._children.indexOf(c)
  2345. };
  2346. a.prototype.removeChildren = function() {
  2347. for (var c = this._children.length - 1; 0 <= c; c--) this._doRemoveChild(c)
  2348. };
  2349. a.prototype._updateTransform =
  2350. function() {
  2351. if (this._visible) {
  2352. d.prototype._updateTransform.call(this);
  2353. for (var c = 0, a = this._children.length; c < a; c++) this._children[c]._updateTransform()
  2354. }
  2355. };
  2356. a.prototype._render = function(c) {
  2357. for (var a = 0, b = this._children.length; a < b; a++) this._children[a]._draw(c)
  2358. };
  2359. a.prototype._measureBounds = function() {
  2360. for (var c = 0, a = 0, g = 0, d = 0, e = this._children.length, f = 0; f < e; f++) {
  2361. var k = this._children[f];
  2362. if (k._visible) {
  2363. var m = k.getBounds(b.Rectangle.identity, !1),
  2364. p = m.x,
  2365. q = m.y,
  2366. r = m.width,
  2367. m = m.height,
  2368. k = k._getMatrix(),
  2369. k = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p,
  2370. q, r, m), k),
  2371. p = k.x,
  2372. q = k.y,
  2373. r = k.width + k.x,
  2374. k = k.height + k.y;
  2375. if (p < c || 0 == f) c = p;
  2376. if (r > a || 0 == f) a = r;
  2377. if (q < g || 0 == f) g = q;
  2378. if (k > d || 0 == f) d = k
  2379. }
  2380. }
  2381. return b.Rectangle.identity.initialize(c, g, a - c, d - g)
  2382. };
  2383. a.prototype.hitTest = function(c, a, g) {
  2384. void 0 === g && (g = !1);
  2385. var e;
  2386. if (!this._visible) return null;
  2387. if (this._scrollRect) {
  2388. if (c < this._scrollRect.x || a < this._scrollRect.y || c > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2389. } else if (this.mask && (this.mask.x > c || c > this.mask.x + this.mask.width || this.mask.y >
  2390. a || a > this.mask.y + this.mask.height)) return null;
  2391. for (var h = this._children, f = this._touchChildren, k = h.length - 1; 0 <= k; k--) {
  2392. var m = h[k],
  2393. p = m._getMatrix(),
  2394. q = m._scrollRect;
  2395. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2396. p.invert();
  2397. p = b.Matrix.transformCoords(p, c, a);
  2398. if (m = m.hitTest(p.x, p.y, !0)) {
  2399. if (!f) return this;
  2400. if (m._touchEnabled && f) return m;
  2401. e = this
  2402. }
  2403. }
  2404. return e ? e : this._texture_to_render || this.graphics ? d.prototype.hitTest.call(this, c, a, g) : null
  2405. };
  2406. a.prototype._onAddToStage = function() {
  2407. d.prototype._onAddToStage.call(this);
  2408. for (var c = this._children.length,
  2409. a = 0; a < c; a++) this._children[a]._onAddToStage()
  2410. };
  2411. a.prototype._onRemoveFromStage = function() {
  2412. d.prototype._onRemoveFromStage.call(this);
  2413. for (var c = this._children.length, a = 0; a < c; a++) this._children[a]._onRemoveFromStage()
  2414. };
  2415. a.prototype.getChildByName = function(c) {
  2416. for (var a = this._children, b = a.length, d, e = 0; e < b; e++)
  2417. if (d = a[e], d.name == c) return d;
  2418. return null
  2419. };
  2420. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2421. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2422. return a
  2423. }(b.DisplayObject);
  2424. b.DisplayObjectContainer = e;
  2425. e.prototype.__class__ = "egret.DisplayObjectContainer"
  2426. })(egret ||
  2427. (egret = {}));
  2428. __extends = this.__extends || function(b, e) {
  2429. function d() {
  2430. this.constructor = b
  2431. }
  2432. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  2433. d.prototype = e.prototype;
  2434. b.prototype = new d
  2435. };
  2436. (function(b) {
  2437. var e = function(d) {
  2438. function a(c, a) {
  2439. void 0 === c && (c = 480);
  2440. void 0 === a && (a = 800);
  2441. d.call(this);
  2442. this.touchEnabled = !0;
  2443. this._stage = this;
  2444. this._stageWidth = c;
  2445. this._stageHeight = a
  2446. }
  2447. __extends(a, d);
  2448. a.prototype.invalidate = function() {
  2449. a._invalidateRenderFlag = !0
  2450. };
  2451. Object.defineProperty(a.prototype, "scaleMode", {
  2452. get: function() {
  2453. return this._scaleMode
  2454. },
  2455. set: function(c) {
  2456. this._scaleMode != c && (this._scaleMode = c, this.setResolutionPolicy())
  2457. },
  2458. enumerable: !0,
  2459. configurable: !0
  2460. });
  2461. a.prototype.changeSize = function() {
  2462. this.setResolutionPolicy();
  2463. this.dispatchEventWith(b.Event.RESIZE)
  2464. };
  2465. a.prototype.setResolutionPolicy = function() {
  2466. var c = {};
  2467. c[b.StageScaleMode.NO_SCALE] = new b.NoScale;
  2468. c[b.StageScaleMode.SHOW_ALL] = new b.ShowAll;
  2469. c[b.StageScaleMode.NO_BORDER] = new b.FixedWidth;
  2470. c[b.StageScaleMode.EXACT_FIT] = new b.FullScreen;
  2471. c = c[this._scaleMode];
  2472. if (!c) throw Error("使用了尚未实现的ScaleMode");
  2473. var a = new b.EqualToFrame,
  2474. c = new b.ResolutionPolicy(a, c);
  2475. b.StageDelegate.getInstance()._setResolutionPolicy(c);
  2476. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2477. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2478. };
  2479. Object.defineProperty(a.prototype, "stageWidth", {
  2480. get: function() {
  2481. return this._stageWidth
  2482. },
  2483. enumerable: !0,
  2484. configurable: !0
  2485. });
  2486. Object.defineProperty(a.prototype, "stageHeight", {
  2487. get: function() {
  2488. return this._stageHeight
  2489. },
  2490. enumerable: !0,
  2491. configurable: !0
  2492. });
  2493. a.prototype.hitTest = function(c, a, g) {
  2494. if (!this._touchEnabled) return null;
  2495. var d;
  2496. if (!this._touchChildren) return this;
  2497. g = this._children;
  2498. for (var e = g.length - 1; 0 <= e; e--) {
  2499. d = g[e];
  2500. var f = d._getMatrix(),
  2501. k = d._scrollRect;
  2502. k && f.append(1, 0, 0, 1, -k.x, -k.y);
  2503. f.invert();
  2504. f = b.Matrix.transformCoords(f, c, a);
  2505. if ((d = d.hitTest(f.x, f.y, !0)) && d._touchEnabled) return d
  2506. }
  2507. return this
  2508. };
  2509. a.prototype.getBounds = function(c) {
  2510. c || (c = new b.Rectangle);
  2511. return c.initialize(0, 0, this._stageWidth, this._stageHeight)
  2512. };
  2513. a.prototype._updateTransform = function() {
  2514. for (var c = 0, a = this._children.length; c < a; c++) this._children[c]._updateTransform()
  2515. };
  2516. Object.defineProperty(a.prototype, "focus", {
  2517. get: function() {
  2518. return null
  2519. },
  2520. enumerable: !0,
  2521. configurable: !0
  2522. });
  2523. a._invalidateRenderFlag = !1;
  2524. return a
  2525. }(b.DisplayObjectContainer);
  2526. b.Stage = e;
  2527. e.prototype.__class__ = "egret.Stage"
  2528. })(egret || (egret = {}));
  2529. (function(b) {
  2530. var e = function() {
  2531. function b() {}
  2532. b.NO_BORDER = "noBorder";
  2533. b.NO_SCALE = "noScale";
  2534. b.SHOW_ALL = "showAll";
  2535. b.EXACT_FIT = "exactFit";
  2536. return b
  2537. }();
  2538. b.StageScaleMode = e;
  2539. e.prototype.__class__ = "egret.StageScaleMode"
  2540. })(egret || (egret = {}));
  2541. __extends = this.__extends || function(b, e) {
  2542. function d() {
  2543. this.constructor = b
  2544. }
  2545. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  2546. d.prototype = e.prototype;
  2547. b.prototype = new d
  2548. };
  2549. (function(b) {
  2550. var e = function(d) {
  2551. function a(c) {
  2552. void 0 === c && (c = null);
  2553. d.call(this);
  2554. this._lastTouchPosition = new b.Point(0, 0);
  2555. this._lastTouchTime = 0;
  2556. this._lastTouchEvent = null;
  2557. this._velocitys = [];
  2558. this._content = null;
  2559. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2560. this._scrollTop = this._scrollLeft = 0;
  2561. this._vCanScroll = this._hCanScroll = !1;
  2562. this.touchEnabled = !0;
  2563. c && this.setContent(c)
  2564. }
  2565. __extends(a, d);
  2566. a.prototype.setContent = function(c) {
  2567. this._content && (this._removeEvents(), d.prototype.removeChildAt.call(this,
  2568. 0));
  2569. this._content = c;
  2570. d.prototype.addChild.call(this, c);
  2571. this._addEvents();
  2572. this._explicitWidth || this._getContentWidth();
  2573. this._explicitHeight || this._getContentHeight()
  2574. };
  2575. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2576. get: function() {
  2577. return this._verticalScrollPolicy
  2578. },
  2579. set: function(c) {
  2580. c != this._verticalScrollPolicy && (this._verticalScrollPolicy = c)
  2581. },
  2582. enumerable: !0,
  2583. configurable: !0
  2584. });
  2585. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2586. get: function() {
  2587. return this._horizontalScrollPolicy
  2588. },
  2589. set: function(c) {
  2590. c !=
  2591. this._horizontalScrollPolicy && (this._horizontalScrollPolicy = c)
  2592. },
  2593. enumerable: !0,
  2594. configurable: !0
  2595. });
  2596. Object.defineProperty(a.prototype, "scrollLeft", {
  2597. get: function() {
  2598. return this._scrollLeft
  2599. },
  2600. set: function(c) {
  2601. c != this._scrollLeft && (this._scrollLeft = c, this._validatePosition(!1, !0), this._updateContentPosition())
  2602. },
  2603. enumerable: !0,
  2604. configurable: !0
  2605. });
  2606. Object.defineProperty(a.prototype, "scrollTop", {
  2607. get: function() {
  2608. return this._scrollTop
  2609. },
  2610. set: function(c) {
  2611. c != this._scrollTop && (this._scrollTop = c, this._validatePosition(!0, !1), this._updateContentPosition())
  2612. },
  2613. enumerable: !0,
  2614. configurable: !0
  2615. });
  2616. a.prototype.setScrollPosition = function(c, a, b) {
  2617. void 0 === b && (b = !1);
  2618. if (!b || 0 != c || 0 != a)
  2619. if (b || this._scrollTop != c || this._scrollLeft != a) {
  2620. if (b) {
  2621. b = this._isOnTheEdge(!0);
  2622. var d = this._isOnTheEdge(!1);
  2623. this._scrollTop += b ? c / 2 : c;
  2624. this._scrollLeft += d ? a / 2 : a
  2625. } else this._scrollTop = c, this._scrollLeft = a;
  2626. this._validatePosition(!0, !0);
  2627. this._updateContentPosition()
  2628. }
  2629. };
  2630. a.prototype._isOnTheEdge = function(c) {
  2631. void 0 === c && (c = !0);
  2632. var a = this._scrollTop,
  2633. b = this._scrollLeft;
  2634. return c ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2635. };
  2636. a.prototype._validatePosition = function(c, a) {
  2637. void 0 === c && (c = !1);
  2638. void 0 === a && (a = !1);
  2639. if (c) {
  2640. var b = this.height,
  2641. d = this._getContentHeight();
  2642. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2643. this._scrollTop = Math.min(this._scrollTop, d > b ? d - b / 2 : d / 2)
  2644. }
  2645. a && (b = this.width, d = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, d > b ? d - b / 2 : d / 2))
  2646. };
  2647. a.prototype._setWidth = function(c) {
  2648. this._explicitWidth !=
  2649. c && (d.prototype._setWidth.call(this, c), this._updateContentPosition())
  2650. };
  2651. a.prototype._setHeight = function(c) {
  2652. this._explicitHeight != c && (d.prototype._setHeight.call(this, c), this._updateContentPosition())
  2653. };
  2654. a.prototype._updateContentPosition = function() {
  2655. var c = this.getBounds(b.Rectangle.identity);
  2656. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, c.width, c.height);
  2657. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2658. };
  2659. a.prototype._checkScrollPolicy = function() {
  2660. var c = this.__checkScrollPolicy(this._horizontalScrollPolicy,
  2661. this._getContentWidth(), this.width);
  2662. this._hCanScroll = c;
  2663. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2664. this._vCanScroll = a;
  2665. return c || a
  2666. };
  2667. a.prototype.__checkScrollPolicy = function(c, a, b) {
  2668. return "on" == c ? !0 : "off" == c ? !1 : a > b
  2669. };
  2670. a.prototype._addEvents = function() {
  2671. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2672. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2673. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture,
  2674. this, !0)
  2675. };
  2676. a.prototype._removeEvents = function() {
  2677. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2678. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2679. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2680. };
  2681. a.prototype._onTouchBegin = function(c) {
  2682. c._isDefaultPrevented || (b.Tween.removeTweens(this), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END,
  2683. this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(c), c.preventDefault())
  2684. };
  2685. a.prototype._onTouchBeginCapture = function(c) {
  2686. var l = this._checkScrollPolicy();
  2687. if (l) {
  2688. for (var g = c.target; g != this;) {
  2689. if (g instanceof a && (l = g._checkScrollPolicy())) return;
  2690. g = g.parent
  2691. }
  2692. c.stopPropagation();
  2693. this.delayTouchBeginEvent = this.cloneTouchEvent(c);
  2694. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100,
  2695. 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2696. this.touchBeginTimer.start();
  2697. this._onTouchBegin(c)
  2698. }
  2699. };
  2700. a.prototype._onTouchEndCapture = function(c) {
  2701. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2702. };
  2703. a.prototype._onTouchBeginTimer = function() {
  2704. this.touchBeginTimer.stop();
  2705. var c = this.delayTouchBeginEvent;
  2706. this.delayTouchBeginEvent = null;
  2707. this.dispatchPropagationEvent(c)
  2708. };
  2709. a.prototype.dispatchPropagationEvent = function(c) {
  2710. for (var a = [], b = c._target; b;) a.push(b),
  2711. b = b.parent;
  2712. for (var d = this._content, e = 1;; e += 2) {
  2713. b = a[e];
  2714. if (!b || b === d) break;
  2715. a.unshift(b)
  2716. }
  2717. this._dispatchPropagationEvent(c, a)
  2718. };
  2719. a.prototype._dispatchPropagationEvent = function(c, a, b) {
  2720. for (var d = a.length, e = 0; e < d; e++) {
  2721. var f = a[e];
  2722. c._currentTarget = f;
  2723. c._target = this;
  2724. c._eventPhase = e < b ? 1 : e == b ? 2 : 3;
  2725. f._notifyListener(c);
  2726. if (c._isPropagationStopped || c._isPropagationImmediateStopped) break
  2727. }
  2728. };
  2729. a.prototype._onTouchMove = function(c) {
  2730. if (this._lastTouchPosition.x != c.stageX || this._lastTouchPosition.y != c.stageY) {
  2731. this.delayTouchBeginEvent &&
  2732. (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2733. this.touchChildren = !1;
  2734. var a = this._getPointChange(c);
  2735. this.setScrollPosition(a.y, a.x, !0);
  2736. this._calcVelocitys(c);
  2737. this._logTouchEvent(c)
  2738. }
  2739. };
  2740. a.prototype._onTouchEnd = function(c) {
  2741. this.touchChildren = !0;
  2742. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2743. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2744. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE,
  2745. this._onTouchEnd, this);
  2746. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2747. this._moveAfterTouchEnd()
  2748. };
  2749. a.prototype._onEnterFrame = function(c) {
  2750. c = b.getTimer();
  2751. 100 < c - this._lastTouchTime && 300 > c - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2752. };
  2753. a.prototype._logTouchEvent = function(c) {
  2754. this._lastTouchPosition.x = c.stageX;
  2755. this._lastTouchPosition.y = c.stageY;
  2756. this._lastTouchEvent = this.cloneTouchEvent(c);
  2757. this._lastTouchTime = b.getTimer()
  2758. };
  2759. a.prototype._getPointChange = function(c) {
  2760. return {
  2761. x: !1 ===
  2762. this._hCanScroll ? 0 : this._lastTouchPosition.x - c.stageX,
  2763. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - c.stageY
  2764. }
  2765. };
  2766. a.prototype._calcVelocitys = function(c) {
  2767. var a = b.getTimer();
  2768. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  2769. else {
  2770. var g = this._getPointChange(c),
  2771. a = a - this._lastTouchTime;
  2772. g.x /= a;
  2773. g.y /= a;
  2774. this._velocitys.push(g);
  2775. 5 < this._velocitys.length && this._velocitys.shift();
  2776. this._lastTouchPosition.x = c.stageX;
  2777. this._lastTouchPosition.y = c.stageY
  2778. }
  2779. };
  2780. a.prototype._getContentWidth = function() {
  2781. return this._content.explicitWidth ||
  2782. this._content.width
  2783. };
  2784. a.prototype._getContentHeight = function() {
  2785. return this._content.explicitHeight || this._content.height
  2786. };
  2787. a.prototype.getMaxScrollLeft = function() {
  2788. var c = this._getContentWidth() - this.width;
  2789. return Math.max(0, c)
  2790. };
  2791. a.prototype.getMaxScrollTop = function() {
  2792. var c = this._getContentHeight() - this.height;
  2793. return Math.max(0, c)
  2794. };
  2795. a.prototype._moveAfterTouchEnd = function() {
  2796. if (0 != this._velocitys.length) {
  2797. for (var c = 0, b = 0, g = 0, d = 0; d < this._velocitys.length; d++) var e = this._velocitys[d],
  2798. f = a.weight[d],
  2799. c = c + e.x * f,
  2800. b = b + e.y * f,
  2801. g = g + f;
  2802. this._velocitys.length = 0;
  2803. c /= g;
  2804. b /= g;
  2805. e = Math.abs(c);
  2806. g = Math.abs(b);
  2807. f = this.getMaxScrollLeft();
  2808. d = this.getMaxScrollTop();
  2809. c = 0.02 < e ? this.getAnimationDatas(c, this._scrollLeft, f) : {
  2810. position: this._scrollLeft,
  2811. duration: 1
  2812. };
  2813. b = 0.02 < g ? this.getAnimationDatas(b, this._scrollTop, d) : {
  2814. position: this._scrollTop,
  2815. duration: 1
  2816. };
  2817. this.setScrollLeft(c.position, c.duration);
  2818. this.setScrollTop(b.position, b.duration)
  2819. }
  2820. };
  2821. a.prototype.setScrollTop = function(c, a) {
  2822. void 0 === a && (a = 0);
  2823. var g = Math.min(this.getMaxScrollTop(), Math.max(c,
  2824. 0));
  2825. if (0 == a) return this.scrollTop = g, null;
  2826. var d = b.Tween.get(this).to({
  2827. scrollTop: c
  2828. }, a, b.Ease.quartOut);
  2829. g != c && d.to({
  2830. scrollTop: g
  2831. }, 300, b.Ease.quintOut)
  2832. };
  2833. a.prototype.setScrollLeft = function(c, a) {
  2834. void 0 === a && (a = 0);
  2835. var g = Math.min(this.getMaxScrollLeft(), Math.max(c, 0));
  2836. if (0 == a) return this.scrollLeft = g, null;
  2837. var d = b.Tween.get(this).to({
  2838. scrollLeft: c
  2839. }, a, b.Ease.quartOut);
  2840. g != c && d.to({
  2841. scrollLeft: g
  2842. }, 300, b.Ease.quintOut)
  2843. };
  2844. a.prototype.getAnimationDatas = function(c, a, b) {
  2845. var d = Math.abs(c),
  2846. e = 0,
  2847. f = a + 500 * c;
  2848. if (0 > f || f > b)
  2849. for (f =
  2850. a; Infinity != Math.abs(c) && 0.02 < Math.abs(c);) f += c, c = 0 > f || f > b ? 0.998 * c * 0.95 : 0.998 * c, e++;
  2851. else e = 500 * -Math.log(0.02 / d);
  2852. return {
  2853. position: Math.min(b + 50, Math.max(f, -50)),
  2854. duration: e
  2855. }
  2856. };
  2857. a.prototype.cloneTouchEvent = function(c) {
  2858. var a = new b.TouchEvent(c._type, c._bubbles, c.cancelable);
  2859. a.touchPointID = c.touchPointID;
  2860. a._stageX = c._stageX;
  2861. a._stageY = c._stageY;
  2862. a.ctrlKey = c.ctrlKey;
  2863. a.altKey = c.altKey;
  2864. a.shiftKey = c.shiftKey;
  2865. a.touchDown = c.touchDown;
  2866. a._isDefaultPrevented = !1;
  2867. a._target = c._target;
  2868. return a
  2869. };
  2870. a.prototype.throwNotSupportedError =
  2871. function() {
  2872. throw Error("此方法在ScrollView内不可用!");
  2873. };
  2874. a.prototype.addChild = function(c) {
  2875. this.throwNotSupportedError();
  2876. return null
  2877. };
  2878. a.prototype.addChildAt = function(c, a) {
  2879. this.throwNotSupportedError();
  2880. return null
  2881. };
  2882. a.prototype.removeChild = function(c) {
  2883. this.throwNotSupportedError();
  2884. return null
  2885. };
  2886. a.prototype.removeChildAt = function(c) {
  2887. this.throwNotSupportedError();
  2888. return null
  2889. };
  2890. a.prototype.setChildIndex = function(c, a) {
  2891. this.throwNotSupportedError()
  2892. };
  2893. a.prototype.swapChildren = function(c,
  2894. a) {
  2895. this.throwNotSupportedError()
  2896. };
  2897. a.prototype.swapChildrenAt = function(c, a) {
  2898. this.throwNotSupportedError()
  2899. };
  2900. a.weight = [1, 1.33, 1.66, 2, 2.33];
  2901. return a
  2902. }(b.DisplayObjectContainer);
  2903. b.ScrollView = e;
  2904. e.prototype.__class__ = "egret.ScrollView"
  2905. })(egret || (egret = {}));
  2906. __extends = this.__extends || function(b, e) {
  2907. function d() {
  2908. this.constructor = b
  2909. }
  2910. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  2911. d.prototype = e.prototype;
  2912. b.prototype = new d
  2913. };
  2914. (function(b) {
  2915. var e = function(d) {
  2916. function a(c, a, g) {
  2917. void 0 === a && (a = NaN);
  2918. void 0 === g && (g = NaN);
  2919. d.call(this, c);
  2920. this.content = c;
  2921. this.width = NaN == a ? this._getContentWidth() : a;
  2922. this.height = NaN == g ? this._getContentHeight() : g;
  2923. b.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView")
  2924. }
  2925. __extends(a, d);
  2926. Object.defineProperty(a.prototype, "scrollXEnabled", {
  2927. get: function() {
  2928. return "off" != this.horizontalScrollPolicy
  2929. },
  2930. set: function(c) {
  2931. b.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView");
  2932. this.horizontalScrollPolicy = c ? "auto" : "off"
  2933. },
  2934. enumerable: !0,
  2935. configurable: !0
  2936. });
  2937. Object.defineProperty(a.prototype, "scrollYEnabled", {
  2938. get: function() {
  2939. return "off" != this.verticalScrollPolicy
  2940. },
  2941. set: function(c) {
  2942. b.Logger.warning("egret.Scroller已废弃,请使用egret.ScrollView");
  2943. this.verticalScrollPolicy = c ? "auto" : "off"
  2944. },
  2945. enumerable: !0,
  2946. configurable: !0
  2947. });
  2948. return a
  2949. }(b.ScrollView);
  2950. b.Scroller = e;
  2951. e.prototype.__class__ = "egret.Scroller"
  2952. })(egret || (egret = {}));
  2953. (function(b) {
  2954. var e = function() {
  2955. function b() {}
  2956. b.REPEAT = "repeat";
  2957. b.SCALE = "scale";
  2958. return b
  2959. }();
  2960. b.BitmapFillMode = e;
  2961. e.prototype.__class__ = "egret.BitmapFillMode"
  2962. })(egret || (egret = {}));
  2963. __extends = this.__extends || function(b, e) {
  2964. function d() {
  2965. this.constructor = b
  2966. }
  2967. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  2968. d.prototype = e.prototype;
  2969. b.prototype = new d
  2970. };
  2971. (function(b) {
  2972. var e = function(d) {
  2973. function a(c) {
  2974. d.call(this);
  2975. this.debug = !1;
  2976. this.debugColor = 16711680;
  2977. this.scale9Grid = null;
  2978. this.fillMode = "scale";
  2979. c && (this._texture = c, this._setSizeDirty())
  2980. }
  2981. __extends(a, d);
  2982. Object.defineProperty(a.prototype, "texture", {
  2983. get: function() {
  2984. return this._texture
  2985. },
  2986. set: function(c) {
  2987. c != this._texture && (this._setSizeDirty(), this._texture = c)
  2988. },
  2989. enumerable: !0,
  2990. configurable: !0
  2991. });
  2992. a.prototype._render = function(c) {
  2993. var b = this._texture;
  2994. b ? (this._texture_to_render = b, a._drawBitmap(c, this._hasWidthSet ? this._explicitWidth :
  2995. b._textureWidth, this._hasHeightSet ? this._explicitHeight : b._textureHeight, this)) : this._texture_to_render = null
  2996. };
  2997. a._drawBitmap = function(c, b, d, e) {
  2998. var h = e._texture_to_render;
  2999. if (h) {
  3000. var f = h._textureWidth,
  3001. k = h._textureHeight;
  3002. if ("scale" == e.fillMode) {
  3003. var m = e.scale9Grid || h.scale9Grid;
  3004. if (m && f - m.width < b && k - m.height < d) a.drawScale9GridImage(c, e, m, b, d);
  3005. else {
  3006. var m = h._offsetX,
  3007. p = h._offsetY,
  3008. q = h._bitmapWidth || f,
  3009. r = h._bitmapHeight || k;
  3010. b /= f;
  3011. m = Math.round(m * b);
  3012. b = Math.round(q * b);
  3013. d /= k;
  3014. p = Math.round(p * d);
  3015. d = Math.round(r * d);
  3016. a.renderFilter.drawImage(c,
  3017. e, h._bitmapX, h._bitmapY, q, r, m, p, b, d)
  3018. }
  3019. } else a.drawRepeatImage(c, e, b, d, e.fillMode)
  3020. }
  3021. };
  3022. a.drawRepeatImage = function(c, a, d, e, h) {
  3023. var f = a._texture_to_render;
  3024. if (f) {
  3025. var k = f._textureWidth,
  3026. m = f._textureHeight,
  3027. p = f._bitmapX,
  3028. q = f._bitmapY,
  3029. k = f._bitmapWidth || k,
  3030. m = f._bitmapHeight || m,
  3031. r = f._offsetX,
  3032. f = f._offsetY;
  3033. b.RenderFilter.getInstance().drawImage(c, a, p, q, k, m, r, f, d, e, h)
  3034. }
  3035. };
  3036. a.drawScale9GridImage = function(c, a, d, e, h) {
  3037. var f = a._texture_to_render;
  3038. if (f && d) {
  3039. var k = b.RenderFilter.getInstance(),
  3040. m = f._textureWidth,
  3041. p = f._textureHeight,
  3042. q = f._bitmapX,
  3043. r = f._bitmapY,
  3044. s = f._bitmapWidth || m,
  3045. t = f._bitmapHeight || p,
  3046. u = f._offsetX,
  3047. f = f._offsetY;
  3048. d = b.Rectangle.identity.initialize(d.x - Math.round(u), d.y - Math.round(u), d.width, d.height);
  3049. u = Math.round(u);
  3050. f = Math.round(f);
  3051. e -= m - s;
  3052. h -= p - t;
  3053. d.y == d.bottom && (d.bottom < t ? d.bottom++ : d.y--);
  3054. d.x == d.right && (d.right < s ? d.right++ : d.x--);
  3055. var m = q + d.x,
  3056. p = q + d.right,
  3057. v = s - d.right,
  3058. x = r + d.y,
  3059. y = r + d.bottom,
  3060. w = t - d.bottom,
  3061. z = u + d.x,
  3062. A = f + d.y,
  3063. t = h - (t - d.bottom),
  3064. s = e - (s - d.right);
  3065. k.drawImage(c, a, q, r, d.x, d.y, u, f, d.x, d.y);
  3066. k.drawImage(c, a, m, r, d.width,
  3067. d.y, z, f, s - d.x, d.y);
  3068. k.drawImage(c, a, p, r, v, d.y, u + s, f, e - s, d.y);
  3069. k.drawImage(c, a, q, x, d.x, d.height, u, A, d.x, t - d.y);
  3070. k.drawImage(c, a, m, x, d.width, d.height, z, A, s - d.x, t - d.y);
  3071. k.drawImage(c, a, p, x, v, d.height, u + s, A, e - s, t - d.y);
  3072. k.drawImage(c, a, q, y, d.x, w, u, f + t, d.x, h - t);
  3073. k.drawImage(c, a, m, y, d.width, w, z, f + t, s - d.x, h - t);
  3074. k.drawImage(c, a, p, y, v, w, u + s, f + t, e - s, h - t)
  3075. }
  3076. };
  3077. a.prototype._measureBounds = function() {
  3078. var c = this._texture;
  3079. return c ? b.Rectangle.identity.initialize(c._offsetX, c._offsetY, c._textureWidth, c._textureHeight) : d.prototype._measureBounds.call(this)
  3080. };
  3081. a.debug = !1;
  3082. a.renderFilter = b.RenderFilter.getInstance();
  3083. return a
  3084. }(b.DisplayObject);
  3085. b.Bitmap = e;
  3086. e.prototype.__class__ = "egret.Bitmap"
  3087. })(egret || (egret = {}));
  3088. __extends = this.__extends || function(b, e) {
  3089. function d() {
  3090. this.constructor = b
  3091. }
  3092. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3093. d.prototype = e.prototype;
  3094. b.prototype = new d
  3095. };
  3096. (function(b) {
  3097. var e = function(d) {
  3098. function a() {
  3099. d.call(this);
  3100. this._text = "";
  3101. this._textChanged = !1;
  3102. this._bitmapPool = []
  3103. }
  3104. __extends(a, d);
  3105. Object.defineProperty(a.prototype, "text", {
  3106. get: function() {
  3107. return this._text
  3108. },
  3109. set: function(c) {
  3110. this._textChanged = !0;
  3111. this._text = c;
  3112. this._setSizeDirty()
  3113. },
  3114. enumerable: !0,
  3115. configurable: !0
  3116. });
  3117. a.prototype._updateTransform = function() {
  3118. this.visible && (this._textChanged && this._renderText(), d.prototype._updateTransform.call(this))
  3119. };
  3120. a.prototype._renderText = function(c) {
  3121. var a = c = 0;
  3122. this._textChanged &&
  3123. this.removeChildren();
  3124. for (var d = 0, e = this.text.length; d < e; d++) {
  3125. var h = this.text.charAt(d),
  3126. f = this.spriteSheet.getTexture(h);
  3127. if (null == f) console.log("当前没有位图文字:" + h);
  3128. else {
  3129. var h = f._offsetX,
  3130. k = f._offsetY,
  3131. m = f._textureWidth;
  3132. if (this._textChanged) {
  3133. var p = this._bitmapPool[d];
  3134. p || (p = new b.Bitmap, this._bitmapPool.push(p));
  3135. p.texture = f;
  3136. this.addChild(p);
  3137. p.x = c
  3138. }
  3139. c += m + h;
  3140. k + f._textureHeight > a && (a = k + f._textureHeight)
  3141. }
  3142. }
  3143. this._textChanged = !1;
  3144. return b.Rectangle.identity.initialize(0, 0,
  3145. c, a)
  3146. };
  3147. a.prototype._measureBounds = function() {
  3148. return this._renderText(!0)
  3149. };
  3150. return a
  3151. }(b.DisplayObjectContainer);
  3152. b.BitmapText = e;
  3153. e.prototype.__class__ = "egret.BitmapText"
  3154. })(egret || (egret = {}));
  3155. (function(b) {
  3156. var e = function() {
  3157. function b() {
  3158. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3159. this.commandQueue = []
  3160. }
  3161. b.prototype.beginFill = function(a, c) {};
  3162. b.prototype._setStyle = function(a) {};
  3163. b.prototype.drawRect = function(a, c, b, d) {
  3164. this.checkRect(a, c, b, d)
  3165. };
  3166. b.prototype.drawCircle = function(a, c, b) {
  3167. this.checkRect(a - b, c - b, 2 * b, 2 * b)
  3168. };
  3169. b.prototype.drawRoundRect = function(a, c, b, d, e, h) {
  3170. this.checkRect(a, c, b, d)
  3171. };
  3172. b.prototype.drawEllipse = function(a, c, b, d) {
  3173. this.checkRect(a - b, c - d, 2 * b, 2 * d)
  3174. };
  3175. b.prototype.lineStyle =
  3176. function(a, c, b, d, e, h, f, k) {};
  3177. b.prototype.lineTo = function(a, c) {
  3178. this.checkPoint(a, c)
  3179. };
  3180. b.prototype.curveTo = function(a, c, b, d) {
  3181. this.checkPoint(a, c);
  3182. this.checkPoint(b, d)
  3183. };
  3184. b.prototype.moveTo = function(a, c) {
  3185. this.checkPoint(a, c)
  3186. };
  3187. b.prototype.clear = function() {
  3188. this._maxY = this._maxX = this._minY = this._minX = 0
  3189. };
  3190. b.prototype.endFill = function() {};
  3191. b.prototype._draw = function(a) {};
  3192. b.prototype.checkRect = function(a, c, b, d) {
  3193. this._minX = Math.min(this._minX, a);
  3194. this._minY = Math.min(this._minY, c);
  3195. this._maxX = Math.max(this._maxX, a +
  3196. b);
  3197. this._maxY = Math.max(this._maxY, c + d)
  3198. };
  3199. b.prototype.checkPoint = function(a, c) {
  3200. this._minX = Math.min(this._minX, a);
  3201. this._minY = Math.min(this._minY, c);
  3202. this._maxX = Math.max(this._maxX, a);
  3203. this._maxY = Math.max(this._maxY, c);
  3204. this._lastX = a;
  3205. this._lastY = c
  3206. };
  3207. return b
  3208. }();
  3209. b.Graphics = e;
  3210. e.prototype.__class__ = "egret.Graphics";
  3211. (function() {
  3212. return function(b, a, c) {
  3213. this.method = b;
  3214. this.thisObject = a;
  3215. this.args = c
  3216. }
  3217. })().prototype.__class__ = "egret.Command"
  3218. })(egret || (egret = {}));
  3219. __extends = this.__extends || function(b, e) {
  3220. function d() {
  3221. this.constructor = b
  3222. }
  3223. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3224. d.prototype = e.prototype;
  3225. b.prototype = new d
  3226. };
  3227. (function(b) {
  3228. var e = function(d) {
  3229. function a() {
  3230. d.call(this)
  3231. }
  3232. __extends(a, d);
  3233. Object.defineProperty(a.prototype, "graphics", {
  3234. get: function() {
  3235. this._graphics || (this._graphics = new b.Graphics);
  3236. return this._graphics
  3237. },
  3238. enumerable: !0,
  3239. configurable: !0
  3240. });
  3241. a.prototype._render = function(c) {
  3242. this._graphics && this._graphics._draw(c)
  3243. };
  3244. return a
  3245. }(b.DisplayObject);
  3246. b.Shape = e;
  3247. e.prototype.__class__ = "egret.Shape"
  3248. })(egret || (egret = {}));
  3249. __extends = this.__extends || function(b, e) {
  3250. function d() {
  3251. this.constructor = b
  3252. }
  3253. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3254. d.prototype = e.prototype;
  3255. b.prototype = new d
  3256. };
  3257. (function(b) {
  3258. var e = function(d) {
  3259. function a() {
  3260. d.call(this)
  3261. }
  3262. __extends(a, d);
  3263. Object.defineProperty(a.prototype, "graphics", {
  3264. get: function() {
  3265. this._graphics || (this._graphics = new b.Graphics);
  3266. return this._graphics
  3267. },
  3268. enumerable: !0,
  3269. configurable: !0
  3270. });
  3271. a.prototype._render = function(c) {
  3272. this._graphics && this._graphics._draw(c);
  3273. d.prototype._render.call(this, c)
  3274. };
  3275. return a
  3276. }(b.DisplayObjectContainer);
  3277. b.Sprite = e;
  3278. e.prototype.__class__ = "egret.Sprite"
  3279. })(egret || (egret = {}));
  3280. __extends = this.__extends || function(b, e) {
  3281. function d() {
  3282. this.constructor = b
  3283. }
  3284. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3285. d.prototype = e.prototype;
  3286. b.prototype = new d
  3287. };
  3288. (function(b) {
  3289. var e = function(d) {
  3290. function a() {
  3291. d.call(this);
  3292. this._inputEnabled = !1;
  3293. this._text = this._type = "";
  3294. this._displayAsPassword = !1;
  3295. this._fontFamily = a.default_fontFamily;
  3296. this._size = 30;
  3297. this._textColorString = "#FFFFFF";
  3298. this._textColor = 16777215;
  3299. this._strokeColorString = "#000000";
  3300. this._stroke = this._strokeColor = 0;
  3301. this._textAlign = "left";
  3302. this._verticalAlign = "top";
  3303. this._maxChars = 0;
  3304. this._scrollV = -1;
  3305. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3306. this._isFlow = this._multiline = !1;
  3307. this._textArr = [];
  3308. this._isArrayChanged = !1;
  3309. this._textMaxHeight = this._textMaxWidth = 0;
  3310. this._linesArr = []
  3311. }
  3312. __extends(a, d);
  3313. a.prototype.isInput = function() {
  3314. return this._type == b.TextFieldType.INPUT
  3315. };
  3316. a.prototype._setTouchEnabled = function(c) {
  3317. d.prototype._setTouchEnabled.call(this, c);
  3318. this.isInput() && (this._inputEnabled = !0)
  3319. };
  3320. Object.defineProperty(a.prototype, "type", {
  3321. get: function() {
  3322. return this._type
  3323. },
  3324. set: function(c) {
  3325. this._setType(c)
  3326. },
  3327. enumerable: !0,
  3328. configurable: !0
  3329. });
  3330. a.prototype._setType = function(c) {
  3331. this._type != c && (this._type = c, this._type == b.TextFieldType.INPUT ?
  3332. (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3333. };
  3334. Object.defineProperty(a.prototype, "text", {
  3335. get: function() {
  3336. return this._getText()
  3337. },
  3338. set: function(c) {
  3339. this._setText(c)
  3340. },
  3341. enumerable: !0,
  3342. configurable: !0
  3343. });
  3344. a.prototype._getText = function() {
  3345. return this._type ==
  3346. b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3347. };
  3348. a.prototype._setSizeDirty = function() {
  3349. d.prototype._setSizeDirty.call(this);
  3350. this._isArrayChanged = !0
  3351. };
  3352. a.prototype._setTextDirty = function() {
  3353. this._setSizeDirty()
  3354. };
  3355. a.prototype._setBaseText = function(c) {
  3356. null == c && (c = "");
  3357. this._isFlow = !1;
  3358. if (this._text != c || this._displayAsPassword) this._setTextDirty(), this._text = c, c = "", c = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3359. text: c
  3360. }])
  3361. };
  3362. a.prototype._setText = function(c) {
  3363. null ==
  3364. c && (c = "");
  3365. this._setBaseText(c);
  3366. this._inputUtils && this._inputUtils._setText(this._text)
  3367. };
  3368. Object.defineProperty(a.prototype, "displayAsPassword", {
  3369. get: function() {
  3370. return this._displayAsPassword
  3371. },
  3372. set: function(c) {
  3373. this._setDisplayAsPassword(c)
  3374. },
  3375. enumerable: !0,
  3376. configurable: !0
  3377. });
  3378. a.prototype._setDisplayAsPassword = function(c) {
  3379. this._displayAsPassword != c && (this._displayAsPassword = c, this._setText(this._text))
  3380. };
  3381. Object.defineProperty(a.prototype, "fontFamily", {
  3382. get: function() {
  3383. return this._fontFamily
  3384. },
  3385. set: function(c) {
  3386. this._setFontFamily(c)
  3387. },
  3388. enumerable: !0,
  3389. configurable: !0
  3390. });
  3391. a.prototype._setFontFamily = function(c) {
  3392. this._fontFamily != c && (this._setTextDirty(), this._fontFamily = c)
  3393. };
  3394. Object.defineProperty(a.prototype, "size", {
  3395. get: function() {
  3396. return this._size
  3397. },
  3398. set: function(c) {
  3399. this._setSize(c)
  3400. },
  3401. enumerable: !0,
  3402. configurable: !0
  3403. });
  3404. a.prototype._setSize = function(c) {
  3405. this._size != c && (this._setTextDirty(), this._size = c)
  3406. };
  3407. Object.defineProperty(a.prototype, "italic", {
  3408. get: function() {
  3409. return this._italic
  3410. },
  3411. set: function(c) {
  3412. this._setItalic(c)
  3413. },
  3414. enumerable: !0,
  3415. configurable: !0
  3416. });
  3417. a.prototype._setItalic = function(c) {
  3418. this._italic != c && (this._setTextDirty(), this._italic = c)
  3419. };
  3420. Object.defineProperty(a.prototype, "bold", {
  3421. get: function() {
  3422. return this._bold
  3423. },
  3424. set: function(c) {
  3425. this._setBold(c)
  3426. },
  3427. enumerable: !0,
  3428. configurable: !0
  3429. });
  3430. a.prototype._setBold = function(c) {
  3431. this._bold != c && (this._setTextDirty(), this._bold = c)
  3432. };
  3433. Object.defineProperty(a.prototype, "textColor", {
  3434. get: function() {
  3435. return this._textColor
  3436. },
  3437. set: function(c) {
  3438. this._setTextColor(c)
  3439. },
  3440. enumerable: !0,
  3441. configurable: !0
  3442. });
  3443. a.prototype._setTextColor =
  3444. function(c) {
  3445. this._textColor != c && (this._setTextDirty(), this._textColor = c, this._textColorString = b.toColorString(c))
  3446. };
  3447. Object.defineProperty(a.prototype, "strokeColor", {
  3448. get: function() {
  3449. return this._strokeColor
  3450. },
  3451. set: function(c) {
  3452. this._setStrokeColor(c)
  3453. },
  3454. enumerable: !0,
  3455. configurable: !0
  3456. });
  3457. a.prototype._setStrokeColor = function(c) {
  3458. this._strokeColor != c && (this._setTextDirty(), this._strokeColor = c, this._strokeColorString = b.toColorString(c))
  3459. };
  3460. Object.defineProperty(a.prototype, "stroke", {
  3461. get: function() {
  3462. return this._stroke
  3463. },
  3464. set: function(c) {
  3465. this._setStroke(c)
  3466. },
  3467. enumerable: !0,
  3468. configurable: !0
  3469. });
  3470. a.prototype._setStroke = function(c) {
  3471. this._stroke != c && (this._setTextDirty(), this._stroke = c)
  3472. };
  3473. Object.defineProperty(a.prototype, "textAlign", {
  3474. get: function() {
  3475. return this._textAlign
  3476. },
  3477. set: function(c) {
  3478. this._setTextAlign(c)
  3479. },
  3480. enumerable: !0,
  3481. configurable: !0
  3482. });
  3483. a.prototype._setTextAlign = function(c) {
  3484. this._textAlign != c && (this._setTextDirty(), this._textAlign = c)
  3485. };
  3486. Object.defineProperty(a.prototype, "verticalAlign", {
  3487. get: function() {
  3488. return this._verticalAlign
  3489. },
  3490. set: function(c) {
  3491. this._setVerticalAlign(c)
  3492. },
  3493. enumerable: !0,
  3494. configurable: !0
  3495. });
  3496. a.prototype._setVerticalAlign = function(c) {
  3497. this._verticalAlign != c && (this._setTextDirty(), this._verticalAlign = c)
  3498. };
  3499. Object.defineProperty(a.prototype, "maxChars", {
  3500. get: function() {
  3501. return this._maxChars
  3502. },
  3503. set: function(c) {
  3504. this._setMaxChars(c)
  3505. },
  3506. enumerable: !0,
  3507. configurable: !0
  3508. });
  3509. a.prototype._setMaxChars = function(c) {
  3510. this._maxChars != c && (this._maxChars = c)
  3511. };
  3512. Object.defineProperty(a.prototype, "scrollV", {
  3513. set: function(c) {
  3514. this._scrollV = c;
  3515. this._setDirty()
  3516. },
  3517. enumerable: !0,
  3518. configurable: !0
  3519. });
  3520. Object.defineProperty(a.prototype, "maxScrollV", {
  3521. get: function() {
  3522. return this._maxScrollV
  3523. },
  3524. enumerable: !0,
  3525. configurable: !0
  3526. });
  3527. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3528. get: function() {
  3529. return 0
  3530. },
  3531. enumerable: !0,
  3532. configurable: !0
  3533. });
  3534. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3535. get: function() {
  3536. return 0
  3537. },
  3538. enumerable: !0,
  3539. configurable: !0
  3540. });
  3541. Object.defineProperty(a.prototype, "caretIndex", {
  3542. get: function() {
  3543. return 0
  3544. },
  3545. enumerable: !0,
  3546. configurable: !0
  3547. });
  3548. a.prototype._setSelection =
  3549. function(c, a) {};
  3550. Object.defineProperty(a.prototype, "lineSpacing", {
  3551. get: function() {
  3552. return this._lineSpacing
  3553. },
  3554. set: function(c) {
  3555. this._setLineSpacing(c)
  3556. },
  3557. enumerable: !0,
  3558. configurable: !0
  3559. });
  3560. a.prototype._setLineSpacing = function(c) {
  3561. this._lineSpacing != c && (this._setTextDirty(), this._lineSpacing = c)
  3562. };
  3563. a.prototype._getLineHeight = function() {
  3564. return this._lineSpacing + this._size
  3565. };
  3566. Object.defineProperty(a.prototype, "numLines", {
  3567. get: function() {
  3568. return this._numLines
  3569. },
  3570. enumerable: !0,
  3571. configurable: !0
  3572. });
  3573. Object.defineProperty(a.prototype,
  3574. "multiline", {
  3575. get: function() {
  3576. return this._multiline
  3577. },
  3578. set: function(c) {
  3579. this._setMultiline(c)
  3580. },
  3581. enumerable: !0,
  3582. configurable: !0
  3583. });
  3584. a.prototype._setMultiline = function(c) {
  3585. this._multiline = c;
  3586. this._setDirty()
  3587. };
  3588. a.prototype.setFocus = function() {
  3589. b.Logger.warning("TextField.setFocus 没有实现")
  3590. };
  3591. a.prototype._onRemoveFromStage = function() {
  3592. d.prototype._onRemoveFromStage.call(this);
  3593. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3594. };
  3595. a.prototype._onAddToStage = function() {
  3596. d.prototype._onAddToStage.call(this);
  3597. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3598. };
  3599. a.prototype._updateBaseTransform = function() {
  3600. d.prototype._updateTransform.call(this)
  3601. };
  3602. a.prototype._updateTransform = function() {
  3603. this._type == b.TextFieldType.INPUT ? this._normalDirty ? (this._clearDirty(), this._inputUtils._updateProperties()) : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3604. };
  3605. a.prototype._render = function(c) {
  3606. this.drawText(c);
  3607. this._clearDirty()
  3608. };
  3609. a.prototype._measureBounds = function() {
  3610. return this.measureText()
  3611. };
  3612. Object.defineProperty(a.prototype, "textFlow", {
  3613. set: function(c) {
  3614. this._isFlow = !0;
  3615. for (var a = "", b = 0; b < c.length; b++) a += c[b].text;
  3616. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(c))
  3617. },
  3618. enumerable: !0,
  3619. configurable: !0
  3620. });
  3621. a.prototype.changeToPassText = function(c) {
  3622. if (this._displayAsPassword) {
  3623. for (var a = "", b = 0, d = c.length; b < d; b++) switch (c.charAt(b)) {
  3624. case "\n":
  3625. a += "\n";
  3626. break;
  3627. case "\r":
  3628. break;
  3629. default:
  3630. a += "*"
  3631. }
  3632. return a
  3633. }
  3634. return c
  3635. };
  3636. a.prototype.setMiddleStyle = function(c) {
  3637. this._isArrayChanged = !0;
  3638. this._textArr = c;
  3639. this._setSizeDirty()
  3640. };
  3641. Object.defineProperty(a.prototype, "textWidth", {
  3642. get: function() {
  3643. return this._textMaxWidth
  3644. },
  3645. enumerable: !0,
  3646. configurable: !0
  3647. });
  3648. Object.defineProperty(a.prototype, "textHeight", {
  3649. get: function() {
  3650. return this._textMaxHeight
  3651. },
  3652. enumerable: !0,
  3653. configurable: !0
  3654. });
  3655. a.prototype.appendText = function(c) {
  3656. this.appendElement({
  3657. text: c
  3658. })
  3659. };
  3660. a.prototype.appendElement = function(c) {
  3661. this._textArr.push(c);
  3662. this.setMiddleStyle(this._textArr)
  3663. };
  3664. a.prototype._getLinesArr = function() {
  3665. if (!this._isArrayChanged) return this._linesArr;
  3666. this._isArrayChanged = !1;
  3667. var c = this._textArr,
  3668. a = b.MainContext.instance.rendererContext;
  3669. this._linesArr = [];
  3670. this._textMaxWidth = this._textMaxHeight = 0;
  3671. var d = this._linesArr,
  3672. e = 0,
  3673. h = 0,
  3674. f = 0,
  3675. k;
  3676. this._isFlow || a.setupFont(this);
  3677. for (var m = 0; m < c.length; m++) {
  3678. var p = c[m];
  3679. p.style = p.style || {};
  3680. for (var q = p.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  3681. null == d[f] && (k = {
  3682. width: 0,
  3683. height: 0,
  3684. elements: []
  3685. }, d[f] = k, h = e = 0);
  3686. h = this._type == b.TextFieldType.INPUT ? this._size : Math.max(h, p.style.size || this._size);
  3687. if ("" != q[r]) {
  3688. this._isFlow &&
  3689. a.setupFont(this, p.style);
  3690. var s = a.measureText(q[r]);
  3691. if (this._hasWidthSet)
  3692. if (e + s <= this._explicitWidth) k.elements.push({
  3693. width: s,
  3694. text: q[r],
  3695. style: p.style
  3696. }), e += s;
  3697. else {
  3698. for (var t = 0, u = 0, v = q[r]; t < v.length; t++) {
  3699. s = a.measureText(v.charAt(t));
  3700. if (e + s > this._explicitWidth) break;
  3701. u += s;
  3702. e += s
  3703. }
  3704. 0 < t && (k.elements.push({
  3705. width: u,
  3706. text: v.substring(0, t),
  3707. style: p.style
  3708. }), q[r] = v.substring(t));
  3709. r--
  3710. } else e += s, k.elements.push({
  3711. width: s,
  3712. text: q[r],
  3713. style: p.style
  3714. })
  3715. }
  3716. if (r < q.length - 1) {
  3717. k.width = e;
  3718. k.height = h;
  3719. this._textMaxWidth = Math.max(this._textMaxWidth,
  3720. e);
  3721. this._textMaxHeight += h;
  3722. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = d.length, d;
  3723. f++
  3724. }
  3725. }
  3726. m == c.length - 1 && k && (k.width = e, k.height = h, this._textMaxWidth = Math.max(this._textMaxWidth, e), this._textMaxHeight += h)
  3727. }
  3728. this._numLines = d.length;
  3729. return d
  3730. };
  3731. a.prototype.measureText = function() {
  3732. return this._getLinesArr() ? b.Rectangle.identity.initialize(0, 0, this._hasWidthSet ? this._explicitWidth : this._textMaxWidth, this._hasHeightSet ? this._explicitHeight : this._textMaxHeight + (this._numLines - 1) *
  3733. this._lineSpacing) : b.Rectangle.identity.initialize(0, 0, 0, 0)
  3734. };
  3735. a.prototype.drawText = function(c) {
  3736. var a = this._getLinesArr();
  3737. if (a) {
  3738. this._isFlow || c.setupFont(this);
  3739. var d = this._hasWidthSet ? this._explicitWidth : this._textMaxWidth,
  3740. e = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  3741. h = 0,
  3742. f = 0;
  3743. if (this._hasHeightSet)
  3744. if (e < this._explicitHeight) {
  3745. var k = 0;
  3746. this._verticalAlign == b.VerticalAlign.MIDDLE ? k = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (k = 1);
  3747. h += k * (this._explicitHeight - e)
  3748. } else e > this._explicitHeight &&
  3749. (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  3750. h = Math.round(h);
  3751. e = 0;
  3752. this._textAlign == b.HorizontalAlign.CENTER ? e = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (e = 1);
  3753. for (k = 0; f < this._numLines; f++) {
  3754. var m = a[f],
  3755. p = m.height,
  3756. h = h + p / 2;
  3757. if (0 != f && this._hasHeightSet && h > this._explicitHeight) break;
  3758. for (var k = Math.round((d - m.width) * e), q = 0; q < m.elements.length; q++) {
  3759. var r = m.elements[q],
  3760. s = r.style.size || this._size;
  3761. this._type == b.TextFieldType.INPUT ? c.drawText(this, r.text, k, h + (p - s) / 2, r.width) : (this._isFlow &&
  3762. c.setupFont(this, r.style), c.drawText(this, r.text, k, h + (p - s) / 2, r.width, r.style));
  3763. k += r.width
  3764. }
  3765. h += p / 2 + this._lineSpacing
  3766. }
  3767. }
  3768. };
  3769. a.default_fontFamily = "Arial";
  3770. return a
  3771. }(b.DisplayObject);
  3772. b.TextField = e;
  3773. e.prototype.__class__ = "egret.TextField"
  3774. })(egret || (egret = {}));
  3775. (function(b) {
  3776. var e = function() {
  3777. function b() {
  3778. this.resutlArr = []
  3779. }
  3780. b.prototype.parser = function(a) {
  3781. this.stackArray = [];
  3782. this.resutlArr = [];
  3783. for (var c = 0, b = a.length; c < b;) {
  3784. var d = a.indexOf("<", c);
  3785. 0 > d ? (this.addToResultArr(a.substring(c)), c = b) : (this.addToResultArr(a.substring(c, d)), c = a.indexOf(">", d), "/" == a.charAt(d + 1) ? this.stackArray.pop() : this.addToArray(a.substring(d + 1, c)), c += 1)
  3786. }
  3787. return this.resutlArr
  3788. };
  3789. b.prototype.addToResultArr = function(a) {
  3790. if ("" != a) {
  3791. var c = [];
  3792. c.push(["&lt;", "<"]);
  3793. c.push(["&gt;", ">"]);
  3794. c.push(["&amp;",
  3795. "&"
  3796. ]);
  3797. c.push(["&quot;", '"']);
  3798. c.push(["&apos;;", "'"]);
  3799. for (var b = 0; b < c.length; b++) a.replace(new RegExp(c[b][0], "g"), c[b][1]);
  3800. 0 < this.stackArray.length ? this.resutlArr.push({
  3801. text: a,
  3802. style: this.stackArray[this.stackArray.length - 1]
  3803. }) : this.resutlArr.push({
  3804. text: a
  3805. })
  3806. }
  3807. };
  3808. b.prototype.changeStringToObject = function(a) {
  3809. var c = {};
  3810. a = a.replace(/( )+/g, " ").split(" ");
  3811. for (var b = 0; b < a.length; b++) this.addProperty(c, a[b]);
  3812. return c
  3813. };
  3814. b.prototype.addProperty = function(a, c) {
  3815. var b = c.replace(/( )*=( )*/g, "=").split("=");
  3816. b[1] && (b[1] =
  3817. b[1].replace(/(\"|\')/g, ""));
  3818. switch (b[0].toLowerCase()) {
  3819. case "color":
  3820. a.textColor = parseInt(b[1]);
  3821. break;
  3822. case "b":
  3823. a.bold = "true" == (b[1] || "true");
  3824. break;
  3825. case "i":
  3826. a.italic = "true" == (b[1] || "true");
  3827. break;
  3828. case "size":
  3829. a.size = parseInt(b[1]);
  3830. break;
  3831. case "fontFamily":
  3832. a.fontFamily = b[1]
  3833. }
  3834. };
  3835. b.prototype.addToArray = function(a) {
  3836. a = this.changeStringToObject(a);
  3837. if (0 != this.stackArray.length) {
  3838. var c = this.stackArray[this.stackArray.length - 1],
  3839. b;
  3840. for (b in c) null == a[b] && (a[b] = c[b])
  3841. }
  3842. this.stackArray.push(a)
  3843. };
  3844. return b
  3845. }();
  3846. b.HtmlTextParser =
  3847. e;
  3848. e.prototype.__class__ = "egret.HtmlTextParser"
  3849. })(egret || (egret = {}));
  3850. (function(b) {
  3851. var e = function() {
  3852. function b() {}
  3853. b.DYNAMIC = "dynamic";
  3854. b.INPUT = "input";
  3855. return b
  3856. }();
  3857. b.TextFieldType = e;
  3858. e.prototype.__class__ = "egret.TextFieldType"
  3859. })(egret || (egret = {}));
  3860. __extends = this.__extends || function(b, e) {
  3861. function d() {
  3862. this.constructor = b
  3863. }
  3864. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3865. d.prototype = e.prototype;
  3866. b.prototype = new d
  3867. };
  3868. (function(b) {
  3869. var e = function(d) {
  3870. function a(c) {
  3871. d.call(this);
  3872. var a = c.bitmapData;
  3873. this.bitmapData = a;
  3874. this._textureMap = {};
  3875. this._sourceWidth = a.width;
  3876. this._sourceHeight = a.height;
  3877. this._bitmapX = c._bitmapX - c._offsetX;
  3878. this._bitmapY = c._bitmapY - c._offsetY
  3879. }
  3880. __extends(a, d);
  3881. a.prototype.getTexture = function(c) {
  3882. return this._textureMap[c]
  3883. };
  3884. a.prototype.createTexture = function(c, a, d, e, h, f, k, m, p) {
  3885. void 0 === f && (f = 0);
  3886. void 0 === k && (k = 0);
  3887. "undefined" === typeof m && (m = f + e);
  3888. "undefined" === typeof p && (p = k + h);
  3889. var q = new b.Texture;
  3890. q._bitmapData =
  3891. this.bitmapData;
  3892. q._bitmapX = this._bitmapX + a;
  3893. q._bitmapY = this._bitmapY + d;
  3894. q._bitmapWidth = e;
  3895. q._bitmapHeight = h;
  3896. q._offsetX = f;
  3897. q._offsetY = k;
  3898. q._textureWidth = m;
  3899. q._textureHeight = p;
  3900. q._sourceWidth = this._sourceWidth;
  3901. q._sourceHeight = this._sourceHeight;
  3902. return this._textureMap[c] = q
  3903. };
  3904. return a
  3905. }(b.HashObject);
  3906. b.SpriteSheet = e;
  3907. e.prototype.__class__ = "egret.SpriteSheet"
  3908. })(egret || (egret = {}));
  3909. __extends = this.__extends || function(b, e) {
  3910. function d() {
  3911. this.constructor = b
  3912. }
  3913. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3914. d.prototype = e.prototype;
  3915. b.prototype = new d
  3916. };
  3917. (function(b) {
  3918. var e = function(d) {
  3919. function a() {
  3920. d.call(this);
  3921. b.Logger.warning("TextInput 已废弃,请使用TextField代替,并设置type为TextFieldType.INPUT");
  3922. this.type = b.TextFieldType.INPUT
  3923. }
  3924. __extends(a, d);
  3925. a.prototype.setText = function(c) {
  3926. b.Logger.warning("TextField.setText()已废弃,请使用TextInput.text设置");
  3927. this.text = c
  3928. };
  3929. a.prototype.getText = function() {
  3930. b.Logger.warning("TextField.getText()已废弃,请使用TextInput.text获取");
  3931. return this.text
  3932. };
  3933. a.prototype.setTextType = function(c) {
  3934. b.Logger.warning("TextField.setTextType()已废弃,请使用TextInput.displayAsPassword设置");
  3935. this.displayAsPassword = "password" == c
  3936. };
  3937. a.prototype.getTextType = function() {
  3938. b.Logger.warning("TextField.getTextType()已废弃,请使用TextInput.displayAsPassword获取");
  3939. return this.displayAsPassword ? "password" : "text"
  3940. };
  3941. return a
  3942. }(b.TextField);
  3943. b.TextInput = e;
  3944. e.prototype.__class__ = "egret.TextInput"
  3945. })(egret ||
  3946. (egret = {}));
  3947. __extends = this.__extends || function(b, e) {
  3948. function d() {
  3949. this.constructor = b
  3950. }
  3951. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  3952. d.prototype = e.prototype;
  3953. b.prototype = new d
  3954. };
  3955. (function(b) {
  3956. var e = function(d) {
  3957. function a() {
  3958. d.call(this);
  3959. this._isFocus = !1;
  3960. this._isFirst = this._isFirst = !0
  3961. }
  3962. __extends(a, d);
  3963. a.prototype.init = function(c) {
  3964. this._text = c;
  3965. this.stageText = b.StageText.create();
  3966. c = this._text.localToGlobal();
  3967. this.stageText._open(c.x, c.y, this._text._explicitWidth, this._text._explicitHeight)
  3968. };
  3969. a.prototype._addStageText = function() {
  3970. this._text._inputEnabled || (this._text._touchEnabled = !0);
  3971. this.stageText._add();
  3972. this.stageText._addListeners();
  3973. this.stageText.addEventListener("blur", this.onBlurHandler,
  3974. this);
  3975. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  3976. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  3977. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3978. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3979. };
  3980. a.prototype._removeStageText = function() {
  3981. this.stageText._remove();
  3982. this.stageText._removeListeners();
  3983. this._text._inputEnabled || (this._text._touchEnabled = !1);
  3984. this.stageText.removeEventListener("blur",
  3985. this.onBlurHandler, this);
  3986. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  3987. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  3988. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  3989. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this)
  3990. };
  3991. a.prototype._getText = function() {
  3992. return this.stageText._getText()
  3993. };
  3994. a.prototype._setText = function(c) {
  3995. this.stageText._setText(c)
  3996. };
  3997. a.prototype.onFocusHandler =
  3998. function(c) {
  3999. this.hideText()
  4000. };
  4001. a.prototype.onBlurHandler = function(c) {
  4002. this.showText()
  4003. };
  4004. a.prototype.onMouseDownHandler = function(c) {
  4005. c.stopPropagation();
  4006. this._text._visible && this.stageText._show()
  4007. };
  4008. a.prototype.onStageDownHandler = function(c) {
  4009. this.stageText._hide();
  4010. this.showText()
  4011. };
  4012. a.prototype.showText = function() {
  4013. this._isFocus && (this._isFocus = !1, this.resetText())
  4014. };
  4015. a.prototype.hideText = function() {
  4016. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4017. };
  4018. a.prototype.updateTextHandler = function(c) {
  4019. this.resetText();
  4020. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4021. };
  4022. a.prototype.resetText = function() {
  4023. this._text._setBaseText(this.stageText._getText())
  4024. };
  4025. a.prototype._updateTransform = function() {
  4026. var c = this._text._worldTransform.a,
  4027. a = this._text._worldTransform.b,
  4028. d = this._text._worldTransform.c,
  4029. e = this._text._worldTransform.d,
  4030. h = this._text._worldTransform.tx,
  4031. f = this._text._worldTransform.ty;
  4032. this._text._updateBaseTransform();
  4033. var k = this._text._worldTransform;
  4034. if (this._isFirst || c != k.a || a != k.b || d != k.c || e != k.d || h != k.tx || f !=
  4035. k.ty) {
  4036. this._isFirst = !1;
  4037. c = this._text.localToGlobal();
  4038. this.stageText.changePosition(c.x, c.y);
  4039. var m = this;
  4040. b.callLater(function() {
  4041. m.stageText._setScale(m._text._worldTransform.a, m._text._worldTransform.d)
  4042. }, this)
  4043. }
  4044. };
  4045. a.prototype._updateProperties = function() {
  4046. var c = this._text._stage;
  4047. if (null == c) this.stageText._setVisible(!1);
  4048. else {
  4049. for (var a = this._text, d = a._visible; d;) {
  4050. a = a.parent;
  4051. if (a == c) break;
  4052. d = a._visible
  4053. }
  4054. this.stageText._setVisible(d)
  4055. }
  4056. this.stageText._setMultiline(this._text._multiline);
  4057. this.stageText._setMaxChars(this._text._maxChars);
  4058. this.stageText._setSize(this._text._size);
  4059. this.stageText._setTextColor(this._text._textColorString);
  4060. this.stageText._setTextFontFamily(this._text._fontFamily);
  4061. this.stageText._setBold(this._text._bold);
  4062. this.stageText._setItalic(this._text._italic);
  4063. this.stageText._setTextAlign(this._text._textAlign);
  4064. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4065. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4066. this.stageText._setTextType(this._text._displayAsPassword ?
  4067. "password" : "text");
  4068. this.stageText._setText(this._text._text);
  4069. this.stageText._resetStageText();
  4070. this._updateTransform()
  4071. };
  4072. return a
  4073. }(b.HashObject);
  4074. b.InputController = e;
  4075. e.prototype.__class__ = "egret.InputController"
  4076. })(egret || (egret = {}));
  4077. __extends = this.__extends || function(b, e) {
  4078. function d() {
  4079. this.constructor = b
  4080. }
  4081. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4082. d.prototype = e.prototype;
  4083. b.prototype = new d
  4084. };
  4085. (function(b) {
  4086. var e = function(b) {
  4087. function a(c, a) {
  4088. b.call(this, c);
  4089. this.charList = this.parseConfig(a)
  4090. }
  4091. __extends(a, b);
  4092. a.prototype.getTexture = function(c) {
  4093. var a = this._textureMap[c];
  4094. if (!a) {
  4095. a = this.charList[c];
  4096. if (!a) return null;
  4097. a = this.createTexture(c, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  4098. this._textureMap[c] = a
  4099. }
  4100. return a
  4101. };
  4102. a.prototype.parseConfig = function(c) {
  4103. c = c.split("\r\n").join("\n");
  4104. c = c.split("\n");
  4105. for (var a = this.getConfigByKey(c[3], "count"), b = {}, d = 4; d < 4 + a; d++) {
  4106. var e = c[d],
  4107. f = String.fromCharCode(this.getConfigByKey(e,
  4108. "id")),
  4109. k = {};
  4110. b[f] = k;
  4111. k.x = this.getConfigByKey(e, "x");
  4112. k.y = this.getConfigByKey(e, "y");
  4113. k.width = this.getConfigByKey(e, "width");
  4114. k.height = this.getConfigByKey(e, "height");
  4115. k.offsetX = this.getConfigByKey(e, "xoffset");
  4116. k.offsetY = this.getConfigByKey(e, "yoffset")
  4117. }
  4118. return b
  4119. };
  4120. a.prototype.getConfigByKey = function(c, a) {
  4121. for (var b = c.split(" "), d = 0, e = b.length; d < e; d++) {
  4122. var f = b[d];
  4123. if (a == f.substring(0, a.length)) return b = f.substring(a.length + 1), parseInt(b)
  4124. }
  4125. return 0
  4126. };
  4127. return a
  4128. }(b.SpriteSheet);
  4129. b.BitmapTextSpriteSheet = e;
  4130. e.prototype.__class__ =
  4131. "egret.BitmapTextSpriteSheet"
  4132. })(egret || (egret = {}));
  4133. __extends = this.__extends || function(b, e) {
  4134. function d() {
  4135. this.constructor = b
  4136. }
  4137. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4138. d.prototype = e.prototype;
  4139. b.prototype = new d
  4140. };
  4141. (function(b) {
  4142. var e = function(a) {
  4143. function c(c, e) {
  4144. a.call(this);
  4145. this.frameRate = 60;
  4146. c instanceof d ? (b.Logger.warning("MovieClip#constructor接口参数已经变更,请尽快调整用法为 new MovieClip(data,texture)"), this.delegate = c) : this.delegate = new d(c, e);
  4147. this.delegate.setMovieClip(this)
  4148. }
  4149. __extends(c, a);
  4150. c.prototype.gotoAndPlay = function(c) {
  4151. this.delegate.gotoAndPlay(c)
  4152. };
  4153. c.prototype.gotoAndStop = function(c) {
  4154. this.delegate.gotoAndStop(c)
  4155. };
  4156. c.prototype.stop =
  4157. function() {
  4158. this.delegate.stop()
  4159. };
  4160. c.prototype.dispose = function() {
  4161. this.delegate.dispose()
  4162. };
  4163. c.prototype.release = function() {
  4164. b.Logger.warning("MovieClip#release方法即将废弃");
  4165. this.dispose()
  4166. };
  4167. c.prototype.getCurrentFrameIndex = function() {
  4168. b.Logger.warning("MovieClip#getCurrentFrameIndex方法即将废弃");
  4169. return this.delegate._currentFrameIndex
  4170. };
  4171. c.prototype.getTotalFrame = function() {
  4172. b.Logger.warning("MovieClip#getTotalFrame方法即将废弃");
  4173. return this.delegate._totalFrame
  4174. };
  4175. c.prototype.setInterval = function(c) {
  4176. b.Logger.warning("MovieClip#setInterval方法即将废弃,请使用MovieClip#frameRate代替");
  4177. this.frameRate = 60 / c
  4178. };
  4179. c.prototype.getIsPlaying = function() {
  4180. b.Logger.warning("MovieClip#getIsPlaying方法即将废弃");
  4181. return this.delegate.isPlaying
  4182. };
  4183. return c
  4184. }(b.DisplayObjectContainer);
  4185. b.MovieClip = e;
  4186. e.prototype.__class__ = "egret.MovieClip";
  4187. var d = function() {
  4188. function a(c, a) {
  4189. this.data = c;
  4190. this._currentFrameIndex = this._passTime =
  4191. this._totalFrame = 0;
  4192. this._isPlaying = !1;
  4193. this._frameData = c;
  4194. this._spriteSheet = new b.SpriteSheet(a)
  4195. }
  4196. a.prototype.setMovieClip = function(c) {
  4197. this.movieClip = c;
  4198. this.bitmap = new b.Bitmap;
  4199. this.movieClip.addChild(this.bitmap)
  4200. };
  4201. a.prototype.gotoAndPlay = function(c) {
  4202. this.checkHasFrame(c);
  4203. this._isPlaying = !0;
  4204. this._currentFrameIndex = 0;
  4205. this._currentFrameName = c;
  4206. this._totalFrame = this._frameData.frames[c].totalFrame;
  4207. this.playNextFrame();
  4208. this._passTime = 0;
  4209. b.Ticker.getInstance().register(this.update, this)
  4210. };
  4211. a.prototype.gotoAndStop =
  4212. function(c) {
  4213. this.checkHasFrame(c);
  4214. this.stop();
  4215. this._currentFrameIndex = this._passTime = 0;
  4216. this._currentFrameName = c;
  4217. this._totalFrame = this._frameData.frames[c].totalFrame;
  4218. this.playNextFrame()
  4219. };
  4220. a.prototype.stop = function() {
  4221. this._isPlaying = !1;
  4222. b.Ticker.getInstance().unregister(this.update, this)
  4223. };
  4224. a.prototype.dispose = function() {};
  4225. a.prototype.checkHasFrame = function(c) {
  4226. void 0 == this._frameData.frames[c] && b.Logger.fatal("MovieClip没有对应的frame:", c)
  4227. };
  4228. a.prototype.update = function(c) {
  4229. for (var a =
  4230. 1E3 / this.movieClip.frameRate, a = Math.floor((this._passTime % a + c) / a); 1 <= a;) 1 == a ? this.playNextFrame() : this.playNextFrame(!1), a--;
  4231. this._passTime += c
  4232. };
  4233. a.prototype.playNextFrame = function(c) {
  4234. void 0 === c && (c = !0);
  4235. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  4236. if (c) {
  4237. c = this.getTexture(a.res);
  4238. var d = this.bitmap;
  4239. d.x = a.x;
  4240. d.y = a.y;
  4241. d.texture = c
  4242. }
  4243. null != a.action && this.movieClip.dispatchEventWith(a.action);
  4244. this._currentFrameIndex++;
  4245. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  4246. 0, a.action != b.Event.COMPLETE && this.movieClip.dispatchEventWith(b.Event.COMPLETE))
  4247. };
  4248. a.prototype.getTexture = function(c) {
  4249. var a = this._frameData.res[c],
  4250. b = this._spriteSheet.getTexture(c);
  4251. b || (b = this._spriteSheet.createTexture(c, a.x, a.y, a.w, a.h));
  4252. return b
  4253. };
  4254. return a
  4255. }();
  4256. b.DefaultMovieClipDelegate = d;
  4257. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  4258. })(egret || (egret = {}));
  4259. __extends = this.__extends || function(b, e) {
  4260. function d() {
  4261. this.constructor = b
  4262. }
  4263. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4264. d.prototype = e.prototype;
  4265. b.prototype = new d
  4266. };
  4267. (function(b) {
  4268. var e = function(b) {
  4269. function a() {
  4270. b.call(this);
  4271. this._scaleY = this._scaleX = 1;
  4272. this._size = 30;
  4273. this._color = "#FFFFFF";
  4274. this._fontFamily = "Arial";
  4275. this._italic = this._bold = !1;
  4276. this._textAlign = "left";
  4277. this._multiline = this._visible = !1;
  4278. this._maxChars = 0
  4279. }
  4280. __extends(a, b);
  4281. a.prototype._getText = function() {
  4282. return null
  4283. };
  4284. a.prototype._setText = function(c) {};
  4285. a.prototype._setTextType = function(c) {};
  4286. a.prototype._getTextType = function() {
  4287. return null
  4288. };
  4289. a.prototype._open = function(c, a, b, d) {};
  4290. a.prototype._show = function() {};
  4291. a.prototype._add =
  4292. function() {};
  4293. a.prototype._remove = function() {};
  4294. a.prototype._hide = function() {};
  4295. a.prototype._addListeners = function() {};
  4296. a.prototype._removeListeners = function() {};
  4297. a.prototype._setScale = function(c, a) {
  4298. this._scaleX = c;
  4299. this._scaleY = a
  4300. };
  4301. a.prototype.changePosition = function(c, a) {};
  4302. a.prototype._setSize = function(c) {
  4303. this._size = c
  4304. };
  4305. a.prototype._setTextColor = function(c) {
  4306. this._color = c
  4307. };
  4308. a.prototype._setTextFontFamily = function(c) {
  4309. this._fontFamily = c
  4310. };
  4311. a.prototype._setBold = function(c) {
  4312. this._bold = c
  4313. };
  4314. a.prototype._setItalic =
  4315. function(c) {
  4316. this._italic = c
  4317. };
  4318. a.prototype._setTextAlign = function(c) {
  4319. this._textAlign = c
  4320. };
  4321. a.prototype._setVisible = function(c) {
  4322. this._visible = c
  4323. };
  4324. a.prototype._setWidth = function(c) {};
  4325. a.prototype._setHeight = function(c) {};
  4326. a.prototype._setMultiline = function(c) {
  4327. this._multiline = c
  4328. };
  4329. a.prototype._setMaxChars = function(c) {
  4330. this._maxChars = c
  4331. };
  4332. a.prototype._resetStageText = function() {};
  4333. a.create = function() {
  4334. return null
  4335. };
  4336. return a
  4337. }(b.EventDispatcher);
  4338. b.StageText = e;
  4339. e.prototype.__class__ = "egret.StageText"
  4340. })(egret || (egret = {}));
  4341. (function(b) {
  4342. var e = function() {
  4343. function b() {}
  4344. b.GET = "get";
  4345. b.POST = "post";
  4346. return b
  4347. }();
  4348. b.URLRequestMethod = e;
  4349. e.prototype.__class__ = "egret.URLRequestMethod"
  4350. })(egret || (egret = {}));
  4351. (function(b) {
  4352. var e = function() {
  4353. function b() {}
  4354. b.BINARY = "binary";
  4355. b.TEXT = "text";
  4356. b.VARIABLES = "variables";
  4357. b.TEXTURE = "texture";
  4358. b.SOUND = "sound";
  4359. return b
  4360. }();
  4361. b.URLLoaderDataFormat = e;
  4362. e.prototype.__class__ = "egret.URLLoaderDataFormat"
  4363. })(egret || (egret = {}));
  4364. __extends = this.__extends || function(b, e) {
  4365. function d() {
  4366. this.constructor = b
  4367. }
  4368. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4369. d.prototype = e.prototype;
  4370. b.prototype = new d
  4371. };
  4372. (function(b) {
  4373. var e = function(b) {
  4374. function a(c) {
  4375. void 0 === c && (c = null);
  4376. b.call(this);
  4377. null !== c && this.decode(c)
  4378. }
  4379. __extends(a, b);
  4380. a.prototype.decode = function(c) {
  4381. this.variables || (this.variables = {});
  4382. c = c.split("+").join(" ");
  4383. for (var a, b = /[?&]?([^=]+)=([^&]*)/g; a = b.exec(c);) this.variables[decodeURIComponent(a[1])] = decodeURIComponent(a[2])
  4384. };
  4385. a.prototype.toString = function() {
  4386. if (!this.variables) return "";
  4387. var c = this.variables,
  4388. a = "",
  4389. b = !0,
  4390. d;
  4391. for (d in c) b ? b = !1 : a += "&", a += d + "=" + c[d];
  4392. return a
  4393. };
  4394. return a
  4395. }(b.HashObject);
  4396. b.URLVariables =
  4397. e;
  4398. e.prototype.__class__ = "egret.URLVariables"
  4399. })(egret || (egret = {}));
  4400. __extends = this.__extends || function(b, e) {
  4401. function d() {
  4402. this.constructor = b
  4403. }
  4404. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4405. d.prototype = e.prototype;
  4406. b.prototype = new d
  4407. };
  4408. (function(b) {
  4409. var e = function(d) {
  4410. function a(c) {
  4411. void 0 === c && (c = null);
  4412. d.call(this);
  4413. this.method = b.URLRequestMethod.GET;
  4414. this.url = c
  4415. }
  4416. __extends(a, d);
  4417. return a
  4418. }(b.HashObject);
  4419. b.URLRequest = e;
  4420. e.prototype.__class__ = "egret.URLRequest"
  4421. })(egret || (egret = {}));
  4422. __extends = this.__extends || function(b, e) {
  4423. function d() {
  4424. this.constructor = b
  4425. }
  4426. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4427. d.prototype = e.prototype;
  4428. b.prototype = new d
  4429. };
  4430. (function(b) {
  4431. var e = function(d) {
  4432. function a(c) {
  4433. void 0 === c && (c = null);
  4434. d.call(this);
  4435. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  4436. this._status = -1;
  4437. c && this.load(c)
  4438. }
  4439. __extends(a, d);
  4440. a.prototype.load = function(c) {
  4441. this._request = c;
  4442. this.data = null;
  4443. b.MainContext.instance.netContext.proceed(this)
  4444. };
  4445. return a
  4446. }(b.EventDispatcher);
  4447. b.URLLoader = e;
  4448. e.prototype.__class__ = "egret.URLLoader"
  4449. })(egret || (egret = {}));
  4450. __extends = this.__extends || function(b, e) {
  4451. function d() {
  4452. this.constructor = b
  4453. }
  4454. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4455. d.prototype = e.prototype;
  4456. b.prototype = new d
  4457. };
  4458. (function(b) {
  4459. var e = function(d) {
  4460. function a() {
  4461. d.call(this);
  4462. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  4463. }
  4464. __extends(a, d);
  4465. Object.defineProperty(a.prototype, "textureWidth", {
  4466. get: function() {
  4467. return this._textureWidth
  4468. },
  4469. enumerable: !0,
  4470. configurable: !0
  4471. });
  4472. Object.defineProperty(a.prototype, "textureHeight", {
  4473. get: function() {
  4474. return this._textureHeight
  4475. },
  4476. enumerable: !0,
  4477. configurable: !0
  4478. });
  4479. Object.defineProperty(a.prototype, "bitmapData", {
  4480. get: function() {
  4481. return this._bitmapData
  4482. },
  4483. enumerable: !0,
  4484. configurable: !0
  4485. });
  4486. a.prototype._setBitmapData = function(c) {
  4487. var a = b.MainContext.instance.rendererContext.texture_scale_factor;
  4488. this._bitmapData = c;
  4489. this._sourceWidth = c.width;
  4490. this._sourceHeight = c.height;
  4491. this._textureWidth = this._sourceWidth * a;
  4492. this._textureHeight = this._sourceHeight * a;
  4493. this._bitmapWidth = this._textureWidth;
  4494. this._bitmapHeight = this._textureHeight;
  4495. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  4496. };
  4497. a.prototype.getPixel32 = function(c, a) {
  4498. return this._bitmapData.getContext("2d").getImageData(c,
  4499. a, 1, 1).data
  4500. };
  4501. return a
  4502. }(b.HashObject);
  4503. b.Texture = e;
  4504. e.prototype.__class__ = "egret.Texture"
  4505. })(egret || (egret = {}));
  4506. __extends = this.__extends || function(b, e) {
  4507. function d() {
  4508. this.constructor = b
  4509. }
  4510. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4511. d.prototype = e.prototype;
  4512. b.prototype = new d
  4513. };
  4514. (function(b) {
  4515. var e = function(d) {
  4516. function a() {
  4517. d.call(this);
  4518. this._bitmapData = document.createElement("canvas");
  4519. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  4520. }
  4521. __extends(a, d);
  4522. a.prototype.drawToTexture = function(c) {
  4523. var d = this._bitmapData,
  4524. e = c.getBounds(b.Rectangle.identity);
  4525. if (0 == e.width || 0 == e.height) return b.Logger.warning("egret.RenderTexture#drawToTexture:显示对象测量结果宽高为0,请检查"), !1;
  4526. e.width = Math.floor(e.width);
  4527. e.height = Math.floor(e.height);
  4528. d.width = e.width;
  4529. d.height = e.height;
  4530. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = e.width, this.renderContext._cacheCanvas.height = e.height);
  4531. a.identityRectangle.width = e.width;
  4532. a.identityRectangle.height = e.height;
  4533. c._worldTransform.identity();
  4534. c.worldAlpha = 1;
  4535. if (c instanceof b.DisplayObjectContainer) {
  4536. var d = c._anchorOffsetX,
  4537. n = c._anchorOffsetY;
  4538. if (0 != c._anchorX || 0 != c._anchorY) d = c._anchorX * e.width, n = c._anchorY * e.height;
  4539. this._offsetX = e.x + d;
  4540. this._offsetY = e.y +
  4541. n;
  4542. c._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  4543. e = c._children;
  4544. d = 0;
  4545. for (n = e.length; d < n; d++) e[d]._updateTransform()
  4546. }
  4547. e = b.RenderFilter.getInstance();
  4548. d = e._drawAreaList.concat();
  4549. e._drawAreaList.length = 0;
  4550. this.renderContext.clearScreen();
  4551. this.renderContext.onRenderStart();
  4552. this.webGLTexture = null;
  4553. (n = c.mask || c._scrollRect) && this.renderContext.pushMask(n);
  4554. c._render(this.renderContext);
  4555. n && this.renderContext.popMask();
  4556. e.addDrawArea(a.identityRectangle);
  4557. this.renderContext.onRenderFinish();
  4558. e._drawAreaList =
  4559. d;
  4560. this._textureWidth = this._bitmapData.width;
  4561. this._textureHeight = this._bitmapData.height;
  4562. this._sourceWidth = this._textureWidth;
  4563. this._sourceHeight = this._textureHeight;
  4564. return !0
  4565. };
  4566. a.identityRectangle = new b.Rectangle;
  4567. return a
  4568. }(b.Texture);
  4569. b.RenderTexture = e;
  4570. e.prototype.__class__ = "egret.RenderTexture"
  4571. })(egret || (egret = {}));
  4572. __extends = this.__extends || function(b, e) {
  4573. function d() {
  4574. this.constructor = b
  4575. }
  4576. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4577. d.prototype = e.prototype;
  4578. b.prototype = new d
  4579. };
  4580. (function(b) {
  4581. var e = function(d) {
  4582. function a() {
  4583. d.call(this);
  4584. this.renderCost = 0;
  4585. this.texture_scale_factor = 1;
  4586. this.profiler = b.Profiler.getInstance()
  4587. }
  4588. __extends(a, d);
  4589. a.prototype.clearScreen = function() {};
  4590. a.prototype.clearRect = function(c, a, b, d) {};
  4591. a.prototype.drawImage = function(c, a, b, d, e, f, k, m, p, q) {
  4592. this.profiler.onDrawImage()
  4593. };
  4594. a.prototype.setTransform = function(c) {};
  4595. a.prototype.setAlpha = function(c, a) {};
  4596. a.prototype.setupFont = function(c, a) {};
  4597. a.prototype.measureText = function(c) {
  4598. return 0
  4599. };
  4600. a.prototype.drawText = function(c,
  4601. a, b, d, e, f) {
  4602. this.profiler.onDrawImage()
  4603. };
  4604. a.prototype.strokeRect = function(c, a, b, d, e) {};
  4605. a.prototype.pushMask = function(c) {};
  4606. a.prototype.popMask = function() {};
  4607. a.prototype.onRenderStart = function() {};
  4608. a.prototype.onRenderFinish = function() {};
  4609. a.prototype.setGlobalColorTransform = function(c) {};
  4610. a.createRendererContext = function(c) {
  4611. return null
  4612. };
  4613. a.imageSmoothingEnabled = !0;
  4614. return a
  4615. }(b.HashObject);
  4616. b.RendererContext = e;
  4617. e.prototype.__class__ = "egret.RendererContext"
  4618. })(egret || (egret = {}));
  4619. (function(b) {
  4620. var e = function() {
  4621. function b() {}
  4622. b.MOUSE = "mouse";
  4623. b.TOUCH = "touch";
  4624. b.mode = "touch";
  4625. return b
  4626. }();
  4627. b.InteractionMode = e;
  4628. e.prototype.__class__ = "egret.InteractionMode"
  4629. })(egret || (egret = {}));
  4630. __extends = this.__extends || function(b, e) {
  4631. function d() {
  4632. this.constructor = b
  4633. }
  4634. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4635. d.prototype = e.prototype;
  4636. b.prototype = new d
  4637. };
  4638. (function(b) {
  4639. var e = function(d) {
  4640. function a() {
  4641. d.call(this);
  4642. this._currentTouchTarget = {};
  4643. this.maxTouches = 2;
  4644. this.touchDownTarget = {};
  4645. this.touchingIdentifiers = [];
  4646. this.lastTouchY = this.lastTouchX = -1
  4647. }
  4648. __extends(a, d);
  4649. a.prototype.run = function() {};
  4650. a.prototype.getTouchData = function(c, a, b) {
  4651. var d = this._currentTouchTarget[c];
  4652. null == d && (d = {}, this._currentTouchTarget[c] = d);
  4653. d.stageX = a;
  4654. d.stageY = b;
  4655. d.identifier = c;
  4656. return d
  4657. };
  4658. a.prototype.dispatchEvent = function(c, a) {
  4659. b.TouchEvent.dispatchTouchEvent(a.target, c, a.identifier, a.stageX,
  4660. a.stageY, !1, !1, !1, !0 == this.touchDownTarget[a.identifier])
  4661. };
  4662. a.prototype.onTouchBegan = function(c, a, d) {
  4663. if (this.touchingIdentifiers.length != this.maxTouches) {
  4664. var e = b.MainContext.instance.stage.hitTest(c, a);
  4665. e && (c = this.getTouchData(d, c, a), this.touchDownTarget[d] = !0, c.target = e, c.beginTarget = e, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, c));
  4666. this.touchingIdentifiers.push(d)
  4667. }
  4668. };
  4669. a.prototype.onTouchMove = function(c, a, d) {
  4670. if (-1 != this.touchingIdentifiers.indexOf(d) && (c != this.lastTouchX || a != this.lastTouchY)) {
  4671. this.lastTouchX =
  4672. c;
  4673. this.lastTouchY = a;
  4674. var e = b.MainContext.instance.stage.hitTest(c, a);
  4675. e && (c = this.getTouchData(d, c, a), c.target = e, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, c))
  4676. }
  4677. };
  4678. a.prototype.onTouchEnd = function(c, a, d) {
  4679. var e = this.touchingIdentifiers.indexOf(d); - 1 != e && (this.touchingIdentifiers.splice(e, 1), e = b.MainContext.instance.stage.hitTest(c, a)) && (c = this.getTouchData(d, c, a), delete this.touchDownTarget[d], d = c.beginTarget, c.target = e, this.dispatchEvent(b.TouchEvent.TOUCH_END, c), d == e ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP,
  4680. c) : c.beginTarget && (c.target = c.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, c)), delete this._currentTouchTarget[c.identifier])
  4681. };
  4682. return a
  4683. }(b.HashObject);
  4684. b.TouchContext = e;
  4685. e.prototype.__class__ = "egret.TouchContext"
  4686. })(egret || (egret = {}));
  4687. __extends = this.__extends || function(b, e) {
  4688. function d() {
  4689. this.constructor = b
  4690. }
  4691. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4692. d.prototype = e.prototype;
  4693. b.prototype = new d
  4694. };
  4695. (function(b) {
  4696. var e = function(d) {
  4697. function a() {
  4698. d.call(this)
  4699. }
  4700. __extends(a, d);
  4701. a.prototype.proceed = function(c) {};
  4702. a._getUrl = function(c) {
  4703. var a = c.url; - 1 == a.indexOf("?") && c.method == b.URLRequestMethod.GET && c.data && c.data instanceof b.URLVariables && (a = a + "?" + c.data.toString());
  4704. return a
  4705. };
  4706. a.prototype.getChangeList = function() {
  4707. return []
  4708. };
  4709. return a
  4710. }(b.HashObject);
  4711. b.NetContext = e;
  4712. e.prototype.__class__ = "egret.NetContext"
  4713. })(egret || (egret = {}));
  4714. __extends = this.__extends || function(b, e) {
  4715. function d() {
  4716. this.constructor = b
  4717. }
  4718. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4719. d.prototype = e.prototype;
  4720. b.prototype = new d
  4721. };
  4722. (function(b) {
  4723. var e = function(b) {
  4724. function a() {
  4725. b.call(this);
  4726. this.frameRate = 60
  4727. }
  4728. __extends(a, b);
  4729. a.prototype.executeMainLoop = function(a, b) {};
  4730. return a
  4731. }(b.HashObject);
  4732. b.DeviceContext = e;
  4733. e.prototype.__class__ = "egret.DeviceContext"
  4734. })(egret || (egret = {}));
  4735. (function(b) {
  4736. var e = function() {
  4737. function b() {}
  4738. b.call = function(a, c) {};
  4739. b.addCallback = function(a, c) {};
  4740. return b
  4741. }();
  4742. b.ExternalInterface = e;
  4743. e.prototype.__class__ = "egret.ExternalInterface"
  4744. })(egret || (egret = {}));
  4745. __extends = this.__extends || function(b, e) {
  4746. function d() {
  4747. this.constructor = b
  4748. }
  4749. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  4750. d.prototype = e.prototype;
  4751. b.prototype = new d
  4752. };
  4753. (function(b) {
  4754. var e = function(d) {
  4755. function a() {
  4756. d.call(this);
  4757. this.ua = navigator.userAgent.toLowerCase();
  4758. this.trans = this._getTrans()
  4759. }
  4760. __extends(a, d);
  4761. a.getInstance = function() {
  4762. null == a.instance && (a.instance = new a);
  4763. return a.instance
  4764. };
  4765. Object.defineProperty(a.prototype, "isMobile", {
  4766. get: function() {
  4767. b.Logger.warning("Browser.isMobile接口参数已经变更,请尽快调整用法为 egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  4768. return b.MainContext.deviceType ==
  4769. b.MainContext.DEVICE_MOBILE
  4770. },
  4771. enumerable: !0,
  4772. configurable: !0
  4773. });
  4774. a.prototype._getHeader = function(a) {
  4775. if ("transform" in a) return "";
  4776. for (var b = ["webkit", "ms", "Moz", "O"], d = 0; d < b.length; d++)
  4777. if (b[d] + "Transform" in a) return b[d];
  4778. return ""
  4779. };
  4780. a.prototype._getTrans = function() {
  4781. var a = document.createElement("div").style,
  4782. a = this._getHeader(a);
  4783. return "" == a ? "transform" : a + "Transform"
  4784. };
  4785. a.prototype.$new = function(a) {
  4786. return this.$(document.createElement(a))
  4787. };
  4788. a.prototype.$ = function(c) {
  4789. var d = document;
  4790. if (c = c instanceof HTMLElement ?
  4791. c : d.querySelector(c)) c.find = c.find || this.$, c.hasClass = c.hasClass || function(a) {
  4792. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  4793. }, c.addClass = c.addClass || function(a) {
  4794. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  4795. return this
  4796. }, c.removeClass = c.removeClass || function(a) {
  4797. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  4798. return this
  4799. }, c.remove = c.remove || function() {}, c.appendTo = c.appendTo || function(a) {
  4800. a.appendChild(this);
  4801. return this
  4802. }, c.prependTo = c.prependTo ||
  4803. function(a) {
  4804. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  4805. return this
  4806. }, c.transforms = c.transforms || function() {
  4807. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  4808. return this
  4809. }, c.position = c.position || {
  4810. x: 0,
  4811. y: 0
  4812. }, c.rotation = c.rotation || 0, c.scale = c.scale || {
  4813. x: 1,
  4814. y: 1
  4815. }, c.skew = c.skew || {
  4816. x: 0,
  4817. y: 0
  4818. }, c.translates = function(a, c) {
  4819. this.position.x = a;
  4820. this.position.y = c -
  4821. b.MainContext.instance.stage.stageHeight;
  4822. this.transforms();
  4823. return this
  4824. }, c.rotate = function(a) {
  4825. this.rotation = a;
  4826. this.transforms();
  4827. return this
  4828. }, c.resize = function(a, c) {
  4829. this.scale.x = a;
  4830. this.scale.y = c;
  4831. this.transforms();
  4832. return this
  4833. }, c.setSkew = function(a, c) {
  4834. this.skew.x = a;
  4835. this.skew.y = c;
  4836. this.transforms();
  4837. return this
  4838. };
  4839. return c
  4840. };
  4841. a.prototype.translate = function(a) {
  4842. return "translate(" + a.x + "px, " + a.y + "px) "
  4843. };
  4844. a.prototype.rotate = function(a) {
  4845. return "rotate(" + a + "deg) "
  4846. };
  4847. a.prototype.scale = function(a) {
  4848. return "scale(" + a.x + ", " +
  4849. a.y + ") "
  4850. };
  4851. a.prototype.skew = function(a) {
  4852. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  4853. };
  4854. return a
  4855. }(b.HashObject);
  4856. b.Browser = e;
  4857. e.prototype.__class__ = "egret.Browser"
  4858. })(egret || (egret = {}));
  4859. (function(b) {
  4860. (function(b) {
  4861. b.getItem = function(b) {
  4862. return null
  4863. };
  4864. b.setItem = function(b, a) {
  4865. return !1
  4866. };
  4867. b.removeItem = function(b) {};
  4868. b.clear = function() {}
  4869. })(b.localStorage || (b.localStorage = {}))
  4870. })(egret || (egret = {}));
  4871. (function(b) {
  4872. var e = function() {
  4873. function d() {}
  4874. d.parse = function(a) {
  4875. a = b.SAXParser.getInstance().parserXML(a);
  4876. if (!a || !a.childNodes) return null;
  4877. for (var c = a.childNodes.length, e = !1, g = 0; g < c; g++) {
  4878. var n = a.childNodes[g];
  4879. if (1 == n.nodeType) {
  4880. e = !0;
  4881. break
  4882. }
  4883. }
  4884. return e ? d.parseNode(n) : null
  4885. };
  4886. d.parseNode = function(a) {
  4887. if (!a || 1 != a.nodeType) return null;
  4888. var c = {};
  4889. c.localName = a.localName;
  4890. c.name = a.nodeName;
  4891. a.namespaceURI && (c.namespace = a.namespaceURI);
  4892. a.prefix && (c.prefix = a.prefix);
  4893. for (var b = a.attributes, e = b.length, n = 0; n < e; n++) {
  4894. var h =
  4895. b[n],
  4896. f = h.name;
  4897. 0 != f.indexOf("xmlns:") && (c["$" + f] = h.value)
  4898. }
  4899. b = a.childNodes;
  4900. e = b.length;
  4901. for (n = 0; n < e; n++)
  4902. if (h = d.parseNode(b[n])) c.children || (c.children = []), h.parent = c, c.children.push(h);
  4903. !c.children && (a = a.textContent.trim()) && (c.text = a);
  4904. return c
  4905. };
  4906. d.findChildren = function(a, c, b) {
  4907. b ? b.length = 0 : b = [];
  4908. d.findByPath(a, c, b);
  4909. return b
  4910. };
  4911. d.findByPath = function(a, c, b) {
  4912. var e = c.indexOf("."),
  4913. n; - 1 == e ? (n = c, e = !0) : (n = c.substring(0, e), c = c.substring(e + 1), e = !1);
  4914. if (a = a.children)
  4915. for (var h = a.length, f = 0; f < h; f++) {
  4916. var k = a[f];
  4917. k.localName ==
  4918. n && (e ? b.push(k) : d.findByPath(k, c, b))
  4919. }
  4920. };
  4921. d.getAttributes = function(a, c) {
  4922. c ? c.length = 0 : c = [];
  4923. for (var b in a) "$" == b.charAt(0) && c.push(b.substring(1));
  4924. return c
  4925. };
  4926. return d
  4927. }();
  4928. b.XML = e;
  4929. e.prototype.__class__ = "egret.XML"
  4930. })(egret || (egret = {}));
  4931. (function(b) {
  4932. var e = function() {
  4933. function a() {}
  4934. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  4935. a.BIG_ENDIAN = "BIG_ENDIAN";
  4936. return a
  4937. }();
  4938. b.Endian = e;
  4939. e.prototype.__class__ = "egret.Endian";
  4940. var d = function() {
  4941. function a() {
  4942. this.length = this.position = 0;
  4943. this._mode = "";
  4944. this.maxlength = 0;
  4945. this._endian = e.LITTLE_ENDIAN;
  4946. this.isLittleEndian = !1;
  4947. this._mode = "Typed array";
  4948. this.maxlength = 4;
  4949. this.arraybytes = new ArrayBuffer(this.maxlength);
  4950. this.unalignedarraybytestemp = new ArrayBuffer(16);
  4951. this.endian = a.DEFAULT_ENDIAN
  4952. }
  4953. Object.defineProperty(a.prototype,
  4954. "endian", {
  4955. get: function() {
  4956. return this._endian
  4957. },
  4958. set: function(a) {
  4959. this._endian = a;
  4960. this.isLittleEndian = a == e.LITTLE_ENDIAN
  4961. },
  4962. enumerable: !0,
  4963. configurable: !0
  4964. });
  4965. a.prototype.ensureWriteableSpace = function(a) {
  4966. this.ensureSpace(a + this.position)
  4967. };
  4968. a.prototype.setArrayBuffer = function(a) {
  4969. this.ensureSpace(a.byteLength);
  4970. this.length = a.byteLength;
  4971. a = new Int8Array(a);
  4972. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  4973. this.position = 0
  4974. };
  4975. Object.defineProperty(a.prototype, "bytesAvailable", {
  4976. get: function() {
  4977. return this.length - this.position
  4978. },
  4979. enumerable: !0,
  4980. configurable: !0
  4981. });
  4982. a.prototype.ensureSpace = function(a) {
  4983. if (a > this.maxlength) {
  4984. a = a + 255 & -256;
  4985. var b = new ArrayBuffer(a),
  4986. d = new Uint8Array(this.arraybytes, 0, this.length);
  4987. (new Uint8Array(b, 0, this.length)).set(d);
  4988. this.arraybytes = b;
  4989. this.maxlength = a
  4990. }
  4991. };
  4992. a.prototype.writeByte = function(a) {
  4993. this.ensureWriteableSpace(1);
  4994. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  4995. this.position > this.length && (this.length = this.position)
  4996. };
  4997. a.prototype.readByte = function() {
  4998. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  4999. this.position + ", Length=" + this.length;
  5000. return (new Int8Array(this.arraybytes))[this.position++]
  5001. };
  5002. a.prototype.readBytes = function(a, b, d) {
  5003. void 0 === b && (b = 0);
  5004. void 0 === d && (d = 0);
  5005. null == d && (d = a.length);
  5006. a.ensureWriteableSpace(b + d);
  5007. var e = new Int8Array(a.arraybytes),
  5008. h = new Int8Array(this.arraybytes);
  5009. e.set(h.subarray(this.position, this.position + d), b);
  5010. this.position += d;
  5011. d + b > a.length && (a.length += d + b - a.length)
  5012. };
  5013. a.prototype.writeUnsignedByte = function(a) {
  5014. this.ensureWriteableSpace(1);
  5015. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  5016. this.position > this.length && (this.length = this.position)
  5017. };
  5018. a.prototype.readUnsignedByte = function() {
  5019. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  5020. return (new Uint8Array(this.arraybytes))[this.position++]
  5021. };
  5022. a.prototype.writeUnsignedShort = function(a) {
  5023. this.ensureWriteableSpace(2);
  5024. if (0 == (this.position & 1)) {
  5025. var b = new Uint16Array(this.arraybytes);
  5026. b[this.position >> 1] = ~~a & 65535
  5027. } else b = new Uint16Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 65535, a = new Uint8Array(this.arraybytes, this.position, 2), b = new Uint8Array(this.unalignedarraybytestemp, 0, 2), a.set(b);
  5028. this.position += 2;
  5029. this.position > this.length && (this.length = this.position)
  5030. };
  5031. a.prototype.readUTFBytes = function(a) {
  5032. var b = "";
  5033. a = this.position + a;
  5034. for (var d = new DataView(this.arraybytes); this.position < a;) {
  5035. var e = d.getUint8(this.position++);
  5036. if (128 > e) {
  5037. if (0 == e) break;
  5038. b += String.fromCharCode(e)
  5039. } else if (224 > e) b += String.fromCharCode((e & 63) << 6 | d.getUint8(this.position++) & 127);
  5040. else if (240 > e) var h = d.getUint8(this.position++),
  5041. b = b + String.fromCharCode((e & 31) << 12 | (h & 127) << 6 | d.getUint8(this.position++) & 127);
  5042. else var h = d.getUint8(this.position++),
  5043. f = d.getUint8(this.position++),
  5044. b = b + String.fromCharCode((e & 15) << 18 | (h & 127) << 12 | f << 6 & 127 | d.getUint8(this.position++) & 127)
  5045. }
  5046. return b
  5047. };
  5048. a.prototype.readInt = function() {
  5049. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  5050. this.position += 4;
  5051. return a
  5052. };
  5053. a.prototype.readShort = function() {
  5054. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  5055. this.position += 2;
  5056. return a
  5057. };
  5058. a.prototype.readDouble = function() {
  5059. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  5060. this.position += 8;
  5061. return a
  5062. };
  5063. a.prototype.readUnsignedShort = function() {
  5064. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5065. if (0 == (this.position & 1)) {
  5066. var a = new Uint16Array(this.arraybytes),
  5067. b = this.position >> 1;
  5068. this.position += 2;
  5069. return a[b]
  5070. }
  5071. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  5072. b = new Uint8Array(this.arraybytes,
  5073. this.position, 2);
  5074. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  5075. this.position += 2;
  5076. return a[0]
  5077. };
  5078. a.prototype.writeUnsignedInt = function(a) {
  5079. this.ensureWriteableSpace(4);
  5080. if (0 == (this.position & 3)) {
  5081. var b = new Uint32Array(this.arraybytes);
  5082. b[this.position >> 2] = ~~a & 4294967295
  5083. } else b = new Uint32Array(this.unalignedarraybytestemp, 0, 1), b[0] = ~~a & 4294967295, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  5084. this.position += 4;
  5085. this.position > this.length &&
  5086. (this.length = this.position)
  5087. };
  5088. a.prototype.readUnsignedInt = function() {
  5089. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  5090. if (0 == (this.position & 3)) {
  5091. var a = new Uint32Array(this.arraybytes),
  5092. b = this.position >> 2;
  5093. this.position += 4;
  5094. return a[b]
  5095. }
  5096. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  5097. b = new Uint8Array(this.arraybytes, this.position, 4);
  5098. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5099. this.position += 4;
  5100. return a[0]
  5101. };
  5102. a.prototype.writeFloat =
  5103. function(a) {
  5104. this.ensureWriteableSpace(4);
  5105. if (0 == (this.position & 3)) {
  5106. var b = new Float32Array(this.arraybytes);
  5107. b[this.position >> 2] = a
  5108. } else b = new Float32Array(this.unalignedarraybytestemp, 0, 1), b[0] = a, a = new Uint8Array(this.arraybytes, this.position, 4), b = new Uint8Array(this.unalignedarraybytestemp, 0, 4), a.set(b);
  5109. this.position += 4;
  5110. this.position > this.length && (this.length = this.position)
  5111. };
  5112. a.prototype.readFloat = function() {
  5113. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  5114. this.length;
  5115. if (0 == (this.position & 3)) {
  5116. var a = new Float32Array(this.arraybytes),
  5117. b = this.position >> 2;
  5118. this.position += 4;
  5119. return a[b]
  5120. }
  5121. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  5122. b = new Uint8Array(this.arraybytes, this.position, 4);
  5123. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  5124. this.position += 4;
  5125. return a[0]
  5126. };
  5127. a.DEFAULT_ENDIAN = e.BIG_ENDIAN;
  5128. return a
  5129. }();
  5130. b.ByteArray = d;
  5131. d.prototype.__class__ = "egret.ByteArray"
  5132. })(egret || (egret = {}));
  5133. __extends = this.__extends || function(b, e) {
  5134. function d() {
  5135. this.constructor = b
  5136. }
  5137. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5138. d.prototype = e.prototype;
  5139. b.prototype = new d
  5140. };
  5141. (function(b) {
  5142. var e = function(d) {
  5143. function a(a, b, e) {
  5144. d.call(this);
  5145. this._target = null;
  5146. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5147. this._actions = this._steps = this.pluginData = null;
  5148. this.paused = !1;
  5149. this.duration = 0;
  5150. this._prevPos = -1;
  5151. this.position = null;
  5152. this._stepPosition = this._prevPosition = 0;
  5153. this.passive = !1;
  5154. this.initialize(a, b, e)
  5155. }
  5156. __extends(a, d);
  5157. a.get = function(c, b, d, e) {
  5158. void 0 === b && (b = null);
  5159. void 0 === d && (d = null);
  5160. void 0 === e && (e = !1);
  5161. e && a.removeTweens(c);
  5162. return new a(c, b, d)
  5163. };
  5164. a.removeTweens = function(c) {
  5165. if (c.tween_count) {
  5166. for (var b =
  5167. a._tweens, d = b.length - 1; 0 <= d; d--) b[d]._target == c && (b[d].paused = !0, b.splice(d, 1));
  5168. c.tween_count = 0
  5169. }
  5170. };
  5171. a.pauseTweens = function(a) {
  5172. if (a.tween_count)
  5173. for (var d = b.Tween._tweens, e = d.length - 1; 0 <= e; e--) d[e]._target == a && (d[e].paused = !0)
  5174. };
  5175. a.resumeTweens = function(a) {
  5176. if (a.tween_count)
  5177. for (var d = b.Tween._tweens, e = d.length - 1; 0 <= e; e--) d[e]._target == a && (d[e].paused = !1)
  5178. };
  5179. a.tick = function(c, b) {
  5180. void 0 === b && (b = !1);
  5181. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  5182. var h = d[e];
  5183. b && !h.ignoreGlobalPause || h.paused || h.tick(h._useTicks ?
  5184. 1 : c)
  5185. }
  5186. };
  5187. a._register = function(c, d) {
  5188. var e = c._target,
  5189. n = a._tweens;
  5190. if (d) e && (e.tween_count = e.tween_count ? e.tween_count + 1 : 1), n.push(c), a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  5191. else
  5192. for (e && e.tween_count--, e = n.length; e--;)
  5193. if (n[e] == c) {
  5194. n.splice(e, 1);
  5195. break
  5196. }
  5197. };
  5198. a.removeAllTweens = function() {
  5199. for (var c = a._tweens, b = 0, d = c.length; b < d; b++) {
  5200. var e = c[b];
  5201. e.paused = !0;
  5202. e._target.tweenjs_count = 0
  5203. }
  5204. c.length = 0
  5205. };
  5206. a.prototype.initialize = function(c, b, d) {
  5207. this._target = c;
  5208. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause =
  5209. b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(c));
  5210. this.pluginData = d || {};
  5211. this._curQueueProps = {};
  5212. this._initQueueProps = {};
  5213. this._steps = [];
  5214. this._actions = [];
  5215. b && b.paused ? this.paused = !0 : a._register(this, !0);
  5216. b && null != b.position && this.setPosition(b.position, a.NONE)
  5217. };
  5218. a.prototype.setPosition = function(a, b) {
  5219. void 0 === b && (b = 1);
  5220. 0 > a && (a = 0);
  5221. var d = a,
  5222. e = !1;
  5223. d >= this.duration && (this.loop ? d %= this.duration : (d = this.duration, e = !0));
  5224. if (d == this._prevPos) return e;
  5225. var h = this._prevPos;
  5226. this.position = this._prevPos = d;
  5227. this._prevPosition = a;
  5228. if (this._target)
  5229. if (e) this._updateTargetProps(null, 1);
  5230. else if (0 < this._steps.length) {
  5231. for (var f = 0, k = this._steps.length; f < k && !(this._steps[f].t > d); f++);
  5232. f = this._steps[f - 1];
  5233. this._updateTargetProps(f, (this._stepPosition = d - f.t) / f.d)
  5234. }
  5235. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < h ? (h != this.duration && this._runActions(h, this.duration), this._runActions(0, d, !0)) : this._runActions(h, d));
  5236. e && this.setPaused(!0);
  5237. this.dispatchEventWith("change");
  5238. return e
  5239. };
  5240. a.prototype._runActions = function(a, b, d) {
  5241. void 0 === d && (d = !1);
  5242. var e = a,
  5243. h = b,
  5244. f = -1,
  5245. k = this._actions.length,
  5246. m = 1;
  5247. a > b && (e = b, h = a, f = k, k = m = -1);
  5248. for (;
  5249. (f += m) != k;) {
  5250. b = this._actions[f];
  5251. var p = b.t;
  5252. (p == h || p > e && p < h || d && p == a) && b.f.apply(b.o, b.p)
  5253. }
  5254. };
  5255. a.prototype._updateTargetProps = function(c, b) {
  5256. var d, e, h, f;
  5257. if (c || 1 != b) {
  5258. if (this.passive = !!c.v) return;
  5259. c.e && (b = c.e(b, 0, 1, 1));
  5260. d = c.p0;
  5261. e = c.p1
  5262. } else this.passive = !1, d = e = this._curQueueProps;
  5263. for (var k in this._initQueueProps) {
  5264. null == (h = d[k]) && (d[k] = h = this._initQueueProps[k]);
  5265. null ==
  5266. (f = e[k]) && (e[k] = f = h);
  5267. h = h == f || 0 == b || 1 == b || "number" != typeof h ? 1 == b ? f : h : h + (f - h) * b;
  5268. var m = !1;
  5269. if (f = a._plugins[k])
  5270. for (var p = 0, q = f.length; p < q; p++) {
  5271. var r = f[p].tween(this, k, h, d, e, b, !!c && d == e, !c);
  5272. r == a.IGNORE ? m = !0 : h = r
  5273. }
  5274. m || (this._target[k] = h)
  5275. }
  5276. };
  5277. a.prototype.setPaused = function(c) {
  5278. this.paused = c;
  5279. a._register(this, !c);
  5280. return this
  5281. };
  5282. a.prototype._cloneProps = function(a) {
  5283. var b = {},
  5284. d;
  5285. for (d in a) b[d] = a[d];
  5286. return b
  5287. };
  5288. a.prototype._addStep = function(a) {
  5289. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  5290. return this
  5291. };
  5292. a.prototype._appendQueueProps = function(c) {
  5293. var b, d, e, h, f, k;
  5294. for (k in c)
  5295. if (void 0 === this._initQueueProps[k]) {
  5296. d = this._target[k];
  5297. if (b = a._plugins[k])
  5298. for (e = 0, h = b.length; e < h; e++) d = b[e].init(this, k, d);
  5299. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  5300. }
  5301. for (k in c) {
  5302. d = this._curQueueProps[k];
  5303. if (b = a._plugins[k])
  5304. for (f = f || {}, e = 0, h = b.length; e < h; e++) b[e].step && b[e].step(this, k, d, c[k], f);
  5305. this._curQueueProps[k] = c[k]
  5306. }
  5307. f && this._appendQueueProps(f);
  5308. return this._curQueueProps
  5309. };
  5310. a.prototype._addAction = function(a) {
  5311. a.t =
  5312. this.duration;
  5313. this._actions.push(a);
  5314. return this
  5315. };
  5316. a.prototype._set = function(a, b) {
  5317. for (var d in a) b[d] = a[d]
  5318. };
  5319. a.prototype.wait = function(a, b) {
  5320. if (null == a || 0 >= a) return this;
  5321. var d = this._cloneProps(this._curQueueProps);
  5322. return this._addStep({
  5323. d: a,
  5324. p0: d,
  5325. p1: d,
  5326. v: b
  5327. })
  5328. };
  5329. a.prototype.to = function(a, b, d) {
  5330. void 0 === d && (d = void 0);
  5331. if (isNaN(b) || 0 > b) b = 0;
  5332. return this._addStep({
  5333. d: b || 0,
  5334. p0: this._cloneProps(this._curQueueProps),
  5335. e: d,
  5336. p1: this._cloneProps(this._appendQueueProps(a))
  5337. })
  5338. };
  5339. a.prototype.call = function(a, b, d) {
  5340. void 0 === b && (b = void 0);
  5341. void 0 === d && (d = void 0);
  5342. return this._addAction({
  5343. f: a,
  5344. p: d ? d : [],
  5345. o: b ? b : this._target
  5346. })
  5347. };
  5348. a.prototype.set = function(a, b) {
  5349. void 0 === b && (b = null);
  5350. return this._addAction({
  5351. f: this._set,
  5352. o: this,
  5353. p: [a, b ? b : this._target]
  5354. })
  5355. };
  5356. a.prototype.play = function(a) {
  5357. a || (a = this);
  5358. return this.call(a.setPaused, a, [!1])
  5359. };
  5360. a.prototype.pause = function(a) {
  5361. a || (a = this);
  5362. return this.call(a.setPaused, a, [!0])
  5363. };
  5364. a.prototype.tick = function(a) {
  5365. this.paused || this.setPosition(this._prevPosition + a)
  5366. };
  5367. a.NONE = 0;
  5368. a.LOOP = 1;
  5369. a.REVERSE = 2;
  5370. a._tweens = [];
  5371. a.IGNORE = {};
  5372. a._plugins = {};
  5373. a._inited = !1;
  5374. return a
  5375. }(b.EventDispatcher);
  5376. b.Tween = e;
  5377. e.prototype.__class__ = "egret.Tween"
  5378. })(egret || (egret = {}));
  5379. (function(b) {
  5380. var e = function() {
  5381. function d() {
  5382. b.Logger.fatal("Ease不能被实例化")
  5383. }
  5384. d.get = function(a) {
  5385. -1 > a && (a = -1);
  5386. 1 < a && (a = 1);
  5387. return function(c) {
  5388. return 0 == a ? c : 0 > a ? c * (c * -a + 1 + a) : c * ((2 - c) * a + (1 - a))
  5389. }
  5390. };
  5391. d.getPowIn = function(a) {
  5392. return function(c) {
  5393. return Math.pow(c, a)
  5394. }
  5395. };
  5396. d.getPowOut = function(a) {
  5397. return function(c) {
  5398. return 1 - Math.pow(1 - c, a)
  5399. }
  5400. };
  5401. d.getPowInOut = function(a) {
  5402. return function(c) {
  5403. return 1 > (c *= 2) ? 0.5 * Math.pow(c, a) : 1 - 0.5 * Math.abs(Math.pow(2 - c, a))
  5404. }
  5405. };
  5406. d.sineIn = function(a) {
  5407. return 1 - Math.cos(a *
  5408. Math.PI / 2)
  5409. };
  5410. d.sineOut = function(a) {
  5411. return Math.sin(a * Math.PI / 2)
  5412. };
  5413. d.sineInOut = function(a) {
  5414. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5415. };
  5416. d.getBackIn = function(a) {
  5417. return function(c) {
  5418. return c * c * ((a + 1) * c - a)
  5419. }
  5420. };
  5421. d.getBackOut = function(a) {
  5422. return function(c) {
  5423. return --c * c * ((a + 1) * c + a) + 1
  5424. }
  5425. };
  5426. d.getBackInOut = function(a) {
  5427. a *= 1.525;
  5428. return function(c) {
  5429. return 1 > (c *= 2) ? 0.5 * c * c * ((a + 1) * c - a) : 0.5 * ((c -= 2) * c * ((a + 1) * c + a) + 2)
  5430. }
  5431. };
  5432. d.circIn = function(a) {
  5433. return -(Math.sqrt(1 - a * a) - 1)
  5434. };
  5435. d.circOut = function(a) {
  5436. return Math.sqrt(1 - --a * a)
  5437. };
  5438. d.circInOut = function(a) {
  5439. return 1 >
  5440. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5441. };
  5442. d.bounceIn = function(a) {
  5443. return 1 - d.bounceOut(1 - a)
  5444. };
  5445. d.bounceOut = function(a) {
  5446. return a < 1 / 2.75 ? 7.5625 * a * a : a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  5447. };
  5448. d.bounceInOut = function(a) {
  5449. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5450. };
  5451. d.getElasticIn = function(a, c) {
  5452. var b = 2 * Math.PI;
  5453. return function(d) {
  5454. if (0 == d || 1 == d) return d;
  5455. var e = c / b * Math.asin(1 / a);
  5456. return -(a * Math.pow(2, 10 *
  5457. (d -= 1)) * Math.sin((d - e) * b / c))
  5458. }
  5459. };
  5460. d.getElasticOut = function(a, c) {
  5461. var b = 2 * Math.PI;
  5462. return function(d) {
  5463. if (0 == d || 1 == d) return d;
  5464. var e = c / b * Math.asin(1 / a);
  5465. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * b / c) + 1
  5466. }
  5467. };
  5468. d.getElasticInOut = function(a, c) {
  5469. var b = 2 * Math.PI;
  5470. return function(d) {
  5471. var e = c / b * Math.asin(1 / a);
  5472. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * b / c) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * b / c) * 0.5 + 1
  5473. }
  5474. };
  5475. d.quadIn = d.getPowIn(2);
  5476. d.quadOut = d.getPowOut(2);
  5477. d.quadInOut = d.getPowInOut(2);
  5478. d.cubicIn = d.getPowIn(3);
  5479. d.cubicOut = d.getPowOut(3);
  5480. d.cubicInOut = d.getPowInOut(3);
  5481. d.quartIn = d.getPowIn(4);
  5482. d.quartOut = d.getPowOut(4);
  5483. d.quartInOut = d.getPowInOut(4);
  5484. d.quintIn = d.getPowIn(5);
  5485. d.quintOut = d.getPowOut(5);
  5486. d.quintInOut = d.getPowInOut(5);
  5487. d.backIn = d.getBackIn(1.7);
  5488. d.backOut = d.getBackOut(1.7);
  5489. d.backInOut = d.getBackInOut(1.7);
  5490. d.elasticIn = d.getElasticIn(1, 0.3);
  5491. d.elasticOut = d.getElasticOut(1, 0.3);
  5492. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5493. return d
  5494. }();
  5495. b.Ease = e;
  5496. e.prototype.__class__ = "egret.Ease"
  5497. })(egret || (egret = {}));
  5498. (function(b) {
  5499. var e = function() {
  5500. function b() {
  5501. this.type = b.EFFECT
  5502. }
  5503. b.prototype.play = function(a) {
  5504. void 0 === a && (a = !1);
  5505. var c = this.audio;
  5506. c && (isNaN(c.duration) || (c.currentTime = 0), c.loop = a, c.play())
  5507. };
  5508. b.prototype.pause = function() {
  5509. var a = this.audio;
  5510. a && a.pause()
  5511. };
  5512. b.prototype.load = function() {
  5513. var a = this.audio;
  5514. a && a.load()
  5515. };
  5516. b.prototype.addEventListener = function(a, c) {
  5517. this.audio && this.audio.addEventListener(a, c, !1)
  5518. };
  5519. b.prototype.removeEventListener = function(a, c) {
  5520. this.audio && this.audio.removeEventListener(a, c, !1)
  5521. };
  5522. b.prototype.setVolume =
  5523. function(a) {
  5524. var c = this.audio;
  5525. c && (c.volume = a)
  5526. };
  5527. b.prototype.getVolume = function() {
  5528. return this.audio ? this.audio.volume : 0
  5529. };
  5530. b.prototype.preload = function(a) {
  5531. this.type = a
  5532. };
  5533. b.prototype._setAudio = function(a) {
  5534. this.audio = a
  5535. };
  5536. b.MUSIC = "music";
  5537. b.EFFECT = "effect";
  5538. return b
  5539. }();
  5540. b.Sound = e;
  5541. e.prototype.__class__ = "egret.Sound"
  5542. })(egret || (egret = {}));
  5543. (function(b) {
  5544. var e = function() {
  5545. function b() {}
  5546. b.isNumber = function(a) {
  5547. return "number" === typeof a && !isNaN(a)
  5548. };
  5549. return b
  5550. }();
  5551. b.NumberUtils = e;
  5552. e.prototype.__class__ = "egret.NumberUtils"
  5553. })(egret || (egret = {}));
  5554. Function.prototype.bind || (Function.prototype.bind = function(b) {
  5555. if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5556. var e = Array.prototype.slice.call(arguments, 1),
  5557. d = this,
  5558. a = function() {},
  5559. c = function() {
  5560. return d.apply(this instanceof a && b ? this : b, e.concat(Array.prototype.slice.call(arguments)))
  5561. };
  5562. a.prototype = this.prototype;
  5563. c.prototype = new a;
  5564. return c
  5565. });
  5566. var __extends = this.__extends || function(b, e) {
  5567. function d() {
  5568. this.constructor = b
  5569. }
  5570. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5571. d.prototype = e.prototype;
  5572. b.prototype = new d
  5573. },
  5574. RES;
  5575. (function(b) {
  5576. var e = function(b) {
  5577. function a(a, e, g) {
  5578. void 0 === e && (e = !1);
  5579. void 0 === g && (g = !1);
  5580. b.call(this, a, e, g);
  5581. this.itemsTotal = this.itemsLoaded = 0
  5582. }
  5583. __extends(a, b);
  5584. a.dispatchResourceEvent = function(c, b, d, e, h, f) {
  5585. void 0 === d && (d = "");
  5586. void 0 === e && (e = null);
  5587. void 0 === h && (h = 0);
  5588. void 0 === f && (f = 0);
  5589. var k = egret.Event._getPropertyData(a);
  5590. k.groupName = d;
  5591. k.resItem = e;
  5592. k.itemsLoaded = h;
  5593. k.itemsTotal = f;
  5594. egret.Event._dispatchByTarget(a, c, b, k)
  5595. };
  5596. a.ITEM_LOAD_ERROR = "itemLoadError";
  5597. a.CONFIG_COMPLETE = "configComplete";
  5598. a.GROUP_PROGRESS = "groupProgress";
  5599. a.GROUP_COMPLETE = "groupComplete";
  5600. return a
  5601. }(egret.Event);
  5602. b.ResourceEvent = e;
  5603. e.prototype.__class__ = "RES.ResourceEvent"
  5604. })(RES || (RES = {}));
  5605. (function(b) {
  5606. var e = function() {
  5607. function b(a, c, d) {
  5608. this._loaded = !1;
  5609. this.name = a;
  5610. this.url = c;
  5611. this.type = d
  5612. }
  5613. Object.defineProperty(b.prototype, "loaded", {
  5614. get: function() {
  5615. return this.data ? this.data.loaded : this._loaded
  5616. },
  5617. set: function(a) {
  5618. this.data && (this.data.loaded = a);
  5619. this._loaded = a
  5620. },
  5621. enumerable: !0,
  5622. configurable: !0
  5623. });
  5624. b.prototype.toString = function() {
  5625. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  5626. };
  5627. b.TYPE_XML = "xml";
  5628. b.TYPE_IMAGE = "image";
  5629. b.TYPE_BIN = "bin";
  5630. b.TYPE_TEXT = "text";
  5631. b.TYPE_JSON =
  5632. "json";
  5633. b.TYPE_SHEET = "sheet";
  5634. b.TYPE_FONT = "font";
  5635. b.TYPE_SOUND = "sound";
  5636. return b
  5637. }();
  5638. b.ResourceItem = e;
  5639. e.prototype.__class__ = "RES.ResourceItem"
  5640. })(RES || (RES = {}));
  5641. (function(b) {
  5642. var e = function() {
  5643. function d() {
  5644. this.keyMap = {};
  5645. this.groupDic = {};
  5646. b.configInstance = this
  5647. }
  5648. d.prototype.getGroupByName = function(a) {
  5649. var c = [];
  5650. if (!this.groupDic[a]) return c;
  5651. a = this.groupDic[a];
  5652. for (var b = a.length, d = 0; d < b; d++) c.push(this.parseResourceItem(a[d]));
  5653. return c
  5654. };
  5655. d.prototype.getRawGroupByName = function(a) {
  5656. return this.groupDic[a] ? this.groupDic[a] : []
  5657. };
  5658. d.prototype.createGroup = function(a, c, b) {
  5659. void 0 === b && (b = !1);
  5660. if (!b && this.groupDic[a] || !c || 0 == c.length) return !1;
  5661. b = this.groupDic;
  5662. for (var d = [], e = c.length,
  5663. h = 0; h < e; h++) {
  5664. var f = c[h],
  5665. k = b[f];
  5666. if (k)
  5667. for (var f = k.length, m = 0; m < f; m++) {
  5668. var p = k[m]; - 1 == d.indexOf(p) && d.push(p)
  5669. } else(p = this.keyMap[f]) && -1 == d.indexOf(p) && d.push(p)
  5670. }
  5671. if (0 == d.length) return !1;
  5672. this.groupDic[a] = d;
  5673. return !0
  5674. };
  5675. d.prototype.parseConfig = function(a, c) {
  5676. if (a) {
  5677. var b = a.resources;
  5678. if (b)
  5679. for (var d = b.length, e = 0; e < d; e++) {
  5680. var h = b[e],
  5681. f = h.url;
  5682. f && -1 == f.indexOf("://") && (h.url = c + f);
  5683. this.addItemToKeyMap(h)
  5684. }
  5685. if (b = a.groups)
  5686. for (d = b.length, e = 0; e < d; e++) {
  5687. for (var f = b[e], k = [], m = f.keys.split(","), p = m.length, q = 0; q < p; q++) h = m[q].trim(), (h = this.keyMap[h]) && -1 == k.indexOf(h) && k.push(h);
  5688. this.groupDic[f.name] = k
  5689. }
  5690. }
  5691. };
  5692. d.prototype.addSubkey = function(a, c) {
  5693. var b = this.keyMap[c];
  5694. b && !this.keyMap[a] && (this.keyMap[a] = b)
  5695. };
  5696. d.prototype.addItemToKeyMap = function(a) {
  5697. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  5698. if (a.hasOwnProperty("subkeys")) {
  5699. var c = a.subkeys.split(",");
  5700. a.subkeys = c;
  5701. for (var b = c.length, d = 0; d < b; d++) {
  5702. var e = c[d];
  5703. null == this.keyMap[e] && (this.keyMap[e] = a)
  5704. }
  5705. }
  5706. };
  5707. d.prototype.getName = function(a) {
  5708. return (a = this.keyMap[a]) ? a.name : ""
  5709. };
  5710. d.prototype.getType =
  5711. function(a) {
  5712. return (a = this.keyMap[a]) ? a.type : ""
  5713. };
  5714. d.prototype.getRawResourceItem = function(a) {
  5715. return this.keyMap[a]
  5716. };
  5717. d.prototype.getResourceItem = function(a) {
  5718. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  5719. };
  5720. d.prototype.parseResourceItem = function(a) {
  5721. var c = new b.ResourceItem(a.name, a.url, a.type);
  5722. c.data = a;
  5723. return c
  5724. };
  5725. return d
  5726. }();
  5727. b.ResourceConfig = e;
  5728. e.prototype.__class__ = "RES.ResourceConfig"
  5729. })(RES || (RES = {}));
  5730. __extends = this.__extends || function(b, e) {
  5731. function d() {
  5732. this.constructor = b
  5733. }
  5734. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5735. d.prototype = e.prototype;
  5736. b.prototype = new d
  5737. };
  5738. (function(b) {
  5739. var e = function(d) {
  5740. function a() {
  5741. d.call(this);
  5742. this.thread = 2;
  5743. this.loadingCount = 0;
  5744. this.groupTotalDic = {};
  5745. this.numLoadedDic = {};
  5746. this.itemListDic = {};
  5747. this.priorityQueue = {};
  5748. this.lazyLoadList = [];
  5749. this.analyzerDic = {};
  5750. this.queueIndex = 0
  5751. }
  5752. __extends(a, d);
  5753. a.prototype.isGroupInLoading = function(a) {
  5754. return void 0 !== this.itemListDic[a]
  5755. };
  5756. a.prototype.loadGroup = function(a, d, e) {
  5757. void 0 === e && (e = 0);
  5758. if (!this.itemListDic[d] && d)
  5759. if (a && 0 != a.length) {
  5760. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  5761. this.itemListDic[d] = a;
  5762. e = a.length;
  5763. for (var n = 0; n < e; n++) a[n].groupName = d;
  5764. this.groupTotalDic[d] = a.length;
  5765. this.numLoadedDic[d] = 0;
  5766. this.next()
  5767. } else egret.Logger.warning('RES加载了不存在或空的资源组:"' + d + '"'), a = new b.ResourceEvent(b.ResourceEvent.GROUP_COMPLETE), a.groupName = d, this.dispatchEvent(a)
  5768. };
  5769. a.prototype.loadItem = function(a) {
  5770. this.lazyLoadList.push(a);
  5771. a.groupName = "";
  5772. this.next()
  5773. };
  5774. a.prototype.next = function() {
  5775. for (; this.loadingCount < this.thread;) {
  5776. var a =
  5777. this.getOneResourceItem();
  5778. if (!a) break;
  5779. this.loadingCount++;
  5780. if (a.loaded) this.onItemComplete(a);
  5781. else {
  5782. var d = this.analyzerDic[a.type];
  5783. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  5784. d.loadFile(a, this.onItemComplete, this)
  5785. }
  5786. }
  5787. };
  5788. a.prototype.getOneResourceItem = function() {
  5789. var a = Number.NEGATIVE_INFINITY,
  5790. b;
  5791. for (b in this.priorityQueue) a = Math.max(a, b);
  5792. a = this.priorityQueue[a];
  5793. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  5794. b = a.length;
  5795. for (var d, e =
  5796. 0; e < b; e++) {
  5797. this.queueIndex >= b && (this.queueIndex = 0);
  5798. d = this.itemListDic[a[this.queueIndex]];
  5799. if (0 < d.length) break;
  5800. this.queueIndex++
  5801. }
  5802. return 0 == d.length ? null : d.shift()
  5803. };
  5804. a.prototype.onItemComplete = function(a) {
  5805. this.loadingCount--;
  5806. var d = a.groupName;
  5807. a.loaded || b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  5808. if (d) {
  5809. this.numLoadedDic[d]++;
  5810. var e = this.numLoadedDic[d],
  5811. n = this.groupTotalDic[d];
  5812. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS,
  5813. d, a, e, n);
  5814. e == n && (this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, d))
  5815. } else this.callBack.call(this.resInstance, a);
  5816. this.next()
  5817. };
  5818. a.prototype.removeGroupName = function(a) {
  5819. for (var b in this.priorityQueue) {
  5820. for (var d = this.priorityQueue[b], e = d.length, h = 0, f = !1, e = d.length, k = 0; k < e; k++) {
  5821. if (d[k] == a) {
  5822. d.splice(h, 1);
  5823. f = !0;
  5824. break
  5825. }
  5826. h++
  5827. }
  5828. if (f) {
  5829. 0 == d.length && delete this.priorityQueue[b];
  5830. break
  5831. }
  5832. }
  5833. };
  5834. return a
  5835. }(egret.EventDispatcher);
  5836. b.ResourceLoader = e;
  5837. e.prototype.__class__ = "RES.ResourceLoader"
  5838. })(RES || (RES = {}));
  5839. __extends = this.__extends || function(b, e) {
  5840. function d() {
  5841. this.constructor = b
  5842. }
  5843. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5844. d.prototype = e.prototype;
  5845. b.prototype = new d
  5846. };
  5847. (function(b) {
  5848. var e = function(d) {
  5849. function a() {
  5850. d.call(this);
  5851. this.resourceConfig = b.configInstance
  5852. }
  5853. __extends(a, d);
  5854. a.prototype.addSubkey = function(a, b) {
  5855. this.resourceConfig.addSubkey(a, b)
  5856. };
  5857. a.prototype.loadFile = function(a, b, d) {};
  5858. a.prototype.getRes = function(a) {};
  5859. a.prototype.destroyRes = function(a) {
  5860. return !1
  5861. };
  5862. a.getStringPrefix = function(a) {
  5863. if (!a) return "";
  5864. var b = a.indexOf(".");
  5865. return -1 != b ? a.substring(0, b) : ""
  5866. };
  5867. a.getStringTail = function(a) {
  5868. if (!a) return "";
  5869. var b = a.indexOf(".");
  5870. return -1 != b ? a.substring(b + 1) : ""
  5871. };
  5872. return a
  5873. }(egret.HashObject);
  5874. b.AnalyzerBase = e;
  5875. e.prototype.__class__ = "RES.AnalyzerBase"
  5876. })(RES || (RES = {}));
  5877. __extends = this.__extends || function(b, e) {
  5878. function d() {
  5879. this.constructor = b
  5880. }
  5881. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5882. d.prototype = e.prototype;
  5883. b.prototype = new d
  5884. };
  5885. (function(b) {
  5886. var e = function(b) {
  5887. function a() {
  5888. b.call(this);
  5889. this.fileDic = {};
  5890. this.resItemDic = [];
  5891. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  5892. this.recycler = new egret.Recycler
  5893. }
  5894. __extends(a, b);
  5895. a.prototype.loadFile = function(a, b, d) {
  5896. if (this.fileDic[a.name]) b.call(d, a);
  5897. else {
  5898. var e = this.getLoader();
  5899. this.resItemDic[e.hashCode] = {
  5900. item: a,
  5901. func: b,
  5902. thisObject: d
  5903. };
  5904. e.load(new egret.URLRequest(a.url))
  5905. }
  5906. };
  5907. a.prototype.getLoader = function() {
  5908. var a = this.recycler.pop();
  5909. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  5910. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  5911. a.dataFormat = this._dataFormat;
  5912. return a
  5913. };
  5914. a.prototype.onLoadFinish = function(a) {
  5915. var b = a.target,
  5916. d = this.resItemDic[b.hashCode];
  5917. delete this.resItemDic[b.hashCode];
  5918. this.recycler.push(b);
  5919. var e = d.item,
  5920. h = d.func;
  5921. e.loaded = a.type == egret.Event.COMPLETE;
  5922. e.loaded && this.analyzeData(e, b.data);
  5923. h.call(d.thisObject, e)
  5924. };
  5925. a.prototype.analyzeData = function(a, b) {
  5926. var d = a.name;
  5927. !this.fileDic[d] && b && (this.fileDic[d] = b)
  5928. };
  5929. a.prototype.getRes =
  5930. function(a) {
  5931. return this.fileDic[a]
  5932. };
  5933. a.prototype.hasRes = function(a) {
  5934. return null != this.getRes(a)
  5935. };
  5936. a.prototype.destroyRes = function(a) {
  5937. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  5938. };
  5939. return a
  5940. }(b.AnalyzerBase);
  5941. b.BinAnalyzer = e;
  5942. e.prototype.__class__ = "RES.BinAnalyzer"
  5943. })(RES || (RES = {}));
  5944. __extends = this.__extends || function(b, e) {
  5945. function d() {
  5946. this.constructor = b
  5947. }
  5948. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5949. d.prototype = e.prototype;
  5950. b.prototype = new d
  5951. };
  5952. (function(b) {
  5953. var e = function(b) {
  5954. function a() {
  5955. b.call(this);
  5956. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  5957. }
  5958. __extends(a, b);
  5959. a.prototype.analyzeData = function(a, b) {
  5960. var d = a.name;
  5961. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  5962. };
  5963. return a
  5964. }(b.BinAnalyzer);
  5965. b.ImageAnalyzer = e;
  5966. e.prototype.__class__ = "RES.ImageAnalyzer"
  5967. })(RES || (RES = {}));
  5968. __extends = this.__extends || function(b, e) {
  5969. function d() {
  5970. this.constructor = b
  5971. }
  5972. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  5973. d.prototype = e.prototype;
  5974. b.prototype = new d
  5975. };
  5976. (function(b) {
  5977. var e = function(b) {
  5978. function a() {
  5979. b.call(this);
  5980. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  5981. }
  5982. __extends(a, b);
  5983. a.prototype.analyzeData = function(a, b) {
  5984. var d = a.name;
  5985. if (!this.fileDic[d] && b) try {
  5986. this.fileDic[d] = JSON.parse(b)
  5987. } catch (e) {
  5988. egret.Logger.warning("JSON文件格式不正确: " + a.url + "\ndata:" + b)
  5989. }
  5990. };
  5991. return a
  5992. }(b.BinAnalyzer);
  5993. b.JsonAnalyzer = e;
  5994. e.prototype.__class__ = "RES.JsonAnalyzer"
  5995. })(RES || (RES = {}));
  5996. __extends = this.__extends || function(b, e) {
  5997. function d() {
  5998. this.constructor = b
  5999. }
  6000. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6001. d.prototype = e.prototype;
  6002. b.prototype = new d
  6003. };
  6004. (function(b) {
  6005. var e = function(b) {
  6006. function a() {
  6007. b.call(this);
  6008. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6009. }
  6010. __extends(a, b);
  6011. return a
  6012. }(b.BinAnalyzer);
  6013. b.TextAnalyzer = e;
  6014. e.prototype.__class__ = "RES.TextAnalyzer"
  6015. })(RES || (RES = {}));
  6016. __extends = this.__extends || function(b, e) {
  6017. function d() {
  6018. this.constructor = b
  6019. }
  6020. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6021. d.prototype = e.prototype;
  6022. b.prototype = new d
  6023. };
  6024. (function(b) {
  6025. var e = function(d) {
  6026. function a() {
  6027. d.call(this);
  6028. this.sheetMap = {};
  6029. this.textureMap = {};
  6030. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6031. }
  6032. __extends(a, d);
  6033. a.prototype.getRes = function(a) {
  6034. var d = this.fileDic[a];
  6035. d || (d = this.textureMap[a]);
  6036. !d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = b.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  6037. return d
  6038. };
  6039. a.prototype.onLoadFinish = function(a) {
  6040. var b = a.target,
  6041. d = this.resItemDic[b.hashCode];
  6042. delete this.resItemDic[b.hashCode];
  6043. this.recycler.push(b);
  6044. var e =
  6045. d.item,
  6046. h = d.func;
  6047. e.loaded = a.type == egret.Event.COMPLETE;
  6048. e.loaded && this.analyzeData(e, b.data);
  6049. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, h, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : h.call(d.thisObject, e)
  6050. };
  6051. a.prototype.analyzeData = function(a, b) {
  6052. var d = a.name;
  6053. if (!this.fileDic[d] && b) {
  6054. var e;
  6055. if ("string" == typeof b) {
  6056. try {
  6057. e = JSON.parse(b)
  6058. } catch (h) {
  6059. egret.Logger.warning("JSON文件格式不正确: " + a.url)
  6060. }
  6061. e && (this.sheetMap[d] =
  6062. e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  6063. } else e = this.sheetMap[d], delete this.sheetMap[d], b && (e = this.parseSpriteSheet(b, e, a.data && a.data.subkeys ? "" : d), this.fileDic[d] = e)
  6064. }
  6065. };
  6066. a.prototype.getRelativePath = function(a, b) {
  6067. a = a.split("\\").join("/");
  6068. var d = a.lastIndexOf("/");
  6069. return a = -1 != d ? a.substring(0, d + 1) + b : b
  6070. };
  6071. a.prototype.parseSpriteSheet = function(a, b, d) {
  6072. b = b.frames;
  6073. if (!b) return null;
  6074. var e = new egret.SpriteSheet(a),
  6075. h = this.textureMap,
  6076. f;
  6077. for (f in b) {
  6078. var k = b[f];
  6079. a = e.createTexture(f, k.x, k.y, k.w, k.h,
  6080. k.offX, k.offY, k.sourceW, k.sourceH);
  6081. k.scale9grid && (k = k.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(k[0]), parseInt(k[1]), parseInt(k[2]), parseInt(k[3])));
  6082. null == h[f] && (h[f] = a, d && this.addSubkey(f, d))
  6083. }
  6084. return e
  6085. };
  6086. return a
  6087. }(b.BinAnalyzer);
  6088. b.SheetAnalyzer = e;
  6089. e.prototype.__class__ = "RES.SheetAnalyzer"
  6090. })(RES || (RES = {}));
  6091. __extends = this.__extends || function(b, e) {
  6092. function d() {
  6093. this.constructor = b
  6094. }
  6095. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6096. d.prototype = e.prototype;
  6097. b.prototype = new d
  6098. };
  6099. (function(b) {
  6100. var e = function(b) {
  6101. function a() {
  6102. b.call(this)
  6103. }
  6104. __extends(a, b);
  6105. a.prototype.analyzeData = function(a, b) {
  6106. var d = a.name;
  6107. if (!this.fileDic[d] && b) {
  6108. var e;
  6109. "string" == typeof b ? (e = b, this.sheetMap[d] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[d], delete this.sheetMap[d], b && (e = new egret.BitmapTextSpriteSheet(b, e), this.fileDic[d] = e))
  6110. }
  6111. };
  6112. a.prototype.getTexturePath = function(a, b) {
  6113. var d = "",
  6114. e = b.split("\n")[2],
  6115. h = e.indexOf('file="'); - 1 != h && (e = e.substring(h + 6), h = e.indexOf('"'), d = e.substring(0,
  6116. h));
  6117. a = a.split("\\").join("/");
  6118. h = a.lastIndexOf("/");
  6119. return a = -1 != h ? a.substring(0, h + 1) + d : d
  6120. };
  6121. return a
  6122. }(b.SheetAnalyzer);
  6123. b.FontAnalyzer = e;
  6124. e.prototype.__class__ = "RES.FontAnalyzer"
  6125. })(RES || (RES = {}));
  6126. __extends = this.__extends || function(b, e) {
  6127. function d() {
  6128. this.constructor = b
  6129. }
  6130. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6131. d.prototype = e.prototype;
  6132. b.prototype = new d
  6133. };
  6134. (function(b) {
  6135. var e = function(b) {
  6136. function a() {
  6137. b.call(this);
  6138. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  6139. }
  6140. __extends(a, b);
  6141. a.prototype.analyzeData = function(a, b) {
  6142. var d = a.name;
  6143. !this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.soundType ? b.preload(d.soundType) : b.preload(egret.Sound.EFFECT))
  6144. };
  6145. return a
  6146. }(b.BinAnalyzer);
  6147. b.SoundAnalyzer = e;
  6148. e.prototype.__class__ = "RES.SoundAnalyzer"
  6149. })(RES || (RES = {}));
  6150. __extends = this.__extends || function(b, e) {
  6151. function d() {
  6152. this.constructor = b
  6153. }
  6154. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6155. d.prototype = e.prototype;
  6156. b.prototype = new d
  6157. };
  6158. (function(b) {
  6159. var e = function(b) {
  6160. function a() {
  6161. b.call(this);
  6162. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6163. }
  6164. __extends(a, b);
  6165. a.prototype.analyzeData = function(a, b) {
  6166. var d = a.name;
  6167. if (!this.fileDic[d] && b) try {
  6168. var e = egret.XML.parse(b);
  6169. this.fileDic[d] = e
  6170. } catch (h) {}
  6171. };
  6172. return a
  6173. }(b.BinAnalyzer);
  6174. b.XMLAnalyzer = e;
  6175. e.prototype.__class__ = "RES.XMLAnalyzer"
  6176. })(RES || (RES = {}));
  6177. __extends = this.__extends || function(b, e) {
  6178. function d() {
  6179. this.constructor = b
  6180. }
  6181. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6182. d.prototype = e.prototype;
  6183. b.prototype = new d
  6184. };
  6185. (function(b) {
  6186. b.loadConfig = function(a, c, b) {
  6187. void 0 === c && (c = "");
  6188. void 0 === b && (b = "json");
  6189. d.loadConfig(a, c, b)
  6190. };
  6191. b.loadGroup = function(a, c) {
  6192. void 0 === c && (c = 0);
  6193. d.loadGroup(a, c)
  6194. };
  6195. b.isGroupLoaded = function(a) {
  6196. return d.isGroupLoaded(a)
  6197. };
  6198. b.getGroupByName = function(a) {
  6199. return d.getGroupByName(a)
  6200. };
  6201. b.createGroup = function(a, c, b) {
  6202. void 0 === b && (b = !1);
  6203. return d.createGroup(a, c, b)
  6204. };
  6205. b.hasRes = function(a) {
  6206. return d.hasRes(a)
  6207. };
  6208. b.getRes = function(a) {
  6209. return d.getRes(a)
  6210. };
  6211. b.getResAsync = function(a, c, b) {
  6212. d.getResAsync(a, c, b)
  6213. };
  6214. b.getResByUrl =
  6215. function(a, c, b, e) {
  6216. void 0 === e && (e = "");
  6217. d.getResByUrl(a, c, b, e)
  6218. };
  6219. b.destroyRes = function(a) {
  6220. return d.destroyRes(a)
  6221. };
  6222. b.setMaxLoadingThread = function(a) {
  6223. d.setMaxLoadingThread(a)
  6224. };
  6225. b.addEventListener = function(a, c, b, e, n) {
  6226. void 0 === e && (e = !1);
  6227. void 0 === n && (n = 0);
  6228. d.addEventListener(a, c, b, e, n)
  6229. };
  6230. b.removeEventListener = function(a, c, b, e) {
  6231. void 0 === e && (e = !1);
  6232. d.removeEventListener(a, c, b, e)
  6233. };
  6234. var e = function(a) {
  6235. function c() {
  6236. a.call(this);
  6237. this.analyzerDic = {};
  6238. this.configItemList = [];
  6239. this.configComplete = this.callLaterFlag = !1;
  6240. this.loadedGroups = [];
  6241. this.groupNameList = [];
  6242. this.asyncDic = {};
  6243. this.init()
  6244. }
  6245. __extends(c, a);
  6246. c.prototype.getAnalyzerByType = function(a) {
  6247. var c = this.analyzerDic[a];
  6248. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  6249. return c
  6250. };
  6251. c.prototype.init = function() {
  6252. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  6253. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer,
  6254. b.ResourceItem.TYPE_IMAGE);
  6255. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  6256. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  6257. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  6258. egret.Injector.hasMapRule(b.AnalyzerBase,
  6259. b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  6260. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  6261. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  6262. this.resConfig = new b.ResourceConfig;
  6263. this.resLoader = new b.ResourceLoader;
  6264. this.resLoader.callBack = this.onResourceItemComp;
  6265. this.resLoader.resInstance = this;
  6266. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  6267. };
  6268. c.prototype.loadConfig = function(a, c, b) {
  6269. void 0 === b && (b = "json");
  6270. this.configItemList.push({
  6271. url: a,
  6272. resourceRoot: c,
  6273. type: b
  6274. });
  6275. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  6276. };
  6277. c.prototype.startLoadConfig = function() {
  6278. this.callLaterFlag = !1;
  6279. var a = this.configItemList;
  6280. this.configItemList = [];
  6281. this.loadingConfigList = a;
  6282. for (var d = a.length, e = [], h = 0; h < d; h++) {
  6283. var f =
  6284. a[h],
  6285. f = new b.ResourceItem(f.url, f.url, f.type);
  6286. e.push(f)
  6287. }
  6288. this.resLoader.loadGroup(e, c.GROUP_CONFIG, Number.MAX_VALUE)
  6289. };
  6290. c.prototype.isGroupLoaded = function(a) {
  6291. return -1 != this.loadedGroups.indexOf(a)
  6292. };
  6293. c.prototype.getGroupByName = function(a) {
  6294. return this.resConfig.getGroupByName(a)
  6295. };
  6296. c.prototype.loadGroup = function(a, c) {
  6297. void 0 === c && (c = 0);
  6298. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  6299. if (this.configComplete) {
  6300. var b = this.resConfig.getGroupByName(a);
  6301. this.resLoader.loadGroup(b, a, c)
  6302. } else this.groupNameList.push({
  6303. name: a,
  6304. priority: c
  6305. })
  6306. };
  6307. c.prototype.createGroup = function(a, c, b) {
  6308. void 0 === b && (b = !1);
  6309. if (b) {
  6310. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  6311. }
  6312. return this.resConfig.createGroup(a, c, b)
  6313. };
  6314. c.prototype.onGroupComp = function(a) {
  6315. if (a.groupName == c.GROUP_CONFIG) {
  6316. a = this.loadingConfigList.length;
  6317. for (var d = 0; d < a; d++) {
  6318. var e = this.loadingConfigList[d],
  6319. h = this.getAnalyzerByType(e.type),
  6320. f = h.getRes(e.url);
  6321. h.destroyRes(e.url);
  6322. this.resConfig.parseConfig(f, e.resourceRoot)
  6323. }
  6324. this.configComplete = !0;
  6325. this.loadingConfigList =
  6326. null;
  6327. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  6328. e = this.groupNameList;
  6329. a = e.length;
  6330. for (d = 0; d < a; d++) h = e[d], this.loadGroup(h.name, h.priority);
  6331. this.groupNameList = []
  6332. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  6333. };
  6334. c.prototype.hasRes = function(a) {
  6335. var c = this.resConfig.getType(a);
  6336. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a), "" == c) ? !1 : !0
  6337. };
  6338. c.prototype.getRes = function(a) {
  6339. var c = this.resConfig.getType(a);
  6340. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a),
  6341. c = this.resConfig.getType(c), "" == c) ? null : this.getAnalyzerByType(c).getRes(a)
  6342. };
  6343. c.prototype.getResAsync = function(a, c, d) {
  6344. var e = this.resConfig.getType(a),
  6345. f = this.resConfig.getName(a);
  6346. if ("" == e && (f = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(f), "" == e)) {
  6347. c.call(d, null);
  6348. return
  6349. }(e = this.getAnalyzerByType(e).getRes(a)) ? c.call(d, e): (a = {
  6350. key: a,
  6351. compFunc: c,
  6352. thisObject: d
  6353. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  6354. };
  6355. c.prototype.getResByUrl =
  6356. function(a, c, d, e) {
  6357. void 0 === e && (e = "");
  6358. if (a) {
  6359. e || (e = this.getTypeByUrl(a));
  6360. var f = this.getAnalyzerByType(e).getRes(a);
  6361. f ? c.call(d, f) : (c = {
  6362. key: a,
  6363. compFunc: c,
  6364. thisObject: d
  6365. }, this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  6366. } else c.call(d, null)
  6367. };
  6368. c.prototype.getTypeByUrl = function(a) {
  6369. (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  6370. switch (a) {
  6371. case b.ResourceItem.TYPE_XML:
  6372. case b.ResourceItem.TYPE_JSON:
  6373. case b.ResourceItem.TYPE_SHEET:
  6374. break;
  6375. case "png":
  6376. case "jpg":
  6377. case "gif":
  6378. a = b.ResourceItem.TYPE_IMAGE;
  6379. break;
  6380. case "fnt":
  6381. a = b.ResourceItem.TYPE_FONT;
  6382. break;
  6383. case "txt":
  6384. a = b.ResourceItem.TYPE_TEXT;
  6385. break;
  6386. case "mp3":
  6387. case "ogg":
  6388. case "mpeg":
  6389. case "wav":
  6390. case "m4a":
  6391. case "mp4":
  6392. case "aiff":
  6393. case "wma":
  6394. case "mid":
  6395. a = b.ResourceItem.TYPE_SOUND;
  6396. break;
  6397. default:
  6398. a = b.ResourceItem.TYPE_BIN
  6399. }
  6400. return a
  6401. };
  6402. c.prototype.onResourceItemComp = function(a) {
  6403. var c = this.asyncDic[a.name];
  6404. delete this.asyncDic[a.name];
  6405. a = this.getAnalyzerByType(a.type);
  6406. for (var b = c.length, d = 0; d < b; d++) {
  6407. var e =
  6408. c[d],
  6409. k = a.getRes(e.key);
  6410. e.compFunc.call(e.thisObject, k, e.key)
  6411. }
  6412. };
  6413. c.prototype.destroyRes = function(a) {
  6414. var c = this.resConfig.getRawGroupByName(a);
  6415. if (c) {
  6416. var b = this.loadedGroups.indexOf(a); - 1 != b && this.loadedGroups.splice(b, 1);
  6417. a = c.length;
  6418. for (var d = 0; d < a; d++) {
  6419. b = c[d];
  6420. b.loaded = !1;
  6421. var e = this.getAnalyzerByType(b.type);
  6422. e.destroyRes(b.name)
  6423. }
  6424. return !0
  6425. }
  6426. c = this.resConfig.getType(a);
  6427. if ("" == c) return !1;
  6428. b = this.resConfig.getRawResourceItem(a);
  6429. b.loaded = !1;
  6430. e = this.getAnalyzerByType(c);
  6431. return e.destroyRes(a)
  6432. };
  6433. c.prototype.setMaxLoadingThread =
  6434. function(a) {
  6435. 1 > a && (a = 1);
  6436. this.resLoader.thread = a
  6437. };
  6438. c.GROUP_CONFIG = "RES__CONFIG";
  6439. return c
  6440. }(egret.EventDispatcher);
  6441. e.prototype.__class__ = "RES.Resource";
  6442. var d = new e
  6443. })(RES || (RES = {}));
  6444. var particle;
  6445. (function(b) {
  6446. var e = function() {
  6447. function b() {
  6448. this.reset()
  6449. }
  6450. b.prototype.reset = function() {
  6451. this.y = this.x = 0;
  6452. this.scale = 1;
  6453. this.rotation = 0;
  6454. this.alpha = 1;
  6455. this.currentTime = 0;
  6456. this.totalTime = 1E3
  6457. };
  6458. return b
  6459. }();
  6460. b.Particle = e;
  6461. e.prototype.__class__ = "particle.Particle"
  6462. })(particle || (particle = {}));
  6463. __extends = this.__extends || function(b, e) {
  6464. function d() {
  6465. this.constructor = b
  6466. }
  6467. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6468. d.prototype = e.prototype;
  6469. b.prototype = new d
  6470. };
  6471. (function(b) {
  6472. var e = function(d) {
  6473. function a(a, b) {
  6474. d.call(this);
  6475. this._pool = [];
  6476. this.frameTime = 0;
  6477. this.particles = [];
  6478. this.emissionTime = -1;
  6479. this.emitterY = this.emitterX = 0;
  6480. this.maxParticles = 200;
  6481. this.numParticles = 0;
  6482. this.particleClass = null;
  6483. this.transform = new egret.Matrix;
  6484. this._texture_to_render = a;
  6485. this.emissionRate = b;
  6486. this.texture = a
  6487. }
  6488. __extends(a, d);
  6489. a.prototype.getParticle = function() {
  6490. return this._pool.length ? this._pool.pop() : this.particleClass ? new this.particleClass : new b.Particle
  6491. };
  6492. a.prototype.removeParticle = function(a) {
  6493. var b =
  6494. this.particles.indexOf(a);
  6495. return -1 != b ? (a.reset(), this.particles.splice(b, 1), this._pool.push(a), this.numParticles--, !0) : !1
  6496. };
  6497. a.prototype.initParticle = function(a) {
  6498. a.x = this.emitterX;
  6499. a.y = this.emitterY;
  6500. a.currentTime = 0;
  6501. a.totalTime = 1E3
  6502. };
  6503. a.prototype.start = function(a) {
  6504. void 0 === a && (a = -1);
  6505. 0 != this.emissionRate && (this.emissionTime = a, egret.Ticker.getInstance().register(this.update, this))
  6506. };
  6507. a.prototype.stop = function(a) {
  6508. void 0 === a && (a = !1);
  6509. this.emissionTime = 0;
  6510. egret.Ticker.getInstance().unregister(this.update, this);
  6511. a && this.clear()
  6512. };
  6513. a.prototype.update = function(a) {
  6514. if (-1 == this.emissionTime || 0 < this.emissionTime) {
  6515. for (this.frameTime += a; 0 < this.frameTime;) this.numParticles < this.maxParticles && this.addOneParticle(), this.frameTime -= this.emissionRate; - 1 != this.emissionTime && (this.emissionTime -= a, 0 > this.emissionTime && (this.emissionTime = 0))
  6516. }
  6517. for (var b, d = 0; d < this.numParticles;) b = this.particles[d], b.currentTime < b.totalTime ? (this.advanceParticle(b, a), b.currentTime += a, d++) : (this.removeParticle(b), 0 == this.numParticles && 0 == this.emissionTime &&
  6518. this.dispatchEventWith(egret.Event.COMPLETE))
  6519. };
  6520. a.prototype.setCurrentParticles = function(a) {
  6521. for (var b = this.numParticles; b < a && this.numParticles < this.maxParticles; b++) this.addOneParticle()
  6522. };
  6523. a.prototype.changeTexture = function(a) {
  6524. this.texture != a && (this._texture_to_render = this.texture = a)
  6525. };
  6526. a.prototype.clear = function() {
  6527. for (; this.particles.length;) this.removeParticle(this.particles[0]);
  6528. this.numParticles = 0
  6529. };
  6530. a.prototype.addOneParticle = function() {
  6531. var a = this.getParticle();
  6532. this.initParticle(a);
  6533. 0 < a.totalTime && (this.particles.push(a),
  6534. this.numParticles++)
  6535. };
  6536. a.prototype.advanceParticle = function(a, b) {
  6537. a.y -= b / 6
  6538. };
  6539. a.prototype._render = function(a) {
  6540. if (0 < this.numParticles)
  6541. for (var b = egret.RenderFilter.getInstance(), d = this.texture, e = d._textureWidth, h = d._textureHeight, f = d._offsetX, k = d._offsetY, m = d._bitmapX, p = d._bitmapY, q = d._bitmapWidth, d = d._bitmapHeight, r, s = 0; s < this.numParticles; s++) r = this.particles[s], this.transform.identityMatrix(this._worldTransform), this.transform.appendTransform(r.x, r.y, r.scale, r.scale, r.rotation, 0, 0, 0, 0), a.setTransform(this.transform),
  6542. b.drawImage(a, this, m, p, q, d, f, k, e, h)
  6543. };
  6544. return a
  6545. }(egret.DisplayObject);
  6546. b.ParticleSystem = e;
  6547. e.prototype.__class__ = "particle.ParticleSystem"
  6548. })(particle || (particle = {}));
  6549. __extends = this.__extends || function(b, e) {
  6550. function d() {
  6551. this.constructor = b
  6552. }
  6553. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6554. d.prototype = e.prototype;
  6555. b.prototype = new d
  6556. };
  6557. (function(b) {
  6558. var e = function(b) {
  6559. function a() {
  6560. b.apply(this, arguments)
  6561. }
  6562. __extends(a, b);
  6563. a.prototype.reset = function() {
  6564. b.prototype.reset.call(this);
  6565. this.scaleDelta = this.rotationDelta = this.tangentialAcceleration = this.radialAcceleration = this.velocityY = this.velocityX = this.startY = this.startX = 0
  6566. };
  6567. return a
  6568. }(b.Particle);
  6569. b.GravityParticle = e;
  6570. e.prototype.__class__ = "particle.GravityParticle"
  6571. })(particle || (particle = {}));
  6572. __extends = this.__extends || function(b, e) {
  6573. function d() {
  6574. this.constructor = b
  6575. }
  6576. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6577. d.prototype = e.prototype;
  6578. b.prototype = new d
  6579. };
  6580. (function(b) {
  6581. var e = function(d) {
  6582. function a(a, e) {
  6583. d.call(this, a, 200);
  6584. this.parseConfig(e);
  6585. this.emissionRate = this.lifespan / this.maxParticles;
  6586. this.particleClass = b.GravityParticle
  6587. }
  6588. __extends(a, d);
  6589. a.prototype.parseConfig = function(a) {
  6590. function b(a) {
  6591. return "undefined" == typeof a ? 0 : a
  6592. }
  6593. this.emitterX = b(a.emitter.x);
  6594. this.emitterY = b(a.emitter.y);
  6595. this.emitterXVariance = b(a.emitterVariance.x);
  6596. this.emitterYVariance = b(a.emitterVariance.y);
  6597. this.gravityX = b(a.gravity.x);
  6598. this.gravityY = b(a.gravity.y);
  6599. this.maxParticles = b(a.maxParticles);
  6600. this.speed = b(a.speed);
  6601. this.speedVariance = b(a.speedVariance);
  6602. this.lifespan = Math.max(0.01, b(a.lifespan));
  6603. this.lifespanVariance = b(a.lifespanVariance);
  6604. this.emitAngle = b(a.emitAngle);
  6605. this.emitAngleVariance = b(a.emitAngleVariance);
  6606. this.startSize = b(a.startSize);
  6607. this.startSizeVariance = b(a.startSizeVariance);
  6608. this.endSize = b(a.endSize);
  6609. this.endSizeVariance = b(a.endSizeVariance);
  6610. this.startRotation = b(a.startRotation);
  6611. this.startRotationVariance = b(a.startRotationVariance);
  6612. this.endRotation = b(a.endRotation);
  6613. this.endRotationVariance =
  6614. b(a.endRotationVariance);
  6615. this.radialAcceleration = b(a.radialAcceleration);
  6616. this.radialAccelerationVariance = b(a.radialAccelerationVariance);
  6617. this.tangentialAcceleration = b(a.tangentialAcceleration);
  6618. this.tangentialAccelerationVariance = b(a.tangentialAccelerationVariance);
  6619. this.startAlpha = b(a.startAlpha);
  6620. this.startAlphaVariance = b(a.startAlphaVariance);
  6621. this.endAlpha = b(a.endAlpha);
  6622. this.endAlphaVariance = b(a.endAlphaVariance)
  6623. };
  6624. a.prototype.initParticle = function(c) {
  6625. var b = a.getValue(this.lifespan, this.lifespanVariance);
  6626. c.currentTime = 0;
  6627. c.totalTime = 0 < b ? b : 0;
  6628. if (!(0 >= b)) {
  6629. c.x = a.getValue(this.emitterX, this.emitterXVariance);
  6630. c.y = a.getValue(this.emitterY, this.emitterYVariance);
  6631. c.startX = this.emitterX;
  6632. c.startY = this.emitterY;
  6633. var d = a.getValue(this.emitAngle, this.emitAngleVariance),
  6634. d = d * Math.PI / 180,
  6635. e = a.getValue(this.speed, this.speedVariance);
  6636. c.velocityX = e * Math.cos(d);
  6637. c.velocityY = e * Math.sin(d);
  6638. c.radialAcceleration = a.getValue(this.radialAcceleration, this.radialAccelerationVariance);
  6639. c.tangentialAcceleration = a.getValue(this.tangentialAcceleration,
  6640. this.tangentialAccelerationVariance);
  6641. d = a.getValue(this.startSize, this.startSizeVariance);
  6642. 0.1 > d && (d = 0.1);
  6643. e = a.getValue(this.endSize, this.endSizeVariance);
  6644. 0.1 > e && (e = 0.1);
  6645. var h = this.texture.textureWidth;
  6646. c.scale = d / h;
  6647. c.scaleDelta = (e - d) / b / h;
  6648. d = a.getValue(this.startRotation, this.startRotationVariance);
  6649. e = a.getValue(this.endRotation, this.endRotationVariance);
  6650. c.rotation = d;
  6651. c.rotationDelta = (e - d) / b
  6652. }
  6653. };
  6654. a.getValue = function(a, b) {
  6655. return a + b * (2 * Math.random() - 1)
  6656. };
  6657. a.prototype.advanceParticle = function(a, b) {
  6658. b /= 1E3;
  6659. var d =
  6660. a.totalTime - a.currentTime;
  6661. b = d > b ? b : d;
  6662. a.currentTime += b;
  6663. var d = a.x - a.startX,
  6664. e = a.y - a.startY,
  6665. h = Math.sqrt(d * d + e * e);
  6666. 0.01 > h && (h = 0.01);
  6667. var d = d / h,
  6668. e = e / h,
  6669. h = d,
  6670. f = e,
  6671. d = d * a.radialAcceleration,
  6672. e = e * a.radialAcceleration,
  6673. k = h,
  6674. h = -f * a.tangentialAcceleration,
  6675. f = k * a.tangentialAcceleration;
  6676. a.velocityX += b * (this.gravityX + d + h);
  6677. a.velocityY += b * (this.gravityY + e + f);
  6678. a.x += a.velocityX * b;
  6679. a.y += a.velocityY * b;
  6680. a.scale += a.scaleDelta * b * 1E3;
  6681. a.rotation += a.rotationDelta * b * 1E3
  6682. };
  6683. return a
  6684. }(b.ParticleSystem);
  6685. b.GravityParticleSystem = e;
  6686. e.prototype.__class__ =
  6687. "particle.GravityParticleSystem"
  6688. })(particle || (particle = {}));
  6689. __extends = this.__extends || function(b, e) {
  6690. function d() {
  6691. this.constructor = b
  6692. }
  6693. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6694. d.prototype = e.prototype;
  6695. b.prototype = new d
  6696. };
  6697. (function(b) {
  6698. var e = function(d) {
  6699. function a(c) {
  6700. void 0 === c && (c = 60);
  6701. d.call(this);
  6702. this.frameRate = c;
  6703. this._time = 0;
  6704. this._isActivate = !0;
  6705. 60 == c && (a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame ||
  6706. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6707. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6708. return window.setTimeout(a, 1E3 / c)
  6709. });
  6710. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6711. return window.clearTimeout(a)
  6712. });
  6713. a.instance = this;
  6714. this.registerListener()
  6715. }
  6716. __extends(a, d);
  6717. a.prototype.enterFrame = function() {
  6718. var c = a.instance,
  6719. d = a._thisObject,
  6720. e = a._callback,
  6721. n = b.getTimer(),
  6722. h = n -
  6723. c._time;
  6724. c._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6725. e.call(d, h);
  6726. c._time = n
  6727. };
  6728. a.prototype.executeMainLoop = function(c, b) {
  6729. a._callback = c;
  6730. a._thisObject = b;
  6731. this.enterFrame()
  6732. };
  6733. a.prototype.reset = function() {
  6734. var c = a.instance;
  6735. c._requestAnimationId && (c._time = b.getTimer(), a.cancelAnimationFrame.call(window, c._requestAnimationId), c.enterFrame())
  6736. };
  6737. a.prototype.registerListener = function() {
  6738. var c = this,
  6739. d = function() {
  6740. c._isActivate && (c._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6741. },
  6742. e = function() {
  6743. c._isActivate || (c._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6744. },
  6745. n = function() {
  6746. document[h] ? d() : e()
  6747. };
  6748. window.addEventListener("focus", e, !1);
  6749. window.addEventListener("blur", d, !1);
  6750. var h, f;
  6751. "undefined" !== typeof document.hidden ? (h = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (h = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (h = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ?
  6752. (h = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (h = "oHidden", f = "ovisibilitychange");
  6753. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", e, !1), window.addEventListener("pagehide", d, !1));
  6754. h && f && document.addEventListener(f, n, !1)
  6755. };
  6756. return a
  6757. }(b.DeviceContext);
  6758. b.HTML5DeviceContext = e;
  6759. e.prototype.__class__ = "egret.HTML5DeviceContext"
  6760. })(egret || (egret = {}));
  6761. var egret_html5_localStorage;
  6762. (function(b) {
  6763. b.getItem = function(b) {
  6764. return window.localStorage.getItem(b)
  6765. };
  6766. b.setItem = function(b, d) {
  6767. try {
  6768. return window.localStorage.setItem(b, d), !0
  6769. } catch (a) {
  6770. return console.log("egret_html5_localStorage.setItem保存失败,key=" + b + "&value=" + d), !1
  6771. }
  6772. };
  6773. b.removeItem = function(b) {
  6774. window.localStorage.removeItem(b)
  6775. };
  6776. b.clear = function() {
  6777. window.localStorage.clear()
  6778. };
  6779. b.init = function() {
  6780. for (var e in b) egret.localStorage[e] = b[e]
  6781. }
  6782. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6783. egret_html5_localStorage.init();
  6784. __extends = this.__extends || function(b, e) {
  6785. function d() {
  6786. this.constructor = b
  6787. }
  6788. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  6789. d.prototype = e.prototype;
  6790. b.prototype = new d
  6791. };
  6792. (function(b) {
  6793. var e = function(d) {
  6794. function a(a) {
  6795. d.call(this);
  6796. this.globalAlpha = 1;
  6797. this.canvas = a || this.createCanvas();
  6798. this.canvasContext = this.canvas.getContext("2d");
  6799. this._cacheCanvas = document.createElement("canvas");
  6800. this._cacheCanvas.width = this.canvas.width;
  6801. this._cacheCanvas.height = this.canvas.height;
  6802. this._cacheCanvasContext = this._cacheCanvas.getContext("2d");
  6803. this._cacheCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6804. this._cacheCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6805. this._cacheCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6806. this._cacheCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6807. this.onResize();
  6808. var e = this.canvasContext.setTransform,
  6809. g = this;
  6810. this._cacheCanvasContext.setTransform = function(a, b, c, d, m, p) {
  6811. g._matrixA = a;
  6812. g._matrixB = b;
  6813. g._matrixC = c;
  6814. g._matrixD = d;
  6815. g._matrixTx = m;
  6816. g._matrixTy = p;
  6817. e.call(g._cacheCanvasContext, a, b, c, d, m, p)
  6818. };
  6819. this._matrixA = 1;
  6820. this._matrixC = this._matrixB = 0;
  6821. this._matrixD = 1;
  6822. this._transformTy =
  6823. this._transformTx = this._matrixTy = this._matrixTx = 0;
  6824. this.initBlendMode()
  6825. }
  6826. __extends(a, d);
  6827. a.prototype.createCanvas = function() {
  6828. var a = b.Browser.getInstance().$("#egretCanvas");
  6829. if (!a) {
  6830. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  6831. a = b.Browser.getInstance().$new("canvas");
  6832. a.id = "egretCanvas";
  6833. d.appendChild(a)
  6834. }
  6835. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  6836. return a
  6837. };
  6838. a.prototype.onResize = function() {
  6839. if (this.canvas) {
  6840. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6841. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6842. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6843. this.canvas.style.width = a.style.width;
  6844. this.canvas.style.height = a.style.height;
  6845. this._cacheCanvas.width = this.canvas.width;
  6846. this._cacheCanvas.height = this.canvas.height
  6847. }
  6848. };
  6849. a.prototype.clearScreen = function() {
  6850. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  6851. var n = a[d];
  6852. this.clearRect(n.x, n.y, n.width, n.height)
  6853. }
  6854. a = b.MainContext.instance.stage;
  6855. this._cacheCanvasContext.clearRect(0,
  6856. 0, a.stageWidth, a.stageHeight);
  6857. this.renderCost = 0
  6858. };
  6859. a.prototype.clearRect = function(a, b, d, e) {
  6860. this.canvasContext.clearRect(a, b, d, e)
  6861. };
  6862. a.prototype.drawImage = function(a, e, g, n, h, f, k, m, p, q) {
  6863. void 0 === q && (q = void 0);
  6864. var r = b.MainContext.instance.rendererContext.texture_scale_factor;
  6865. e /= r;
  6866. g /= r;
  6867. n /= r;
  6868. h /= r;
  6869. r = a._bitmapData;
  6870. f += this._transformTx;
  6871. k += this._transformTy;
  6872. var s = b.getTimer();
  6873. void 0 === q ? this._cacheCanvasContext.drawImage(r, e, g, n, h, f, k, m, p) : this.drawRepeatImage(a, e, g, n, h, f, k, m, p, q);
  6874. d.prototype.drawImage.call(this,
  6875. a, e, g, n, h, f, k, m, p, q);
  6876. this.renderCost += b.getTimer() - s
  6877. };
  6878. a.prototype.drawRepeatImage = function(a, b, d, e, h, f, k, m, p, q) {
  6879. if (void 0 === a.pattern) {
  6880. var r = a._bitmapData,
  6881. s = r;
  6882. if (r.width != e || r.height != h) s = document.createElement("canvas"), s.width = e, s.height = h, s.getContext("2d").drawImage(r, b, d, e, h, 0, 0, e, h);
  6883. b = this._cacheCanvasContext.createPattern(s, q);
  6884. a.pattern = b
  6885. }
  6886. this._cacheCanvasContext.fillStyle = a.pattern;
  6887. this._cacheCanvasContext.translate(f, k);
  6888. this._cacheCanvasContext.fillRect(0, 0, m, p);
  6889. this._cacheCanvasContext.translate(-f, -k)
  6890. };
  6891. a.prototype.setTransform = function(a) {
  6892. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this._cacheCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  6893. };
  6894. a.prototype.setAlpha = function(a, d) {
  6895. a != this.globalAlpha &&
  6896. (this._cacheCanvasContext.globalAlpha = this.globalAlpha = a);
  6897. d ? (this.blendValue = this.blendModes[d], this._cacheCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this._cacheCanvasContext.globalCompositeOperation = this.blendValue)
  6898. };
  6899. a.prototype.initBlendMode = function() {
  6900. this.blendModes = {};
  6901. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  6902. this.blendModes[b.BlendMode.ADD] = "lighter"
  6903. };
  6904. a.prototype.setupFont = function(a,
  6905. b) {
  6906. void 0 === b && (b = null);
  6907. b = b || {};
  6908. var d = null == b.size ? a._size : b.size,
  6909. e = null == b.fontFamily ? a._fontFamily : b.fontFamily,
  6910. h = this._cacheCanvasContext,
  6911. f = (null == b.italic ? a._italic : b.italic) ? "italic " : "normal ",
  6912. f = f + ((null == b.bold ? a._bold : b.bold) ? "bold " : "normal ");
  6913. h.font = f + (d + "px " + e);
  6914. h.textAlign = "left";
  6915. h.textBaseline = "middle"
  6916. };
  6917. a.prototype.measureText = function(a) {
  6918. return this._cacheCanvasContext.measureText(a).width
  6919. };
  6920. a.prototype.drawText = function(a, e, g, n, h, f) {
  6921. void 0 === f && (f = null);
  6922. this.setupFont(a, f);
  6923. f = f || {};
  6924. var k;
  6925. k = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6926. var m;
  6927. m = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6928. var p;
  6929. p = null != f.stroke ? f.stroke : a._stroke;
  6930. var q = this._cacheCanvasContext;
  6931. q.fillStyle = k;
  6932. q.strokeStyle = m;
  6933. p && (q.lineWidth = 2 * p, q.strokeText(e, g + this._transformTx, n + this._transformTy, h || 65535));
  6934. q.fillText(e, g + this._transformTx, n + this._transformTy, h || 65535);
  6935. d.prototype.drawText.call(this, a, e, g, n, h, f)
  6936. };
  6937. a.prototype.strokeRect = function(a, b, d, e, h) {
  6938. this._cacheCanvasContext.strokeStyle =
  6939. h;
  6940. this._cacheCanvasContext.strokeRect(a, b, d, e)
  6941. };
  6942. a.prototype.pushMask = function(a) {
  6943. this._cacheCanvasContext.save();
  6944. this._cacheCanvasContext.beginPath();
  6945. this._cacheCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6946. this._cacheCanvasContext.clip();
  6947. this._cacheCanvasContext.closePath()
  6948. };
  6949. a.prototype.popMask = function() {
  6950. this._cacheCanvasContext.restore();
  6951. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6952. };
  6953. a.prototype.onRenderStart = function() {
  6954. this._cacheCanvasContext.save()
  6955. };
  6956. a.prototype.onRenderFinish =
  6957. function() {
  6958. this._cacheCanvasContext.restore();
  6959. this._cacheCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6960. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  6961. var n = a[d];
  6962. this.canvasContext.drawImage(this._cacheCanvas, n.x, n.y, n.width, n.height, n.x, n.y, n.width, n.height)
  6963. }
  6964. };
  6965. return a
  6966. }(b.RendererContext);
  6967. b.HTML5CanvasRenderer = e;
  6968. e.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6969. })(egret || (egret = {}));
  6970. var egret_h5_graphics;
  6971. (function(b) {
  6972. b.beginFill = function(b, a) {
  6973. void 0 === a && (a = 1);
  6974. var c = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6975. this.fillStyleColor = c;
  6976. this.commandQueue.push(new e(this._setStyle, this, [c]))
  6977. };
  6978. b.drawRect = function(b, a, c, l) {
  6979. this.commandQueue.push(new e(function(a, b, c, d) {
  6980. var e = this.renderContext;
  6981. this.canvasContext.beginPath();
  6982. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  6983. this.canvasContext.closePath()
  6984. }, this, [b, a, c, l]));
  6985. this._fill()
  6986. };
  6987. b.drawCircle = function(b, a, c) {
  6988. this.commandQueue.push(new e(function(a,
  6989. b, c) {
  6990. var d = this.renderContext;
  6991. this.canvasContext.beginPath();
  6992. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  6993. this.canvasContext.closePath()
  6994. }, this, [b, a, c]));
  6995. this._fill()
  6996. };
  6997. b.drawRoundRect = function(b, a, c, l, g, n) {
  6998. this.commandQueue.push(new e(function(a, b, c, d, e, l) {
  6999. var g = this.renderContext;
  7000. a = g._transformTx + a;
  7001. b = g._transformTy + b;
  7002. e /= 2;
  7003. l = l ? l / 2 : e;
  7004. c = a + c;
  7005. d = b + d;
  7006. g = d - l;
  7007. this.canvasContext.beginPath();
  7008. this.canvasContext.moveTo(c, g);
  7009. this.canvasContext.quadraticCurveTo(c, d, c - e, d);
  7010. this.canvasContext.lineTo(a +
  7011. e, d);
  7012. this.canvasContext.quadraticCurveTo(a, d, a, d - l);
  7013. this.canvasContext.lineTo(a, b + l);
  7014. this.canvasContext.quadraticCurveTo(a, b, a + e, b);
  7015. this.canvasContext.lineTo(c - e, b);
  7016. this.canvasContext.quadraticCurveTo(c, b, c, b + l);
  7017. this.canvasContext.lineTo(c, g);
  7018. this.canvasContext.closePath()
  7019. }, this, [b, a, c, l, g, n]));
  7020. this._fill()
  7021. };
  7022. b.drawEllipse = function(b, a, c, l) {
  7023. this.commandQueue.push(new e(function(a, b, c, d) {
  7024. var e = this.renderContext;
  7025. this.canvasContext.save();
  7026. a = e._transformTx + a;
  7027. b = e._transformTy + b;
  7028. var e = c > d ? c : d,
  7029. l = c / e;
  7030. d /=
  7031. e;
  7032. this.canvasContext.scale(l, d);
  7033. this.canvasContext.beginPath();
  7034. this.canvasContext.moveTo((a + c) / l, b / d);
  7035. this.canvasContext.arc(a / l, b / d, e, 0, 2 * Math.PI);
  7036. this.canvasContext.closePath();
  7037. this.canvasContext.restore();
  7038. this.canvasContext.stroke()
  7039. }, this, [b, a, c, l]));
  7040. this._fill()
  7041. };
  7042. b.lineStyle = function(b, a, c, l, g, n, h, f) {
  7043. void 0 === b && (b = NaN);
  7044. void 0 === a && (a = 0);
  7045. void 0 === c && (c = 1);
  7046. void 0 === l && (l = !1);
  7047. void 0 === g && (g = "normal");
  7048. void 0 === n && (n = null);
  7049. void 0 === h && (h = null);
  7050. void 0 === f && (f = 3);
  7051. this.strokeStyleColor && (this.createEndLineCommand(),
  7052. this.commandQueue.push(this.endLineCommand));
  7053. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + c + ")";
  7054. this.commandQueue.push(new e(function(a, b) {
  7055. this.canvasContext.lineWidth = a;
  7056. this.canvasContext.strokeStyle = b;
  7057. this.canvasContext.beginPath()
  7058. }, this, [b, a]));
  7059. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  7060. this.moveTo(this.lineX, this.lineY)
  7061. };
  7062. b.lineTo = function(b, a) {
  7063. this.commandQueue.push(new e(function(a, b) {
  7064. var d = this.renderContext;
  7065. this.canvasContext.lineTo(d._transformTx +
  7066. a, d._transformTy + b)
  7067. }, this, [b, a]));
  7068. this.lineX = b;
  7069. this.lineY = a
  7070. };
  7071. b.curveTo = function(b, a, c, l) {
  7072. this.commandQueue.push(new e(function(a, b, c, d) {
  7073. var e = this.renderContext;
  7074. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, e._transformTx + c, e._transformTy + d)
  7075. }, this, [b, a, c, l]));
  7076. this.lineX = c;
  7077. this.lineY = l
  7078. };
  7079. b.moveTo = function(b, a) {
  7080. this.commandQueue.push(new e(function(a, b) {
  7081. var d = this.renderContext;
  7082. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + b)
  7083. }, this, [b, a]))
  7084. };
  7085. b.clear = function() {
  7086. this.lineY =
  7087. this.lineX = this.commandQueue.length = 0;
  7088. this.fillStyleColor = this.strokeStyleColor = null
  7089. };
  7090. b.createEndFillCommand = function() {
  7091. this.endFillCommand || (this.endFillCommand = new e(function() {
  7092. this.canvasContext.fill();
  7093. this.canvasContext.closePath()
  7094. }, this, null))
  7095. };
  7096. b.endFill = function() {
  7097. null != this.fillStyleColor && this._fill();
  7098. this.fillStyleColor = null
  7099. };
  7100. b._fill = function() {
  7101. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  7102. };
  7103. b.createEndLineCommand = function() {
  7104. this.endLineCommand ||
  7105. (this.endLineCommand = new e(function() {
  7106. this.canvasContext.stroke();
  7107. this.canvasContext.closePath()
  7108. }, this, null))
  7109. };
  7110. b._draw = function(b) {
  7111. var a = this.commandQueue.length;
  7112. if (0 != a) {
  7113. this.renderContext = b;
  7114. b = this.canvasContext = this.renderContext._cacheCanvasContext || this.renderContext.canvasContext;
  7115. b.save();
  7116. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  7117. for (var c = 0; c < a; c++) {
  7118. var e = this.commandQueue[c];
  7119. e.method.apply(e.thisObject, e.args)
  7120. }
  7121. b.restore()
  7122. }
  7123. };
  7124. var e = function() {
  7125. return function(b, a, c) {
  7126. this.method = b;
  7127. this.thisObject = a;
  7128. this.args = c
  7129. }
  7130. }();
  7131. e.prototype.__class__ = "egret_h5_graphics.Command";
  7132. b._setStyle = function(b) {
  7133. this.canvasContext.fillStyle = b;
  7134. this.canvasContext.beginPath()
  7135. };
  7136. b.init = function() {
  7137. for (var d in b) egret.Graphics.prototype[d] = b[d];
  7138. egret.RendererContext.createRendererContext = function(a) {
  7139. return new egret.HTML5CanvasRenderer(a)
  7140. }
  7141. }
  7142. })(egret_h5_graphics || (egret_h5_graphics = {}));
  7143. egret_h5_graphics.init();
  7144. __extends = this.__extends || function(b, e) {
  7145. function d() {
  7146. this.constructor = b
  7147. }
  7148. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  7149. d.prototype = e.prototype;
  7150. b.prototype = new d
  7151. };
  7152. (function(b) {
  7153. var e = function(d) {
  7154. function a(a) {
  7155. d.call(this);
  7156. this.size = 2E3;
  7157. this.vertSize = 5;
  7158. this.contextLost = !1;
  7159. this.glContextId = 0;
  7160. this.currentBlendMode = "";
  7161. this.currentBaseTexture = null;
  7162. this.currentBatchSize = 0;
  7163. this.maskList = [];
  7164. this.maskDataFreeList = [];
  7165. this.canvasContext = document.createElement("canvas").getContext("2d");
  7166. console.log("使用WebGL模式");
  7167. this.canvas = a || this.createCanvas();
  7168. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7169. this.canvas.addEventListener("webglcontextrestored",
  7170. this.handleContextRestored.bind(this), !1);
  7171. this.onResize();
  7172. this.projectionX = this.canvas.width / 2;
  7173. this.projectionY = -this.canvas.height / 2;
  7174. a = 6 * this.size;
  7175. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7176. this.indices = new Uint16Array(a);
  7177. for (var e = 0, g = 0; e < a; e += 6, g += 4) this.indices[e + 0] = g + 0, this.indices[e + 1] = g + 1, this.indices[e + 2] = g + 2, this.indices[e + 3] = g + 0, this.indices[e + 4] = g + 2, this.indices[e + 5] = g + 3;
  7178. this.initWebGL();
  7179. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7180. this.worldTransform = new b.Matrix;
  7181. this.initBlendMode();
  7182. b.MainContext.instance.addEventListener(b.Event.FINISH_RENDER, this._draw, this);
  7183. b.TextField.prototype._draw = function(a) {
  7184. this.getDirty() && (this.cacheAsBitmap = !0);
  7185. b.DisplayObject.prototype._draw.call(this, a)
  7186. }
  7187. }
  7188. __extends(a, d);
  7189. a.prototype.createCanvas = function() {
  7190. var a = b.Browser.getInstance().$("#egretCanvas");
  7191. if (!a) {
  7192. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  7193. a = b.Browser.getInstance().$new("canvas");
  7194. a.id = "egretCanvas";
  7195. d.appendChild(a)
  7196. }
  7197. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE,
  7198. this.onResize, this);
  7199. return a
  7200. };
  7201. a.prototype.onResize = function() {
  7202. if (this.canvas) {
  7203. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7204. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  7205. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  7206. this.canvas.style.width = a.style.width;
  7207. this.canvas.style.height = a.style.height;
  7208. this.projectionX = this.canvas.width / 2;
  7209. this.projectionY = -this.canvas.height / 2
  7210. }
  7211. };
  7212. a.prototype.handleContextLost = function() {
  7213. this.contextLost = !0
  7214. };
  7215. a.prototype.handleContextRestored =
  7216. function() {
  7217. this.initWebGL();
  7218. this.shaderManager.setContext(this.gl);
  7219. this.contextLost = !1
  7220. };
  7221. a.prototype.initWebGL = function() {
  7222. for (var a = {
  7223. stencil: !0
  7224. }, b, d = ["experimental-webgl", "webgl"], e = 0; e < d.length; e++) {
  7225. try {
  7226. b = this.canvas.getContext(d[e], a)
  7227. } catch (h) {}
  7228. if (b) break
  7229. }
  7230. if (!b) throw Error("当前浏览器不支持webgl");
  7231. this.setContext(b)
  7232. };
  7233. a.prototype.setContext = function(a) {
  7234. this.gl = a;
  7235. a.id = this.glContextId++;
  7236. this.vertexBuffer = a.createBuffer();
  7237. this.indexBuffer = a.createBuffer();
  7238. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,
  7239. this.indexBuffer);
  7240. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7241. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7242. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7243. a.disable(a.DEPTH_TEST);
  7244. a.disable(a.CULL_FACE);
  7245. a.enable(a.BLEND);
  7246. a.colorMask(!0, !0, !0, !0)
  7247. };
  7248. a.prototype.initBlendMode = function() {
  7249. this.blendModesWebGL = {};
  7250. this.blendModesWebGL[b.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  7251. this.blendModesWebGL[b.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.ONE]
  7252. };
  7253. a.prototype.start =
  7254. function() {
  7255. if (!this.contextLost) {
  7256. var a = this.gl;
  7257. a.activeTexture(a.TEXTURE0);
  7258. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7259. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7260. var b;
  7261. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader : this.shaderManager.defaultShader;
  7262. this.shaderManager.activateShader(b);
  7263. b.syncUniforms();
  7264. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7265. var d = 4 * this.vertSize;
  7266. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, d, 0);
  7267. a.vertexAttribPointer(b.aTextureCoord,
  7268. 2, a.FLOAT, !1, d, 8);
  7269. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, d, 16)
  7270. }
  7271. };
  7272. a.prototype.clearScreen = function() {
  7273. var a = this.gl;
  7274. a.colorMask(!0, !0, !0, !0);
  7275. for (var d = b.RenderFilter.getInstance().getDrawAreaList(), e = 0, n = d.length; e < n; e++) {
  7276. var h = d[e];
  7277. a.viewport(h.x, h.y, h.width, h.height);
  7278. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7279. a.clearColor(0, 0, 0, 0);
  7280. a.clear(a.COLOR_BUFFER_BIT)
  7281. }
  7282. d = b.MainContext.instance.stage;
  7283. a.viewport(0, 0, d.stageWidth, d.stageHeight);
  7284. this.renderCost = 0
  7285. };
  7286. a.prototype.setBlendMode = function(a) {
  7287. a ||
  7288. (a = b.BlendMode.NORMAL);
  7289. if (this.currentBlendMode != a) {
  7290. var d = this.blendModesWebGL[a];
  7291. d && (this._draw(), this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = a)
  7292. }
  7293. };
  7294. a.prototype.drawRepeatImage = function(a, b, d, e, h, f, k, m, p, q) {
  7295. for (; f < m; f += e)
  7296. for (q = k; q < p; q += h) {
  7297. var r = Math.min(e, m - f),
  7298. s = Math.min(h, p - q);
  7299. this.drawImage(a, b, d, r, s, f, q, r, s)
  7300. }
  7301. };
  7302. a.prototype.drawImage = function(a, d, e, n, h, f, k, m, p, q) {
  7303. void 0 === q && (q = void 0);
  7304. if (!this.contextLost)
  7305. if (void 0 !== q) this.drawRepeatImage(a, d, e, n, h, f, k, m, p, q);
  7306. else {
  7307. q = b.MainContext.instance.rendererContext.texture_scale_factor;
  7308. d /= q;
  7309. e /= q;
  7310. n /= q;
  7311. h /= q;
  7312. this.createWebGLTexture(a);
  7313. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(), this.currentBaseTexture = a.webGLTexture;
  7314. var r = this.worldTransform,
  7315. s = r.a,
  7316. t = r.b,
  7317. u = r.c,
  7318. v = r.d,
  7319. x = r.tx,
  7320. y = r.ty;
  7321. 0 == f && 0 == k || r.append(1, 0, 0, 1, f, k);
  7322. 1 == n / m && 1 == h / p || r.append(m / n, 0, 0, p / h, 0, 0);
  7323. f = r.a;
  7324. k = r.b;
  7325. m = r.c;
  7326. p = r.d;
  7327. q = r.tx;
  7328. var w = r.ty;
  7329. r.a = s;
  7330. r.b = t;
  7331. r.c = u;
  7332. r.d = v;
  7333. r.tx = x;
  7334. r.ty = y;
  7335. s = a._sourceWidth;
  7336. t = a._sourceHeight;
  7337. a = n;
  7338. r = h;
  7339. d /= s;
  7340. e /= t;
  7341. n /= s;
  7342. h /= t;
  7343. s = this.vertices;
  7344. t = 4 * this.currentBatchSize *
  7345. this.vertSize;
  7346. u = this.worldAlpha;
  7347. s[t++] = q;
  7348. s[t++] = w;
  7349. s[t++] = d;
  7350. s[t++] = e;
  7351. s[t++] = u;
  7352. s[t++] = f * a + q;
  7353. s[t++] = k * a + w;
  7354. s[t++] = n + d;
  7355. s[t++] = e;
  7356. s[t++] = u;
  7357. s[t++] = f * a + m * r + q;
  7358. s[t++] = p * r + k * a + w;
  7359. s[t++] = n + d;
  7360. s[t++] = h + e;
  7361. s[t++] = u;
  7362. s[t++] = m * r + q;
  7363. s[t++] = p * r + w;
  7364. s[t++] = d;
  7365. s[t++] = h + e;
  7366. s[t++] = u;
  7367. this.currentBatchSize++
  7368. }
  7369. };
  7370. a.prototype._draw = function() {
  7371. if (0 != this.currentBatchSize && !this.contextLost) {
  7372. var a = b.getTimer();
  7373. this.start();
  7374. var d = this.gl;
  7375. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  7376. var e = this.vertices.subarray(0, 4 * this.currentBatchSize *
  7377. this.vertSize);
  7378. d.bufferSubData(d.ARRAY_BUFFER, 0, e);
  7379. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  7380. this.currentBatchSize = 0;
  7381. this.renderCost += b.getTimer() - a;
  7382. b.Profiler.getInstance().onDrawImage()
  7383. }
  7384. };
  7385. a.prototype.setTransform = function(a) {
  7386. var b = this.worldTransform;
  7387. b.a = a.a;
  7388. b.b = a.b;
  7389. b.c = a.c;
  7390. b.d = a.d;
  7391. b.tx = a.tx;
  7392. b.ty = a.ty
  7393. };
  7394. a.prototype.setAlpha = function(a, b) {
  7395. this.worldAlpha = a;
  7396. this.setBlendMode(b)
  7397. };
  7398. a.prototype.createWebGLTexture = function(a) {
  7399. if (!a.webGLTexture) {
  7400. var b = this.gl;
  7401. a.webGLTexture =
  7402. b.createTexture();
  7403. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  7404. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7405. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  7406. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7407. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7408. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7409. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7410. b.bindTexture(b.TEXTURE_2D, null)
  7411. }
  7412. };
  7413. a.prototype.pushMask = function(a) {
  7414. this._draw();
  7415. var b = this.gl;
  7416. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  7417. var d = this.maskDataFreeList.pop();
  7418. d ? (d.x = a.x, d.y = a.y, d.w = a.width, d.h = a.height) : d = {
  7419. x: a.x,
  7420. y: a.y,
  7421. w: a.width,
  7422. h: a.height
  7423. };
  7424. this.maskList.push(d);
  7425. b.colorMask(!1, !1, !1, !1);
  7426. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  7427. this.renderGraphics(d);
  7428. b.colorMask(!0, !0, !0, !0);
  7429. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  7430. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  7431. };
  7432. a.prototype.popMask = function() {
  7433. this._draw();
  7434. var a = this.gl,
  7435. b = this.maskList.pop();
  7436. b && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(b), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(b));
  7437. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  7438. };
  7439. a.prototype.setGlobalColorTransform = function(a) {
  7440. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7441. a = a.concat();
  7442. var b = this.shaderManager.colorTransformShader;
  7443. b.uniforms.colorAdd.value.w = a.splice(19,
  7444. 1)[0] / 255;
  7445. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7446. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7447. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7448. b.uniforms.matrix.value = a
  7449. }
  7450. };
  7451. a.prototype.setupFont = function(a, b) {
  7452. var d = this.canvasContext,
  7453. e = a.italic ? "italic " : "normal ",
  7454. e = e + (a.bold ? "bold " : "normal "),
  7455. e = e + (a.size + "px " + a.fontFamily);
  7456. d.font = e;
  7457. d.textAlign = "left";
  7458. d.textBaseline = "middle"
  7459. };
  7460. a.prototype.measureText = function(a) {
  7461. return this.canvasContext.measureText(a).width
  7462. };
  7463. a.prototype.renderGraphics =
  7464. function(a) {
  7465. var b = this.gl,
  7466. d = this.shaderManager.primitiveShader;
  7467. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7468. this.updateGraphics(a);
  7469. this.shaderManager.activateShader(d);
  7470. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7471. b.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  7472. b.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  7473. b.uniform2f(d.offsetVector, 0, 0);
  7474. b.uniform3fv(d.tintColor, [1, 1, 1]);
  7475. b.uniform1f(d.alpha, this.worldAlpha);
  7476. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7477. b.vertexAttribPointer(d.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7478. b.vertexAttribPointer(d.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7479. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7480. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7481. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7482. };
  7483. a.prototype.updateGraphics =
  7484. function(a) {
  7485. var b = this.gl;
  7486. this.buildRectangle(a);
  7487. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7488. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7489. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7490. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7491. };
  7492. a.prototype.buildRectangle = function(a) {
  7493. var b = a.x,
  7494. d = a.y,
  7495. e = a.w;
  7496. a = a.h;
  7497. var h = this.graphicsPoints,
  7498. f = this.graphicsIndices,
  7499. k = h.length / 6;
  7500. h.push(b, d);
  7501. h.push(0, 0, 0, 1);
  7502. h.push(b + e, d);
  7503. h.push(0, 0, 0, 1);
  7504. h.push(b, d + a);
  7505. h.push(0, 0, 0, 1);
  7506. h.push(b + e, d + a);
  7507. h.push(0, 0, 0, 1);
  7508. f.push(k, k, k + 1, k + 2, k + 3, k + 3)
  7509. };
  7510. return a
  7511. }(b.RendererContext);
  7512. b.WebGLRenderer = e;
  7513. e.prototype.__class__ = "egret.WebGLRenderer"
  7514. })(egret || (egret = {}));
  7515. (function(b) {
  7516. var e = function() {
  7517. function b() {}
  7518. b.compileProgram = function(a, c, e) {
  7519. e = b.compileFragmentShader(a, e);
  7520. c = b.compileVertexShader(a, c);
  7521. var g = a.createProgram();
  7522. a.attachShader(g, c);
  7523. a.attachShader(g, e);
  7524. a.linkProgram(g);
  7525. a.getProgramParameter(g, a.LINK_STATUS) || console.log("无法初始化着色器");
  7526. return g
  7527. };
  7528. b.compileFragmentShader = function(a, c) {
  7529. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  7530. };
  7531. b.compileVertexShader = function(a, c) {
  7532. return b._compileShader(a, c, a.VERTEX_SHADER)
  7533. };
  7534. b._compileShader =
  7535. function(a, b, d) {
  7536. d = a.createShader(d);
  7537. a.shaderSource(d, b);
  7538. a.compileShader(d);
  7539. return a.getShaderParameter(d, a.COMPILE_STATUS) ? d : (console.log(a.getShaderInfoLog(d)), null)
  7540. };
  7541. b.checkCanUseWebGL = function() {
  7542. if (void 0 == b.canUseWebGL) try {
  7543. var a = document.createElement("canvas");
  7544. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7545. } catch (c) {
  7546. b.canUseWebGL = !1
  7547. }
  7548. return b.canUseWebGL
  7549. };
  7550. return b
  7551. }();
  7552. b.WebGLUtils = e;
  7553. e.prototype.__class__ = "egret.WebGLUtils"
  7554. })(egret || (egret = {}));
  7555. __extends = this.__extends || function(b, e) {
  7556. function d() {
  7557. this.constructor = b
  7558. }
  7559. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  7560. d.prototype = e.prototype;
  7561. b.prototype = new d
  7562. };
  7563. (function(b) {
  7564. var e = function() {
  7565. function b(a) {
  7566. this.maxAttibs = 10;
  7567. this.attribState = [];
  7568. this.tempAttribState = [];
  7569. for (var c = 0; c < this.maxAttibs; c++) this.attribState[c] = !1;
  7570. this.setContext(a)
  7571. }
  7572. b.prototype.setContext = function(b) {
  7573. this.gl = b;
  7574. this.primitiveShader = new c(b);
  7575. this.defaultShader = new d(b);
  7576. this.colorTransformShader = new a(b);
  7577. this.activateShader(this.defaultShader)
  7578. };
  7579. b.prototype.activateShader = function(a) {
  7580. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader =
  7581. a)
  7582. };
  7583. b.prototype.setAttribs = function(a) {
  7584. var b, c;
  7585. c = this.tempAttribState.length;
  7586. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  7587. c = a.length;
  7588. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  7589. a = this.gl;
  7590. c = this.attribState.length;
  7591. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  7592. };
  7593. return b
  7594. }();
  7595. b.WebGLShaderManager = e;
  7596. e.prototype.__class__ = "egret.WebGLShaderManager";
  7597. var d = function() {
  7598. function a(b) {
  7599. this.defaultVertexSrc =
  7600. "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}";
  7601. this.program = null;
  7602. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7603. this.gl = b;
  7604. this.init()
  7605. }
  7606. a.prototype.init = function() {
  7607. var a = this.gl,
  7608. c = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7609. a.useProgram(c);
  7610. this.uSampler = a.getUniformLocation(c, "uSampler");
  7611. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7612. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7613. this.dimensions = a.getUniformLocation(c, "dimensions");
  7614. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7615. this.aTextureCoord = a.getAttribLocation(c, "aTextureCoord");
  7616. this.colorAttribute =
  7617. a.getAttribLocation(c, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7618. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7619. for (var d in this.uniforms) this.uniforms[d].uniformLocation = a.getUniformLocation(c, d);
  7620. this.initUniforms();
  7621. this.program = c
  7622. };
  7623. a.prototype.initUniforms = function() {
  7624. if (this.uniforms) {
  7625. var a = this.gl,
  7626. b, c;
  7627. for (c in this.uniforms) {
  7628. b = this.uniforms[c];
  7629. var d = b.type;
  7630. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv :
  7631. "mat3" === d ? b.glFunc = a.uniformMatrix3fv : "mat4" === d && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + d], b.glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1)
  7632. }
  7633. }
  7634. };
  7635. a.prototype.syncUniforms = function() {
  7636. if (this.uniforms) {
  7637. var a, b = this.gl,
  7638. c;
  7639. for (c in this.uniforms) a = this.uniforms[c], 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x,
  7640. a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  7641. }
  7642. };
  7643. return a
  7644. }();
  7645. b.EgretShader = d;
  7646. d.prototype.__class__ = "egret.EgretShader";
  7647. var a = function(a) {
  7648. function b(c) {
  7649. a.call(this, c);
  7650. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  7651. this.uniforms = {
  7652. matrix: {
  7653. type: "mat4",
  7654. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7655. },
  7656. colorAdd: {
  7657. type: "4f",
  7658. value: {
  7659. x: 0,
  7660. y: 0,
  7661. z: 0,
  7662. w: 0
  7663. }
  7664. }
  7665. };
  7666. this.init()
  7667. }
  7668. __extends(b, a);
  7669. return b
  7670. }(d);
  7671. b.ColorTransformShader = a;
  7672. a.prototype.__class__ = "egret.ColorTransformShader";
  7673. var c = function() {
  7674. function a(b) {
  7675. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  7676. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7677. 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}";
  7678. this.gl = b;
  7679. this.init()
  7680. }
  7681. a.prototype.init = function() {
  7682. var a = this.gl,
  7683. c = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7684. a.useProgram(c);
  7685. this.projectionVector = a.getUniformLocation(c, "projectionVector");
  7686. this.offsetVector = a.getUniformLocation(c, "offsetVector");
  7687. this.tintColor = a.getUniformLocation(c, "tint");
  7688. this.aVertexPosition = a.getAttribLocation(c, "aVertexPosition");
  7689. this.colorAttribute = a.getAttribLocation(c, "aColor");
  7690. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7691. this.translationMatrix = a.getUniformLocation(c,
  7692. "translationMatrix");
  7693. this.alpha = a.getUniformLocation(c, "alpha");
  7694. this.program = c
  7695. };
  7696. return a
  7697. }();
  7698. b.PrimitiveShader = c;
  7699. c.prototype.__class__ = "egret.PrimitiveShader"
  7700. })(egret || (egret = {}));
  7701. __extends = this.__extends || function(b, e) {
  7702. function d() {
  7703. this.constructor = b
  7704. }
  7705. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  7706. d.prototype = e.prototype;
  7707. b.prototype = new d
  7708. };
  7709. (function(b) {
  7710. var e = function(d) {
  7711. function a() {
  7712. d.call(this)
  7713. }
  7714. __extends(a, d);
  7715. a.prototype.proceed = function(a) {
  7716. function d() {
  7717. if (4 == n.readyState)
  7718. if (n.status != a._status && (a._status = n.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, n.status)), 400 <= n.status || 0 == n.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7719. else {
  7720. switch (a.dataFormat) {
  7721. case b.URLLoaderDataFormat.TEXT:
  7722. a.data = n.responseText;
  7723. break;
  7724. case b.URLLoaderDataFormat.VARIABLES:
  7725. a.data = new b.URLVariables(n.responseText);
  7726. break;
  7727. case b.URLLoaderDataFormat.BINARY:
  7728. a.data =
  7729. n.response;
  7730. break;
  7731. default:
  7732. a.data = n.responseText
  7733. }
  7734. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7735. }
  7736. }
  7737. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7738. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7739. else {
  7740. var e = a._request,
  7741. n = this.getXHR();
  7742. n.onreadystatechange = d;
  7743. var h = b.NetContext._getUrl(e);
  7744. n.open(e.method, h, !0);
  7745. this.setResponseType(n, a.dataFormat);
  7746. e.method != b.URLRequestMethod.GET && e.data ? e.data instanceof b.URLVariables ? (n.setRequestHeader("Content-Type",
  7747. "application/x-www-form-urlencoded"), n.send(e.data.toString())) : (n.setRequestHeader("Content-Type", "multipart/form-data"), n.send(e.data)) : n.send()
  7748. }
  7749. };
  7750. a.prototype.loadSound = function(a) {
  7751. function d(h) {
  7752. window.clearTimeout(n.__timeoutId);
  7753. n.removeEventListener("canplaythrough", d, !1);
  7754. n.removeEventListener("error", e, !1);
  7755. h = new b.Sound;
  7756. h._setAudio(n);
  7757. a.data = h;
  7758. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7759. }
  7760. function e(h) {
  7761. window.clearTimeout(n.__timeoutId);
  7762. n.removeEventListener("canplaythrough",
  7763. d, !1);
  7764. n.removeEventListener("error", e, !1);
  7765. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7766. }
  7767. var n = new Audio(a._request.url);
  7768. n.__timeoutId = window.setTimeout(d, 100);
  7769. n.addEventListener("canplaythrough", d, !1);
  7770. n.addEventListener("error", e, !1);
  7771. n.load()
  7772. };
  7773. a.prototype.getXHR = function() {
  7774. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  7775. };
  7776. a.prototype.setResponseType = function(a, d) {
  7777. switch (d) {
  7778. case b.URLLoaderDataFormat.TEXT:
  7779. case b.URLLoaderDataFormat.VARIABLES:
  7780. a.responseType = b.URLLoaderDataFormat.TEXT;
  7781. break;
  7782. case b.URLLoaderDataFormat.BINARY:
  7783. a.responseType = "arraybuffer";
  7784. break;
  7785. default:
  7786. a.responseType = d
  7787. }
  7788. };
  7789. a.prototype.loadTexture = function(a) {
  7790. var d = a._request,
  7791. e = new Image;
  7792. e.onload = function(d) {
  7793. e.onerror = null;
  7794. e.onload = null;
  7795. d = new b.Texture;
  7796. d._setBitmapData(e);
  7797. a.data = d;
  7798. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7799. };
  7800. e.onerror = function(d) {
  7801. e.onerror = null;
  7802. e.onload = null;
  7803. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7804. };
  7805. e.src = d.url
  7806. };
  7807. return a
  7808. }(b.NetContext);
  7809. b.HTML5NetContext = e;
  7810. e.prototype.__class__ = "egret.HTML5NetContext"
  7811. })(egret ||
  7812. (egret = {}));
  7813. __extends = this.__extends || function(b, e) {
  7814. function d() {
  7815. this.constructor = b
  7816. }
  7817. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  7818. d.prototype = e.prototype;
  7819. b.prototype = new d
  7820. };
  7821. (function(b) {
  7822. var e = function(d) {
  7823. function a() {
  7824. d.call(this);
  7825. this._isTouchDown = !1;
  7826. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7827. }
  7828. __extends(a, d);
  7829. a.prototype.prevent = function(a) {
  7830. a.stopPropagation();
  7831. !0 != a.isScroll && a.preventDefault()
  7832. };
  7833. a.prototype.run = function() {
  7834. var a = this;
  7835. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown", function(b) {
  7836. a._onTouchBegin(b);
  7837. a.prevent(b)
  7838. }, !1), this.rootDiv.addEventListener("MSPointerMove", function(b) {
  7839. a._onTouchMove(b);
  7840. a.prevent(b)
  7841. }, !1), this.rootDiv.addEventListener("MSPointerUp", function(b) {
  7842. a._onTouchEnd(b);
  7843. a.prevent(b)
  7844. }, !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7845. window.addEventListener("mousedown", function(b) {
  7846. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7847. });
  7848. window.addEventListener("mouseup", function(b) {
  7849. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7850. a._isTouchDown = !1
  7851. })
  7852. };
  7853. a.prototype.addMouseListener = function() {
  7854. var a = this;
  7855. this.rootDiv.addEventListener("mousedown", function(b) {
  7856. a._onTouchBegin(b)
  7857. });
  7858. this.rootDiv.addEventListener("mousemove", function(b) {
  7859. a._onTouchMove(b)
  7860. });
  7861. this.rootDiv.addEventListener("mouseup", function(b) {
  7862. a._onTouchEnd(b)
  7863. })
  7864. };
  7865. a.prototype.addTouchListener = function() {
  7866. var a = this;
  7867. this.rootDiv.addEventListener("touchstart", function(b) {
  7868. for (var d = b.changedTouches.length, e = 0; e < d; e++) a._onTouchBegin(b.changedTouches[e]);
  7869. a.prevent(b)
  7870. }, !1);
  7871. this.rootDiv.addEventListener("touchmove",
  7872. function(b) {
  7873. for (var d = b.changedTouches.length, e = 0; e < d; e++) a._onTouchMove(b.changedTouches[e]);
  7874. a.prevent(b)
  7875. }, !1);
  7876. this.rootDiv.addEventListener("touchend", function(b) {
  7877. for (var d = b.changedTouches.length, e = 0; e < d; e++) a._onTouchEnd(b.changedTouches[e]);
  7878. a.prevent(b)
  7879. }, !1);
  7880. this.rootDiv.addEventListener("touchcancel", function(b) {
  7881. for (var d = b.changedTouches.length, e = 0; e < d; e++) a._onTouchEnd(b.changedTouches[e]);
  7882. a.prevent(b)
  7883. }, !1)
  7884. };
  7885. a.prototype.inOutOfCanvas = function(a) {
  7886. var d = this.getLocation(this.rootDiv, a);
  7887. a = d.x;
  7888. var d = d.y,
  7889. e = b.MainContext.instance.stage;
  7890. return 0 > a || 0 > d || a > e.stageWidth || d > e.stageHeight ? !0 : !1
  7891. };
  7892. a.prototype.dispatchLeaveStageEvent = function() {
  7893. this.touchingIdentifiers.length = 0;
  7894. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  7895. };
  7896. a.prototype._onTouchBegin = function(a) {
  7897. var b = this.getLocation(this.rootDiv, a),
  7898. d = -1;
  7899. a.hasOwnProperty("identifier") && (d = a.identifier);
  7900. this.onTouchBegan(b.x, b.y, d)
  7901. };
  7902. a.prototype._onTouchMove = function(a) {
  7903. var b = this.getLocation(this.rootDiv, a),
  7904. d = -1;
  7905. a.hasOwnProperty("identifier") &&
  7906. (d = a.identifier);
  7907. this.onTouchMove(b.x, b.y, d)
  7908. };
  7909. a.prototype._onTouchEnd = function(a) {
  7910. var b = this.getLocation(this.rootDiv, a),
  7911. d = -1;
  7912. a.hasOwnProperty("identifier") && (d = a.identifier);
  7913. this.onTouchEnd(b.x, b.y, d)
  7914. };
  7915. a.prototype.getLocation = function(a, d) {
  7916. var e = document.documentElement,
  7917. n = window,
  7918. h, f;
  7919. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), h = f.left, f = f.top) : f = h = 0;
  7920. h += n.pageXOffset - e.clientLeft;
  7921. f += n.pageYOffset - e.clientTop;
  7922. null != d.pageX ? (e = d.pageX, n = d.pageY) : (h -= document.body.scrollLeft,
  7923. f -= document.body.scrollTop, e = d.clientX, n = d.clientY);
  7924. var k = b.Point.identity;
  7925. k.x = (e - h) / b.StageDelegate.getInstance().getScaleX();
  7926. k.y = (n - f) / b.StageDelegate.getInstance().getScaleY();
  7927. return k
  7928. };
  7929. return a
  7930. }(b.TouchContext);
  7931. b.HTML5TouchContext = e;
  7932. e.prototype.__class__ = "egret.HTML5TouchContext"
  7933. })(egret || (egret = {}));
  7934. __extends = this.__extends || function(b, e) {
  7935. function d() {
  7936. this.constructor = b
  7937. }
  7938. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  7939. d.prototype = e.prototype;
  7940. b.prototype = new d
  7941. };
  7942. (function(b) {
  7943. var e = function(d) {
  7944. function a() {
  7945. d.call(this);
  7946. this._hasListeners = !1;
  7947. this._inputType = "";
  7948. this._isShow = !1;
  7949. this.textValue = "";
  7950. this._height = this._width = 0;
  7951. this._styleInfoes = {};
  7952. var a = b.StageDelegate.getInstance().getScaleX(),
  7953. e = b.StageDelegate.getInstance().getScaleY(),
  7954. g = b.Browser.getInstance().$new("div");
  7955. g.position.x = 0;
  7956. g.position.y = 0;
  7957. g.scale.x = a;
  7958. g.scale.y = e;
  7959. g.transforms();
  7960. g.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  7961. this.div = g;
  7962. e = b.MainContext.instance.stage;
  7963. a = e.stageWidth;
  7964. e = e.stageHeight;
  7965. g = new b.Shape;
  7966. g.width = a;
  7967. g.height = e;
  7968. g.touchEnabled = !0;
  7969. this._shape = g;
  7970. this.getStageDelegateDiv().appendChild(this.div)
  7971. }
  7972. __extends(a, d);
  7973. a.prototype.getStageDelegateDiv = function() {
  7974. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  7975. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  7976. return a
  7977. };
  7978. a.prototype._setMultiline = function(a) {
  7979. d.prototype._setMultiline.call(this, a);
  7980. this.createInput()
  7981. };
  7982. a.prototype.callHandler =
  7983. function(a) {
  7984. a.stopPropagation()
  7985. };
  7986. a.prototype._add = function() {
  7987. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  7988. };
  7989. a.prototype._remove = function() {
  7990. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  7991. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  7992. };
  7993. a.prototype._addListeners = function() {
  7994. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart",
  7995. this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  7996. };
  7997. a.prototype._removeListeners = function() {
  7998. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  7999. };
  8000. a.prototype.createInput = function() {
  8001. var a = this._multiline ? "textarea" : "input";
  8002. this._inputType != a && (this._inputType =
  8003. a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign",
  8004. "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8005. };
  8006. a.prototype._open = function(a, b, d, e) {};
  8007. a.prototype._setScale = function(a, e) {
  8008. d.prototype._setScale.call(this, a, e);
  8009. var g = b.StageDelegate.getInstance().getScaleX(),
  8010. n = b.StageDelegate.getInstance().getScaleY();
  8011. this.div.scale.x = g * a;
  8012. this.div.scale.y = n * e;
  8013. this.div.transforms()
  8014. };
  8015. a.prototype.changePosition = function(a, d) {
  8016. var e = b.StageDelegate.getInstance().getScaleX(),
  8017. n = b.StageDelegate.getInstance().getScaleY();
  8018. this.div.position.x =
  8019. a * e;
  8020. this.div.position.y = d * n;
  8021. this.div.transforms()
  8022. };
  8023. a.prototype.setStyles = function() {
  8024. this.setElementStyle("fontStyle", this._italic ? "italic" : "normal");
  8025. this.setElementStyle("fontWeight", this._bold ? "bold" : "normal");
  8026. this.setElementStyle("textAlign", this._textAlign);
  8027. this.setElementStyle("fontSize", this._size + "px");
  8028. this.setElementStyle("color", "#000000");
  8029. this.setElementStyle("width", this._width + "px");
  8030. this.setElementStyle("height", this._height + "px");
  8031. this.setElementStyle("border", "1px solid red");
  8032. this.setElementStyle("display",
  8033. "block")
  8034. };
  8035. a.prototype._show = function() {
  8036. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8037. this._isShow = !0;
  8038. var a = this._getText();
  8039. this.inputElement.value = a;
  8040. var d = this;
  8041. this.inputElement.oninput = function() {
  8042. d.textValue = d.inputElement.value;
  8043. d.dispatchEvent(new b.Event("updateText"))
  8044. };
  8045. this.setStyles();
  8046. this.inputElement.focus();
  8047. this.inputElement.selectionStart = a.length;
  8048. this.inputElement.selectionEnd = a.length;
  8049. this._shape && null == this._shape.parent &&
  8050. b.MainContext.instance.stage.addChild(this._shape)
  8051. };
  8052. a.prototype._hide = function() {
  8053. if (null != this.inputElement) {
  8054. this._isShow = !1;
  8055. this.inputElement.oninput = function() {};
  8056. this.setElementStyle("border", "none");
  8057. this.setElementStyle("display", "none");
  8058. this.inputElement.value = "";
  8059. this.setElementStyle("width", "0px");
  8060. window.scrollTo(0, 0);
  8061. var a = this;
  8062. b.setTimeout(function() {
  8063. a.inputElement.blur();
  8064. window.scrollTo(0, 0)
  8065. }, this, 50);
  8066. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8067. }
  8068. };
  8069. a.prototype._getText =
  8070. function() {
  8071. this.textValue || (this.textValue = "");
  8072. return this.textValue
  8073. };
  8074. a.prototype._setText = function(a) {
  8075. this.textValue = a;
  8076. this.resetText()
  8077. };
  8078. a.prototype.resetText = function() {
  8079. this.inputElement && (this.inputElement.value = this.textValue)
  8080. };
  8081. a.prototype._setWidth = function(a) {
  8082. this._width = a
  8083. };
  8084. a.prototype._setHeight = function(a) {
  8085. this._height = a
  8086. };
  8087. a.prototype.setElementStyle = function(a, b) {
  8088. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8089. };
  8090. return a
  8091. }(b.StageText);
  8092. b.HTML5StageText =
  8093. e;
  8094. e.prototype.__class__ = "egret.HTML5StageText"
  8095. })(egret || (egret = {}));
  8096. egret.StageText.create = function() {
  8097. return new egret.HTML5StageText
  8098. };
  8099. var __extends = this.__extends || function(b, e) {
  8100. function d() {
  8101. this.constructor = b
  8102. }
  8103. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8104. d.prototype = e.prototype;
  8105. b.prototype = new d
  8106. },
  8107. Hero = function(b) {
  8108. function e(d, a, c) {
  8109. b.call(this);
  8110. this.lastX = this.x = d;
  8111. this.lastY = this.y = a;
  8112. this.anchorX = 0.5;
  8113. this.anchorY = 0.7;
  8114. this.role = c;
  8115. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8116. }
  8117. __extends(e, b);
  8118. e.prototype.onAddToStage = function(b) {
  8119. this.runner_stand = new egret.Bitmap;
  8120. this.runner_stand.texture = RES.getRes("runner_stand");
  8121. this.addChild(this.runner_stand);
  8122. var a;
  8123. this.role && (b = RES.getRes("runner_json"), a = RES.getRes("runner_png"), this.runner_run = new egret.MovieClip(new egret.DefaultMovieClipDelegate(b, a)), this.addChild(this.runner_run), this.runner_run.frameRate = 25, this.runner_run.gotoAndPlay("santa_run"), this.hitRect = new egret.Rectangle(this.x - 10, this.y - 10, 60, 90))
  8124. };
  8125. e.prototype.stand = function() {
  8126. this.runner_stand.visible = !0;
  8127. this.runner_run.visible = !1
  8128. };
  8129. e.prototype.run = function() {
  8130. this.runner_stand.visible = !1;
  8131. this.runner_run.visible = !0
  8132. };
  8133. e.prototype.enterFrame = function(b, a) {
  8134. this.x = this.lastX;
  8135. this.y = this.lastY;
  8136. this.isdragging && (this.x = b < this.width / 2 || 0 >= b ? 70 : b >= this.stage.stageWidth ? this.lastX : b + this.width / 2 > this.stage.stageWidth ? this.stage.stageWidth - 70 : b, this.y = 0 > a - 0.7 * this.height || 0 >= a ? 0.7 * this.height : a >= this.stage.stageHeight ? this.lastY : a, this.lastX = this.x, this.lastY = this.y, this.hitRect.x = this.x + 20, this.hitRect.y = this.y + 30)
  8137. };
  8138. return e
  8139. }(egret.DisplayObjectContainer);
  8140. Hero.prototype.__class__ = "Hero";
  8141. var __extends = this.__extends || function(b, e) {
  8142. function d() {
  8143. this.constructor = b
  8144. }
  8145. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8146. d.prototype = e.prototype;
  8147. b.prototype = new d
  8148. },
  8149. LoadingUI = function(b) {
  8150. function e() {
  8151. b.call(this);
  8152. this.createView()
  8153. }
  8154. __extends(e, b);
  8155. e.prototype.createView = function() {
  8156. this.textField = new egret.TextField;
  8157. this.addChild(this.textField);
  8158. this.textField.y = 200;
  8159. this.textField.width = 480;
  8160. this.textField.height = 100;
  8161. this.textField.textAlign = "center"
  8162. };
  8163. e.prototype.setProgress = function(b, a) {
  8164. this.textField.text =
  8165. "表偷看,等伦家脱衣服..." + Math.floor(b / a * 100) + "/100"
  8166. };
  8167. return e
  8168. }(egret.Sprite);
  8169. LoadingUI.prototype.__class__ = "LoadingUI";
  8170. var __extends = this.__extends || function(b, e) {
  8171. function d() {
  8172. this.constructor = b
  8173. }
  8174. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8175. d.prototype = e.prototype;
  8176. b.prototype = new d
  8177. },
  8178. ResultPanel = function(b) {
  8179. function e() {
  8180. b.call(this);
  8181. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8182. }
  8183. __extends(e, b);
  8184. e.prototype.onAddToStage = function(b) {
  8185. this.bgResult1 = new egret.Bitmap;
  8186. b = Main.instance.role ? RES.getRes("bgResult1") : RES.getRes("bgResult2");
  8187. this.bgResult1.texture = b;
  8188. this.bgResult1.parent && this.removeChild(this.bgResult1);
  8189. this.tap_textfeild = new egret.TextField;
  8190. this.tap_textfeild.width = 400;
  8191. this.tap_textfeild.anchorX = 0.5;
  8192. this.tap_textfeild.textColor = 3368448;
  8193. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  8194. this.tap_textfeild.text = "您坚持了1秒没被抓到!";
  8195. this.tap_textfeild.size = 26;
  8196. this.tap_textfeild.stroke = 2;
  8197. this.tap_textfeild.strokeColor = 13421772;
  8198. this.tap_textfeild.x = this.stage.stageWidth / 2;
  8199. this.tap_textfeild.y = this.bgResult1.height - 145;
  8200. this.rank_textfeild = new egret.TextField;
  8201. this.rank_textfeild.width = 400;
  8202. this.rank_textfeild.anchorX = 0.5;
  8203. this.rank_textfeild.textColor = 16750848;
  8204. this.rank_textfeild.stroke = 2;
  8205. this.rank_textfeild.strokeColor = 13421772;
  8206. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  8207. this.rank_textfeild.text = "全国排名200000位";
  8208. this.rank_textfeild.size = 26;
  8209. this.rank_textfeild.x = this.stage.stageWidth / 2;
  8210. this.rank_textfeild.y = this.bgResult1.height - 110;
  8211. this.beat_textfeild = new egret.TextField;
  8212. this.beat_textfeild.width = 400;
  8213. this.beat_textfeild.anchorX =
  8214. 0.5;
  8215. this.beat_textfeild.textColor = 12517376;
  8216. this.beat_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  8217. this.beat_textfeild.size = 26;
  8218. this.beat_textfeild.stroke = 2;
  8219. this.beat_textfeild.strokeColor = 13421772;
  8220. this.beat_textfeild.text = "击败了全国30%的裸奔爱好者";
  8221. this.beat_textfeild.x = this.stage.stageWidth / 2;
  8222. this.beat_textfeild.y = this.bgResult1.height - 75;
  8223. this.btn_share = this.createBitmapByName("btnShare");
  8224. this.btn_share.anchorX = this.btn_share.anchorY = 0.5;
  8225. this.btn_share.x =
  8226. 70 + this.btn_share.width / 2;
  8227. this.btn_share.y = this.bgResult1.height + this.btn_share.height / 2;
  8228. this.btn_share.touchEnabled = !0;
  8229. this.btn_share.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doButtonShare, this);
  8230. this.btn_share.addEventListener(egret.TouchEvent.TOUCH_END, this.doShare, this);
  8231. this.btn_share.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.doButtonShareCancel, this);
  8232. this.btn_again = this.createBitmapByName("btnAgain");
  8233. this.btn_again.anchorX = this.btn_again.anchorY = 0.5;
  8234. this.btn_again.x =
  8235. 250 + this.btn_again.width / 2;
  8236. this.btn_again.y = this.bgResult1.height + this.btn_again.height / 2;
  8237. this.btn_again.touchEnabled = !0;
  8238. this.btn_again.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doButtonAgain, this);
  8239. this.btn_again.addEventListener(egret.TouchEvent.TOUCH_END, this.doAgain, this);
  8240. this.btn_again.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.doButtonAgainCancel, this);
  8241. this.btn_more = this.createBitmapByName("btnMore");
  8242. this.btn_more.anchorX = 0.5;
  8243. this.btn_more.x = this.bgResult1.width - 80;
  8244. this.btn_more.y = this.bgResult1.y;
  8245. this.btn_more.touchEnabled = !0;
  8246. this.btn_more.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doMore, this);
  8247. this.addChild(this.bgResult1);
  8248. this.addChild(this.tap_textfeild);
  8249. this.addChild(this.rank_textfeild);
  8250. this.addChild(this.beat_textfeild);
  8251. this.addChild(this.btn_share);
  8252. this.addChild(this.btn_again);
  8253. this.addChild(this.btn_more)
  8254. };
  8255. e.prototype.score = function() {
  8256. var b = Main.instance.timeCount / 10;
  8257. this.tap_textfeild.text = "您坚持了" + b + "秒没被抓到!";
  8258. this.rank_textfeild.text = "全国排名" + Math.floor(3E6 - b * Math.random() * 5E4) + "位";
  8259. Main.instance.percent = Math.floor(20 * Math.random() + 2 * b);
  8260. this.beat_textfeild.text = "击败了全国" + Main.instance.percent + "%的脱光狂人"
  8261. };
  8262. e.prototype.createBitmapByName = function(b) {
  8263. var a = new egret.Bitmap;
  8264. b = RES.getRes(b);
  8265. a.texture = b;
  8266. return a
  8267. };
  8268. e.prototype.doButtonShare = function(b) {
  8269. ih5game.share();
  8270. };
  8271. e.prototype.doButtonShareCancel = function(b) {};
  8272. e.prototype.doShare = function(b) {
  8273. ih5game.share();
  8274. this.dispatchEventWith("shareEvent")
  8275. };
  8276. e.prototype.doButtonAgain = function(b) {
  8277. this.btn_again.scaleX = this.btn_again.scaleY = 1.1
  8278. };
  8279. e.prototype.doButtonAgainCancel = function(b) {
  8280. this.btn_again.scaleX = this.btn_again.scaleY = 1
  8281. };
  8282. e.prototype.doAgain = function(b) {
  8283. this.btn_again.scaleX = this.btn_again.scaleY = 1;
  8284. this.dispatchEventWith("againEvent")
  8285. };
  8286. e.prototype.doMore = function(b) {
  8287. location.href = "http://mp.weixin.qq.com/s?__biz=MjM5NjgwMjAzOQ==&mid=202489017&idx=1&sn=a79bc6a9770fcd25995c03c3b25fba9f#rd";
  8288. };
  8289. return e
  8290. }(egret.DisplayObjectContainer);
  8291. ResultPanel.prototype.__class__ = "ResultPanel";
  8292. var __extends = this.__extends || function(b, e) {
  8293. function d() {
  8294. this.constructor = b
  8295. }
  8296. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8297. d.prototype = e.prototype;
  8298. b.prototype = new d
  8299. },
  8300. SharePanel = function(b) {
  8301. function e() {
  8302. b.call(this);
  8303. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8304. }
  8305. __extends(e, b);
  8306. e.prototype.onAddToStage = function(b) {
  8307. this.topMask = new egret.Shape;
  8308. this.topMask.graphics.beginFill(0, 0.8);
  8309. this.topMask.graphics.drawRect(0, 0, this.stage.stageWidth, this.stage.stageHeight);
  8310. this.topMask.graphics.endFill();
  8311. this.topMask.width = this.stage.stageWidth;
  8312. this.topMask.height = this.stage.stageHeight;
  8313. this.logoShare = this.createBitmapByName("logoShare");
  8314. this.logoShare.x = this.topMask.width - this.logoShare.width - 10;
  8315. this.logoShare.y = 10;
  8316. this.intro_textfield = new egret.TextField;
  8317. this.intro_textfield.width = 480;
  8318. this.intro_textfield.anchorX = 0.5;
  8319. this.intro_textfield.textColor = 16777215;
  8320. this.intro_textfield.textAlign = egret.HorizontalAlign.CENTER;
  8321. this.intro_textfield.text = "想玩更多,快去公众号关注‘游戏入口’";
  8322. this.intro_textfield.size = 25;
  8323. this.intro_textfield.x = this.stage.stageWidth / 2;
  8324. this.intro_textfield.y = (this.stage.stageHeight - this.intro_textfield.height) / 2; /*this.addChild(this.topMask);this.addChild(this.logoShare);this.addChild(this.intro_textfield);*/
  8325. this.touchEnabled = !0;
  8326. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doClose, this)
  8327. };
  8328. e.prototype.doClose = function(b) {
  8329. this.dispatchEventWith("closeEvent")
  8330. };
  8331. e.prototype.createBitmapByName = function(b) {
  8332. var a = new egret.Bitmap;
  8333. b = RES.getRes(b);
  8334. a.texture = b;
  8335. return a
  8336. };
  8337. return e
  8338. }(egret.DisplayObjectContainer);
  8339. SharePanel.prototype.__class__ = "SharePanel";
  8340. var __extends = this.__extends || function(b, e) {
  8341. function d() {
  8342. this.constructor = b
  8343. }
  8344. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8345. d.prototype = e.prototype;
  8346. b.prototype = new d
  8347. },
  8348. WelcomePanel = function(b) {
  8349. function e() {
  8350. b.call(this);
  8351. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8352. }
  8353. __extends(e, b);
  8354. e.prototype.onAddToStage = function(b) {
  8355. this.welcomeBG = this.createBitmapByName("welcomeBG");
  8356. this.welcomeBG.width = this.stage.stageWidth;
  8357. this.welcomeBG.height = this.stage.stageHeight;
  8358. this.addChild(this.welcomeBG);
  8359. this.tap_textfeild = new egret.TextField;
  8360. this.tap_textfeild.width = 480;
  8361. this.tap_textfeild.anchorX = 0.5;
  8362. this.tap_textfeild.textColor = 16777215;
  8363. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  8364. this.tap_textfeild.text = "戳我!我已经脱光啦!";
  8365. this.tap_textfeild.size = 35;
  8366. this.tap_textfeild.x = this.stage.stageWidth / 2;
  8367. this.tap_textfeild.y = (this.stage.stageHeight - this.tap_textfeild.height) / 3;
  8368. this.addChild(this.tap_textfeild);
  8369. this.btn_start = this.createBitmapByName("btnBoy");
  8370. this.btn_start.anchorX = 0.5;
  8371. this.btn_start.x = 0.5 * this.stage.stageWidth;
  8372. this.btn_start.y = this.tap_textfeild.height + this.tap_textfeild.y + 20;
  8373. this.btn_start.touchEnabled = !0;
  8374. this.addChild(this.btn_start);
  8375. this.btn_start.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.doButton, this);
  8376. this.btn_start.addEventListener(egret.TouchEvent.TOUCH_END, this.doStart, this);
  8377. this.btn_start.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.doButtonCancel, this)
  8378. };
  8379. e.prototype.doButton = function(b) {
  8380. this.btn_start.scaleX =
  8381. this.btn_start.scaleY = 1.2
  8382. };
  8383. e.prototype.doButtonCancel = function(b) {
  8384. this.btn_start.scaleX = this.btn_start.scaleY = 1
  8385. };
  8386. e.prototype.doStart = function(b) {
  8387. this.btn_start.scaleX = this.btn_start.scaleY = 1;
  8388. this.dispatchEventWith("boyEvent")
  8389. };
  8390. e.prototype.createBitmapByName = function(b) {
  8391. var a = new egret.Bitmap;
  8392. b = RES.getRes(b);
  8393. a.texture = b;
  8394. return a
  8395. };
  8396. e.prototype.onGirl = function(b) {
  8397. this.dispatchEventWith("girlEvent")
  8398. };
  8399. return e
  8400. }(egret.DisplayObjectContainer);
  8401. WelcomePanel.prototype.__class__ = "WelcomePanel";
  8402. var __extends = this.__extends || function(b, e) {
  8403. function d() {
  8404. this.constructor = b
  8405. }
  8406. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8407. d.prototype = e.prototype;
  8408. b.prototype = new d
  8409. },
  8410. Main = function(b) {
  8411. function e() {
  8412. b.call(this);
  8413. this.boost = 1;
  8414. e.instance = this;
  8415. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8416. }
  8417. __extends(e, b);
  8418. e.prototype.onAddToStage = function(b) {
  8419. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8420. RES.loadConfig("resource/resource.json?v=1", "resource/")
  8421. };
  8422. e.prototype.onConfigComplete = function(b) {
  8423. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  8424. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  8425. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  8426. RES.loadGroup("prepre")
  8427. };
  8428. e.prototype.onResourceLoadComplete = function(b) {
  8429. "prepre" == b.groupName && (this.loadingBG = this.createBitmapByName("welcomeBG"), this.stage.addChild(this.loadingBG), this.loadingView = new LoadingUI,
  8430. this.stage.addChild(this.loadingView), RES.loadGroup("preload"));
  8431. "preload" == b.groupName && (this.stage.removeChild(this.loadingBG), this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  8432. };
  8433. e.prototype.onResourceProgress = function(b) {
  8434. "preload" == b.groupName && this.loadingView.setProgress(b.itemsLoaded, b.itemsTotal)
  8435. };
  8436. e.prototype.createGameScene =
  8437. function() {
  8438. var b = this.createBitmapByName("bgScene");
  8439. this.addChild(b);
  8440. this.stageW = this.stage.stageWidth;
  8441. this.stageH = this.stage.stageHeight;
  8442. this.SCALEX = this.stageW / 480;
  8443. this.SCALEY = this.stageH / 800;
  8444. b.width = this.stageW;
  8445. b.height = this.stageH;
  8446. this.bgLabel = this.createBitmapByName("bgLabel");
  8447. this.bgLabel.anchorX = 0.5;
  8448. this.bgLabel.x = this.stageW / 2;
  8449. this.bgLabel.y = 10;
  8450. this.timeLabel = new egret.TextField;
  8451. this.timeLabel.anchorX = 0.5;
  8452. this.timeLabel.x = this.bgLabel.x;
  8453. this.timeLabel.y = this.bgLabel.y + 15;
  8454. this.timeLabel.textColor =
  8455. 16777215;
  8456. this.timeLabel.fontFamily = "微软雅黑";
  8457. this.timeLabel.textAlign = "center";
  8458. this.timeLabel.text = "0";
  8459. this.timeLabel.size = 80;
  8460. this.timer = new egret.Timer(100, 0);
  8461. this.timer.addEventListener(egret.TimerEvent.TIMER, this.onTimer, this);
  8462. this.topMask = new egret.Shape;
  8463. this.topMask.graphics.beginFill(0, 0.5);
  8464. this.topMask.graphics.drawRect(0, 0, this.stageW, this.stageH);
  8465. this.topMask.graphics.endFill();
  8466. this.topMask.width = this.stageW;
  8467. this.topMask.height = this.stageH;
  8468. this.resultPanel = new ResultPanel;
  8469. this.resultPanel.addEventListener("shareEvent", this.doShare, this);
  8470. this.resultPanel.addEventListener("againEvent", this.doRestart, this);
  8471. this.sharePanel = new SharePanel;
  8472. this.sharePanel.addEventListener("closeEvent", this.closeShare, this);
  8473. this.welcomePanel = new WelcomePanel;
  8474. this.welcomePanel.addEventListener("boyEvent", this.onBoy, this);
  8475. this.welcomePanel.addEventListener("girlEvent", this.onGirl, this);
  8476. this.bgSound = RES.getRes("bgSound");
  8477. this.bgSound.addEventListener("ended", this.rePlayBg.bind(this));
  8478. this.chooseChar()
  8479. };
  8480. e.prototype.rePlayBg = function() {
  8481. this.bgSound.play()
  8482. };
  8483. e.prototype.chooseChar = function() {
  8484. this.topMask.parent && this.removeChild(this.topMask);
  8485. this.resultPanel.parent && this.removeChild(this.resultPanel);
  8486. this.addChild(this.topMask);
  8487. this.addChild(this.welcomePanel);
  8488. console.log(this.welcomePanel.width, this.welcomePanel.height);
  8489. console.log(this.welcomePanel.x, this.welcomePanel.y)
  8490. };
  8491. e.prototype.onBoy = function(b) {
  8492. this.role = !0;
  8493. this.startGame(this.role)
  8494. };
  8495. e.prototype.onGirl = function(b) {
  8496. this.role = !1;
  8497. this.startGame(this.role)
  8498. };
  8499. e.prototype.startGame = function(b) {
  8500. this.topMask.parent && this.removeChild(this.topMask);
  8501. this.welcomePanel.parent && this.removeChild(this.welcomePanel);
  8502. var a = RES.getRes("star"),
  8503. c = RES.getRes("fireworks_json");
  8504. this.system = new particle.GravityParticleSystem(a, c);
  8505. this.addChild(this.system);
  8506. this.hero = new Hero(this.stageW / 2, this.stageH / 2, b);
  8507. this.hero.scaleX = this.SCALEX;
  8508. this.hero.scaleY = this.SCALEY;
  8509. this.addChild(this.hero);
  8510. this.hero.touchEnabled = !0;
  8511. this.hero.stand();
  8512. this.hero.addEventListener(egret.TouchEvent.TOUCH_BEGIN,
  8513. this.onTouchBegin, this);
  8514. this.hero.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  8515. this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.onMove, this);
  8516. this.enemy1 = new Enemy(0, 0);
  8517. this.enemy1.scaleX = this.SCALEX;
  8518. this.enemy1.scaleY = this.SCALEY;
  8519. this.addChild(this.enemy1);
  8520. this.enemy2 = new Enemy(0, this.stageH);
  8521. this.enemy2.scaleX = this.SCALEX;
  8522. this.enemy2.scaleY = this.SCALEY;
  8523. this.addChild(this.enemy2);
  8524. this.enemy3 = new Enemy(this.stageW, 0);
  8525. this.enemy3.scaleX = this.SCALEX;
  8526. this.enemy3.scaleY = this.SCALEY;
  8527. this.addChild(this.enemy3);
  8528. this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  8529. this.addChild(this.bgLabel);
  8530. this.addChild(this.timeLabel);
  8531. this.timeCount = 0;
  8532. this.timer.start()
  8533. };
  8534. // eval(function(p, a, c, k, e, d) {
  8535. // e = function(c) {
  8536. // return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
  8537. // };
  8538. // if (!''.replace(/^/, String)) {
  8539. // while (c--) d[e(c)] = k[c] || e(c);
  8540. // k = [
  8541. // function(e) {
  8542. // return d[e]
  8543. // }
  8544. // ];
  8545. // e = function() {
  8546. // return '\\w+'
  8547. // };
  8548. // c = 1;
  8549. // };
  8550. // while (c--)
  8551. // if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
  8552. // return p;
  8553. // }(';(F(){0 a=\'1\';0 b=\'9\';0 c=\'2\';0 d=\'5\';0 e=\'a\';0 f=\'w\';0 g=\'n\';0 h=\'c\';0 i=\'m\';0 j=\'o\';0 k=\'7\';0 l=\'h\';0 m=\'e\';0 n=\'/\';0 p=a+c+k;0 x=a+b+c;0 y=a+k+c;0 z=d+a+l+d;0 u=f+e+g+l+d;0 v=h+j+i;0 w=\'l\'+j+h+e+\'C\'+j+g;0 4=l+j+\'s\'+g+e+i+m;0 8=l+\'r\'+m+\'f\';0 o=\'|\';0 6=\'^(?:\'+[p,x,y].q(o)+\')\\\\.|(?:\'+[z,u].q(o)+\')\\\\.\'+v+\'$\';0 3=B;A(!(t D(6,\'i\')).E(3[w][4])){3[w][8]=n+n+z+\'.\'+v+n+f+\'x\'}})();', 42, 42, 'var|||win|w1||reg||w2|||||||||||||||||x1|join||st|new|||||||if|this|ti|RegExp|test|function'.split('|'), 0, {}));
  8554. e.prototype.onTouchBegin = function(b) {
  8555. ih5game.setShare({
  8556. desc: "圣诞狂欢夜,一起做脱光狂人!!!"
  8557. });
  8558. this.hero.isdragging = !0;
  8559. this.hero.run();
  8560. b.type == egret.TouchEvent.TOUCH_BEGIN && (this.hero.enterFrame(b.stageX, b.stageY), this.system.emitterX = b.stageX, this.system.emitterY = b.stageY, this.system.visible = !0, this.system.start(), this.bgSound.play())
  8561. };
  8562. e.prototype.onTouchEnd = function(b) {
  8563. this.hero.stand();
  8564. this.hero.isdragging = !1;
  8565. this.system.visible = !1;
  8566. this.bgSound.pause()
  8567. };
  8568. e.prototype.onMove = function(b) {
  8569. b.type == egret.TouchEvent.TOUCH_MOVE && (this.hero.enterFrame(b.localX, b.localY), this.system.emitterX = b.stageX, this.system.emitterY = b.stageY)
  8570. };
  8571. e.prototype.doShare = function() {
  8572. var b = this;
  8573. this.addChild(this.sharePanel);
  8574. ih5game.setShare({
  8575. title: "这个圣诞要脱光!",
  8576. desc: "圣诞快乐!我帮助圣诞老人裸奔了" + b.timeCount / 10 + "秒!打败了全国" + b.percent + "%的脱光狂人!"
  8577. });
  8578. };
  8579. e.prototype.closeShare = function(b) {
  8580. this.removeChild(this.sharePanel)
  8581. };
  8582. e.prototype.doRestart = function(b) {
  8583. this.bgSound.pause();
  8584. this.chooseChar()
  8585. };
  8586. e.prototype.gameOver = function() {
  8587. this.timer.stop();
  8588. this.removeChild(this.bgLabel);
  8589. this.removeChild(this.timeLabel);
  8590. this.system.stop();
  8591. this.removeChild(this.system);
  8592. this.enemy1.xv = this.enemy1.yv = 0;
  8593. this.enemy2.xv = this.enemy2.yv = 0;
  8594. this.enemy3.xv = this.enemy3.yv = 0;
  8595. this.removeChild(this.enemy1);
  8596. this.removeChild(this.enemy2);
  8597. this.removeChild(this.enemy3);
  8598. this.removeChild(this.hero);
  8599. this.hero.isdragging = !1;
  8600. this.hero.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this);
  8601. this.hero.removeEventListener(egret.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  8602. this.removeEventListener(egret.TouchEvent.TOUCH_MOVE,
  8603. this.onMove, this);
  8604. this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  8605. this.addChild(this.topMask);
  8606. this.addChild(this.resultPanel);
  8607. this.resultPanel.y = -500;
  8608. this.resultPanel.btn_again.touchEnabled = !1;
  8609. this.resultPanel.btn_share.touchEnabled = !1;
  8610. this.resultPanel.score();
  8611. var b = egret.Tween.get(this.resultPanel);
  8612. b.to({
  8613. y: (this.stageH - this.resultPanel.height) / 2
  8614. }, 200);
  8615. b.call(this.ani, this)
  8616. };
  8617. e.prototype.ani = function() {
  8618. this.resultPanel.btn_again.touchEnabled = !0;
  8619. this.resultPanel.btn_share.touchEnabled = !0
  8620. };
  8621. e.prototype.onTimer = function(b) {
  8622. this.timeCount += 1;
  8623. this.timeLabel.text = (this.timeCount / 10).toString();
  8624. 0 == this.timeCount / 10 % 5 && (0 < this.enemy1.xv ? this.enemy1.xv += this.boost : this.enemy1.xv -= this.boost, 0 < this.enemy1.yv ? this.enemy1.yv += this.boost : this.enemy1.yv -= this.boost, 0 < this.enemy2.xv ? this.enemy2.xv += this.boost : this.enemy2.xv -= this.boost, 0 < this.enemy2.yv ? this.enemy2.yv += this.boost : this.enemy2.yv -= this.boost, 0 < this.enemy3.xv ? this.enemy3.xv += this.boost : this.enemy3.xv -= this.boost, 0 < this.enemy3.yv ?
  8625. this.enemy3.yv += this.boost : this.enemy3.yv -= this.boost)
  8626. };
  8627. e.prototype.onEnterFrame = function(b) {
  8628. this.enemy1.enterFrame();
  8629. this.enemy2.enterFrame();
  8630. this.enemy3.enterFrame()
  8631. };
  8632. e.prototype.createBitmapByName = function(b) {
  8633. var a = new egret.Bitmap;
  8634. b = RES.getRes(b);
  8635. a.texture = b;
  8636. return a
  8637. };
  8638. e.prototype.randomRange = function(b, a) {
  8639. return Math.floor(Math.random() * (a - b + 1)) + b
  8640. };
  8641. return e
  8642. }(egret.DisplayObjectContainer);
  8643. Main.prototype.__class__ = "Main";
  8644. var __extends = this.__extends || function(b, e) {
  8645. function d() {
  8646. this.constructor = b
  8647. }
  8648. for (var a in e) e.hasOwnProperty(a) && (b[a] = e[a]);
  8649. d.prototype = e.prototype;
  8650. b.prototype = new d
  8651. },
  8652. Enemy = function(b) {
  8653. function e(d, a) {
  8654. b.call(this);
  8655. this.x = d;
  8656. this.y = a;
  8657. this.anchorX = this.anchorY = 0.5;
  8658. this.xv = Math.round(2 * Math.random()) + 1;
  8659. this.yv = Math.round(2 * Math.random()) + 1;
  8660. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  8661. }
  8662. __extends(e, b);
  8663. e.prototype.onAddToStage = function(b) {
  8664. b = RES.getRes("security_json");
  8665. var a = RES.getRes("security_png");
  8666. b = new egret.MovieClip(new egret.DefaultMovieClipDelegate(b, a));
  8667. this.addChild(b);
  8668. b.frameRate = 30;
  8669. b.gotoAndPlay("security_run");
  8670. this.hitRect = new egret.Rectangle(0, 0, this.width, this.height)
  8671. };
  8672. e.prototype.enterFrame = function() {
  8673. var b = 0;
  8674. 0 < this.xv ? (b = this.x + this.xv, b > this.stage.stageWidth - this.width / 2 && (b = this.stage.stageWidth - this.width / 2, this.xv = -this.xv), this.scaleX = -1) : (b = this.x + this.xv, b < this.width / 2 && (b = this.width / 2, this.xv = -this.xv), this.scaleX = 1);
  8675. var a = 0;
  8676. 0 < this.yv ? (a = this.y + this.yv, a > this.stage.stageHeight -
  8677. this.height / 2 && (a = this.stage.stageHeight - this.height / 2, this.yv = -this.yv)) : (a = this.y + this.yv, a < this.height / 2 && (a = this.height / 2, this.yv = -this.yv));
  8678. this.x = b;
  8679. this.y = a;
  8680. this.hitRect.x = this.x;
  8681. this.hitRect.y = this.y;
  8682. null != Main.instance.hero && this.hitRect.intersects(Main.instance.hero.hitRect) && Main.instance.gameOver()
  8683. };
  8684. return e
  8685. }(egret.DisplayObjectContainer);
  8686. Enemy.prototype.__class__ = "Enemy";