game-min.js 228 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189
  1. var egret;
  2. (function(c) {
  3. var d = 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. c.HashObject = d;
  18. d.prototype.__class__ = "egret.HashObject"
  19. })(egret || (egret = {}));
  20. var __extends = this.__extends || function(c, d) {
  21. function b() {
  22. this.constructor = c
  23. }
  24. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  25. b.prototype = d.prototype;
  26. c.prototype = new b
  27. };
  28. (function(c) {
  29. var d = function(b) {
  30. function a(e) {
  31. "undefined" === typeof e && (e = 300);
  32. b.call(this);
  33. this.objectPool = [];
  34. this._length = 0;
  35. 1 > e && (e = 1);
  36. this.autoDisposeTime = e;
  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(e) {
  52. var g = this.objectPool; - 1 == g.indexOf(e) && (g.push(e), this._length++, 0 == this.frameCount &&
  53. (this.frameCount = 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 e = a._callBackList,
  64. g = e.indexOf(this); - 1 != g && e.splice(g, 1)
  65. };
  66. a._callBackList = [];
  67. return a
  68. }(c.HashObject);
  69. c.Recycler = d;
  70. d.prototype.__class__ = "egret.Recycler"
  71. })(egret || (egret = {}));
  72. (function(c) {
  73. c.__START_TIME;
  74. c.getTimer = function() {
  75. return Date.now() - c.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(c) {
  79. c.__callLaterFunctionList = [];
  80. c.__callLaterThisList = [];
  81. c.__callLaterArgsList = [];
  82. c.callLater = function(d, b) {
  83. for (var a = [], e = 0; e < arguments.length - 2; e++) a[e] = arguments[e + 2];
  84. c.__callLaterFunctionList.push(d);
  85. c.__callLaterThisList.push(b);
  86. c.__callLaterArgsList.push(a)
  87. }
  88. })(egret || (egret = {}));
  89. __extends = this.__extends || function(c, d) {
  90. function b() {
  91. this.constructor = c
  92. }
  93. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  94. b.prototype = d.prototype;
  95. c.prototype = new b
  96. };
  97. (function(c) {
  98. var d = function(b) {
  99. function a(e, a, q) {
  100. "undefined" === typeof a && (a = !1);
  101. "undefined" === typeof q && (q = !1);
  102. b.call(this);
  103. this._eventPhase = 2;
  104. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  105. this.isNew = !0;
  106. this._type = e;
  107. this._bubbles = a;
  108. this._cancelable = q
  109. }
  110. __extends(a, b);
  111. Object.defineProperty(a.prototype, "type", {
  112. get: function() {
  113. return this._type
  114. },
  115. enumerable: !0,
  116. configurable: !0
  117. });
  118. Object.defineProperty(a.prototype, "bubbles", {
  119. get: function() {
  120. return this._bubbles
  121. },
  122. enumerable: !0,
  123. configurable: !0
  124. });
  125. Object.defineProperty(a.prototype, "cancelable", {
  126. get: function() {
  127. return this._cancelable
  128. },
  129. enumerable: !0,
  130. configurable: !0
  131. });
  132. Object.defineProperty(a.prototype, "eventPhase", {
  133. get: function() {
  134. return this._eventPhase
  135. },
  136. enumerable: !0,
  137. configurable: !0
  138. });
  139. Object.defineProperty(a.prototype, "currentTarget", {
  140. get: function() {
  141. return this._currentTarget
  142. },
  143. enumerable: !0,
  144. configurable: !0
  145. });
  146. a.prototype._setCurrentTarget = function(e) {
  147. this._currentTarget = e
  148. };
  149. Object.defineProperty(a.prototype, "target", {
  150. get: function() {
  151. return this._target
  152. },
  153. enumerable: !0,
  154. configurable: !0
  155. });
  156. a.prototype.isDefaultPrevented = function() {
  157. return this._isDefaultPrevented
  158. };
  159. a.prototype.preventDefault = function() {
  160. this._cancelable && (this._isDefaultPrevented = !0)
  161. };
  162. a.prototype.stopPropagation = function() {
  163. this._bubbles && (this._isPropagationStopped = !0)
  164. };
  165. a.prototype.stopImmediatePropagation = function() {
  166. this._bubbles && (this._isPropagationImmediateStopped = !0)
  167. };
  168. a.prototype._reset = function() {
  169. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
  170. this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  171. };
  172. a._dispatchByTarget = function(e, a, q, b, d, h) {
  173. "undefined" === typeof d && (d = !1);
  174. "undefined" === typeof h && (h = !1);
  175. var k = e.eventRecycler;
  176. k || (k = e.eventRecycler = new c.Recycler);
  177. var m = k.pop();
  178. m ? m._type = q : m = new e(q);
  179. m._bubbles = d;
  180. m._cancelable = h;
  181. if (b)
  182. for (var n in b) m[n] = b[n], null !== m[n] && (b[n] = null);
  183. e = a.dispatchEvent(m);
  184. k.push(m);
  185. return e
  186. };
  187. a._getPropertyData = function(e) {
  188. var a = e._props;
  189. a || (a = e._props = {});
  190. return a
  191. };
  192. a.dispatchEvent = function(e, g, q, b) {
  193. "undefined" === typeof q && (q = !1);
  194. var c = a._getPropertyData(a);
  195. b && (c.data = b);
  196. a._dispatchByTarget(a, e, g, c, q)
  197. };
  198. a.ADDED_TO_STAGE = "addedToStage";
  199. a.REMOVED_FROM_STAGE = "removedFromStage";
  200. a.ADDED = "added";
  201. a.REMOVED = "removed";
  202. a.COMPLETE = "complete";
  203. a.ENTER_FRAME = "enterFrame";
  204. a.RENDER = "render";
  205. a.FINISH_RENDER = "finishRender";
  206. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  207. a.LEAVE_STAGE = "leaveStage";
  208. a.RESIZE = "resize";
  209. a.CHANGE = "change";
  210. return a
  211. }(c.HashObject);
  212. c.Event =
  213. d;
  214. d.prototype.__class__ = "egret.Event"
  215. })(egret || (egret = {}));
  216. __extends = this.__extends || function(c, d) {
  217. function b() {
  218. this.constructor = c
  219. }
  220. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  221. b.prototype = d.prototype;
  222. c.prototype = new b
  223. };
  224. (function(c) {
  225. var d = function(b) {
  226. function a(e, a, q) {
  227. "undefined" === typeof a && (a = !1);
  228. "undefined" === typeof q && (q = !1);
  229. b.call(this, e, a, q)
  230. }
  231. __extends(a, b);
  232. a.dispatchIOErrorEvent = function(e) {
  233. c.Event._dispatchByTarget(a, e, a.IO_ERROR)
  234. };
  235. a.IO_ERROR = "ioError";
  236. return a
  237. }(c.Event);
  238. c.IOErrorEvent = d;
  239. d.prototype.__class__ = "egret.IOErrorEvent"
  240. })(egret || (egret = {}));
  241. __extends = this.__extends || function(c, d) {
  242. function b() {
  243. this.constructor = c
  244. }
  245. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  246. b.prototype = d.prototype;
  247. c.prototype = new b
  248. };
  249. (function(c) {
  250. var d = function(b) {
  251. function a(e, a, q, c, d, h, k, m, n, p) {
  252. "undefined" === typeof a && (a = !0);
  253. "undefined" === typeof q && (q = !0);
  254. "undefined" === typeof c && (c = 0);
  255. "undefined" === typeof d && (d = 0);
  256. "undefined" === typeof h && (h = 0);
  257. "undefined" === typeof k && (k = !1);
  258. "undefined" === typeof m && (m = !1);
  259. "undefined" === typeof p && (p = !1);
  260. b.call(this, e, a, q);
  261. this._localY = this._localX = this._stageY = this._stageX = 0;
  262. this.touchPointID = c;
  263. this._stageX = d;
  264. this._stageY = h;
  265. this.ctrlKey = k;
  266. this.altKey = m;
  267. this.touchDown = p
  268. }
  269. __extends(a, b);
  270. Object.defineProperty(a.prototype,
  271. "stageX", {
  272. get: function() {
  273. return this._stageX
  274. },
  275. enumerable: !0,
  276. configurable: !0
  277. });
  278. Object.defineProperty(a.prototype, "stageY", {
  279. get: function() {
  280. return this._stageY
  281. },
  282. enumerable: !0,
  283. configurable: !0
  284. });
  285. Object.defineProperty(a.prototype, "localX", {
  286. get: function() {
  287. return this._localX
  288. },
  289. enumerable: !0,
  290. configurable: !0
  291. });
  292. Object.defineProperty(a.prototype, "localY", {
  293. get: function() {
  294. return this._localY
  295. },
  296. enumerable: !0,
  297. configurable: !0
  298. });
  299. a.prototype._setCurrentTarget = function(e) {
  300. b.prototype._setCurrentTarget.call(this, e);
  301. e instanceof
  302. c.DisplayObject && (e = e.globalToLocal(this._stageX, this._stageY, c.Point.identity), this._localX = e.x, this._localY = e.y)
  303. };
  304. a.dispatchTouchEvent = function(e, g, q, b, d, h, k, m, n) {
  305. "undefined" === typeof q && (q = 0);
  306. "undefined" === typeof b && (b = 0);
  307. "undefined" === typeof d && (d = 0);
  308. "undefined" === typeof h && (h = !1);
  309. "undefined" === typeof k && (k = !1);
  310. "undefined" === typeof m && (m = !1);
  311. "undefined" === typeof n && (n = !1);
  312. var p = c.Event._getPropertyData(a);
  313. p.touchPointID = q;
  314. p._stageX = b;
  315. p._stageY = d;
  316. p.ctrlKey = h;
  317. p.altKey = k;
  318. p.shiftKey = m;
  319. p.touchDown = n;
  320. c.Event._dispatchByTarget(a, e, g, p, !0, !0)
  321. };
  322. a.TOUCH_TAP = "touchTap";
  323. a.TOUCH_MOVE = "touchMove";
  324. a.TOUCH_BEGIN = "touchBegin";
  325. a.TOUCH_END = "touchEnd";
  326. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  327. a.TOUCH_ROLL_OUT = "touchRollOut";
  328. a.TOUCH_ROLL_OVER = "touchRollOver";
  329. a.TOUCH_OUT = "touchOut";
  330. a.TOUCH_OVER = "touchOver";
  331. return a
  332. }(c.Event);
  333. c.TouchEvent = d;
  334. d.prototype.__class__ = "egret.TouchEvent"
  335. })(egret || (egret = {}));
  336. __extends = this.__extends || function(c, d) {
  337. function b() {
  338. this.constructor = c
  339. }
  340. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  341. b.prototype = d.prototype;
  342. c.prototype = new b
  343. };
  344. (function(c) {
  345. var d = function(b) {
  346. function a(e, a, q) {
  347. "undefined" === typeof a && (a = !1);
  348. "undefined" === typeof q && (q = !1);
  349. b.call(this, e, a, q)
  350. }
  351. __extends(a, b);
  352. a.dispatchTimerEvent = function(e, g) {
  353. c.Event._dispatchByTarget(a, e, g)
  354. };
  355. a.TIMER = "timer";
  356. a.TIMER_COMPLETE = "timerComplete";
  357. return a
  358. }(c.Event);
  359. c.TimerEvent = d;
  360. d.prototype.__class__ = "egret.TimerEvent"
  361. })(egret || (egret = {}));
  362. (function(c) {
  363. var d = function() {
  364. function b() {}
  365. b.CAPTURING_PHASE = 1;
  366. b.AT_TARGET = 2;
  367. b.BUBBLING_PHASE = 3;
  368. return b
  369. }();
  370. c.EventPhase = d;
  371. d.prototype.__class__ = "egret.EventPhase"
  372. })(egret || (egret = {}));
  373. __extends = this.__extends || function(c, d) {
  374. function b() {
  375. this.constructor = c
  376. }
  377. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  378. b.prototype = d.prototype;
  379. c.prototype = new b
  380. };
  381. (function(c) {
  382. var d = function(b) {
  383. function a(e) {
  384. "undefined" === typeof e && (e = null);
  385. b.call(this);
  386. this._eventTarget = e ? e : this
  387. }
  388. __extends(a, b);
  389. a.prototype.addEventListener = function(e, a, q, b, d) {
  390. "undefined" === typeof b && (b = !1);
  391. "undefined" === typeof d && (d = 0);
  392. "undefined" === typeof b && (b = !1);
  393. "undefined" === typeof d && (d = 0);
  394. a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  395. b ? (this._captureEventsMap || (this._captureEventsMap = {}), b = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), b = this._eventsMap);
  396. var h = b[e];
  397. h || (h = b[e] = []);
  398. this._insertEventBin(h, a, q, d)
  399. };
  400. a.prototype._insertEventBin = function(e, a, q, b) {
  401. for (var c = -1, d = e.length, k = 0; k < d; k++) {
  402. var m = e[k];
  403. if (m.listener === a && m.thisObject === q) return !1; - 1 == c && m.priority < b && (c = k)
  404. }
  405. a = {
  406. listener: a,
  407. thisObject: q,
  408. priority: b
  409. }; - 1 != c ? e.splice(c, 0, a) : e.push(a);
  410. return !0
  411. };
  412. a.prototype.removeEventListener = function(e, a, q, b) {
  413. "undefined" === typeof b && (b = !1);
  414. if (b = b ? this._captureEventsMap : this._eventsMap) {
  415. var c = b[e];
  416. c && (this._removeEventBin(c, a, q), 0 ==
  417. c.length && delete b[e])
  418. }
  419. };
  420. a.prototype._removeEventBin = function(e, a, b) {
  421. for (var c = e.length, d = 0; d < c; d++) {
  422. var h = e[d];
  423. if (h.listener === a && h.thisObject === b) return e.splice(d, 1), !0
  424. }
  425. return !1
  426. };
  427. a.prototype.hasEventListener = function(e) {
  428. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  429. };
  430. a.prototype.willTrigger = function(e) {
  431. return this.hasEventListener(e)
  432. };
  433. a.prototype.dispatchEvent = function(e) {
  434. e._reset();
  435. e._target = this._eventTarget;
  436. e._setCurrentTarget(this._eventTarget);
  437. return this._notifyListener(e)
  438. };
  439. a.prototype._notifyListener = function(e) {
  440. var a = 1 == e._eventPhase ? this._captureEventsMap : this._eventsMap;
  441. if (!a) return !0;
  442. a = a[e.type];
  443. if (!a) return !0;
  444. for (var a = a.concat(), b = a.length, c = 0; c < b; c++) {
  445. var d = a[c];
  446. d.listener.call(d.thisObject, e);
  447. if (e._isPropagationImmediateStopped) break
  448. }
  449. return !e.isDefaultPrevented()
  450. };
  451. a.prototype.dispatchEventWith = function(e, a, b) {
  452. "undefined" === typeof a && (a = !1);
  453. c.Event.dispatchEvent(this, e, a, b)
  454. };
  455. return a
  456. }(c.HashObject);
  457. c.EventDispatcher = d;
  458. d.prototype.__class__ =
  459. "egret.EventDispatcher"
  460. })(egret || (egret = {}));
  461. __extends = this.__extends || function(c, d) {
  462. function b() {
  463. this.constructor = c
  464. }
  465. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  466. b.prototype = d.prototype;
  467. c.prototype = new b
  468. };
  469. (function(c) {
  470. var d = function(b) {
  471. function a() {
  472. b.call(this);
  473. this.reuseEvent = new c.Event("")
  474. }
  475. __extends(a, b);
  476. a.prototype.run = function() {
  477. c.Ticker.getInstance().run();
  478. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  479. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  480. this.touchContext.run()
  481. };
  482. a.prototype.renderLoop = function(e) {
  483. e = this.rendererContext;
  484. e.clearScreen();
  485. if (0 < c.__callLaterFunctionList.length) {
  486. var a = c.__callLaterFunctionList;
  487. c.__callLaterFunctionList =
  488. [];
  489. var b = c.__callLaterThisList;
  490. c.__callLaterThisList = [];
  491. var d = c.__callLaterArgsList;
  492. c.__callLaterArgsList = []
  493. }
  494. this.dispatchEventWith(c.Event.RENDER);
  495. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  496. a && this.doCallLaterList(a, b, d);
  497. this.stage._updateTransform();
  498. this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);
  499. this.stage._draw(e);
  500. this.dispatchEventWith(c.Event.FINISH_RENDER)
  501. };
  502. a.prototype.broadcastEnterFrame = function(e) {
  503. e = this.reuseEvent;
  504. e._type = c.Event.ENTER_FRAME;
  505. this.dispatchEvent(e);
  506. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), b = a.length, d = 0; d < b; d++) {
  507. var f = a[d];
  508. e._target = f.display;
  509. e._setCurrentTarget(f.display);
  510. f.listener.call(f.thisObject, e)
  511. }
  512. a = c.Recycler._callBackList;
  513. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  514. };
  515. a.prototype.broadcastRender = function() {
  516. var e = this.reuseEvent;
  517. e._type = c.Event.RENDER;
  518. for (var a = c.DisplayObject._renderCallBackList.concat(), b = a.length, d = 0; d < b; d++) {
  519. var f = a[d];
  520. e._target = f.display;
  521. e._setCurrentTarget(f.display);
  522. f.listener.call(f.thisObject,
  523. e)
  524. }
  525. };
  526. a.prototype.doCallLaterList = function(e, a, b) {
  527. for (var c = e.length, d = 0; d < c; d++) {
  528. var h = e[d];
  529. null != h && h.apply(a[d], b[d])
  530. }
  531. };
  532. a.DEVICE_PC = "web";
  533. a.DEVICE_MOBILE = "native";
  534. return a
  535. }(c.EventDispatcher);
  536. c.MainContext = d;
  537. d.prototype.__class__ = "egret.MainContext"
  538. })(egret || (egret = {}));
  539. var testDeviceType = function() {
  540. if (!this.navigator) return !0;
  541. var c = navigator.userAgent.toLowerCase();
  542. return -1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  543. };
  544. egret.MainContext.instance = new egret.MainContext;
  545. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;
  546. (function(c) {
  547. var d = function() {
  548. function b() {
  549. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  550. this._maxDeltaTime = 500;
  551. this._totalDeltaTime = 0
  552. }
  553. b.getInstance = function() {
  554. null == b.instance && (b.instance = new b);
  555. return b.instance
  556. };
  557. b.prototype.run = function() {
  558. c.Ticker.getInstance().register(this.update, this);
  559. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, c.MainContext.instance.stage.addChild(this._txt));
  560. var a =
  561. c.MainContext.instance;
  562. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  563. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  564. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  565. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  566. };
  567. b.prototype.onEnterFrame = function(a) {
  568. this._lastTime = c.getTimer()
  569. };
  570. b.prototype.onStartRender = function(a) {
  571. a = c.getTimer();
  572. this._logicPerformanceCost = a - this._lastTime;
  573. this._lastTime = a
  574. };
  575. b.prototype.onFinishUpdateTransform =
  576. function(a) {
  577. a = c.getTimer();
  578. this._updateTransformPerformanceCost = a - this._lastTime;
  579. this._lastTime = a
  580. };
  581. b.prototype.onFinishRender = function(a) {
  582. a = c.getTimer();
  583. this._renderPerformanceCost = a - this._lastTime;
  584. this._lastTime = a
  585. };
  586. b.prototype.update = function(a) {
  587. this._tick++;
  588. this._totalDeltaTime += a;
  589. if (this._totalDeltaTime >= this._maxDeltaTime) {
  590. a = (this._preDrawCount - 1).toString();
  591. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  592. "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  593. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  594. this._tick = this._totalDeltaTime = 0
  595. }
  596. this._preDrawCount = 0
  597. };
  598. b.prototype.onDrawImage = function() {
  599. this._preDrawCount++
  600. };
  601. return b
  602. }();
  603. c.Profiler = d;
  604. d.prototype.__class__ = "egret.Profiler"
  605. })(egret || (egret = {}));
  606. __extends = this.__extends || function(c, d) {
  607. function b() {
  608. this.constructor = c
  609. }
  610. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  611. b.prototype = d.prototype;
  612. c.prototype = new b
  613. };
  614. (function(c) {
  615. var d = function(b) {
  616. function a() {
  617. b.apply(this, arguments);
  618. this._timeScale = 1;
  619. this._paused = !1;
  620. this.callBackList = []
  621. }
  622. __extends(a, b);
  623. a.prototype.run = function() {
  624. c.__START_TIME = (new Date).getTime();
  625. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  626. };
  627. a.prototype.update = function(e) {
  628. var a = this.callBackList.concat(),
  629. b = a.length;
  630. e *= this._timeScale;
  631. e *= this._timeScale;
  632. for (var c = 0; c < b; c++) {
  633. var d = a[c];
  634. d.listener.call(d.thisObject, e)
  635. }
  636. };
  637. a.prototype.register = function(e, a, b) {
  638. "undefined" ===
  639. typeof b && (b = 0);
  640. this._insertEventBin(this.callBackList, e, a, b)
  641. };
  642. a.prototype.unregister = function(e, a) {
  643. this._removeEventBin(this.callBackList, e, a)
  644. };
  645. a.prototype.setTimeout = function(e, a, b) {
  646. for (var d = [], f = 0; f < arguments.length - 3; f++) d[f] = arguments[f + 3];
  647. c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  648. c.setTimeout.apply(null, [e, a, b].concat(d))
  649. };
  650. a.prototype.setTimeScale = function(e) {
  651. this._timeScale = e
  652. };
  653. a.prototype.getTimeScale = function() {
  654. return this._timeScale
  655. };
  656. a.prototype.pause = function() {
  657. this._paused = !0
  658. };
  659. a.prototype.resume = function() {
  660. this._paused = !1
  661. };
  662. a.getInstance = function() {
  663. null == a.instance && (a.instance = new a);
  664. return a.instance
  665. };
  666. return a
  667. }(c.EventDispatcher);
  668. c.Ticker = d;
  669. d.prototype.__class__ = "egret.Ticker"
  670. })(egret || (egret = {}));
  671. (function(c) {
  672. var d = function() {
  673. function b() {}
  674. b.LEFT = "left";
  675. b.RIGHT = "right";
  676. b.CENTER = "center";
  677. b.JUSTIFY = "justify";
  678. b.CONTENT_JUSTIFY = "contentJustify";
  679. return b
  680. }();
  681. c.HorizontalAlign = d;
  682. d.prototype.__class__ = "egret.HorizontalAlign"
  683. })(egret || (egret = {}));
  684. (function(c) {
  685. var d = function() {
  686. function b() {}
  687. b.TOP = "top";
  688. b.BOTTOM = "bottom";
  689. b.MIDDLE = "middle";
  690. b.JUSTIFY = "justify";
  691. b.CONTENT_JUSTIFY = "contentJustify";
  692. return b
  693. }();
  694. c.VerticalAlign = d;
  695. d.prototype.__class__ = "egret.VerticalAlign"
  696. })(egret || (egret = {}));
  697. __extends = this.__extends || function(c, d) {
  698. function b() {
  699. this.constructor = c
  700. }
  701. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  702. b.prototype = d.prototype;
  703. c.prototype = new b
  704. };
  705. (function(c) {
  706. var d = function(b) {
  707. function a(e, a) {
  708. "undefined" === typeof a && (a = 0);
  709. b.call(this);
  710. this._currentCount = 0;
  711. this.delay = e;
  712. this.repeatCount = a
  713. }
  714. __extends(a, b);
  715. a.prototype.currentCount = function() {
  716. return this._currentCount
  717. };
  718. Object.defineProperty(a.prototype, "running", {
  719. get: function() {
  720. return this._running
  721. },
  722. enumerable: !0,
  723. configurable: !0
  724. });
  725. a.prototype.reset = function() {
  726. this.stop();
  727. this._currentCount = 0
  728. };
  729. a.prototype.start = function() {
  730. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
  731. 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  732. };
  733. a.prototype.stop = function() {
  734. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  735. };
  736. a.prototype.onEnterFrame = function(e) {
  737. e = c.getTimer();
  738. e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  739. };
  740. return a
  741. }(c.EventDispatcher);
  742. c.Timer = d;
  743. d.prototype.__class__ = "egret.Timer"
  744. })(egret || (egret = {}));
  745. (function(c) {
  746. c.getQualifiedClassName = function(c) {
  747. c = c.prototype ? c.prototype : c.__proto__;
  748. if (c.hasOwnProperty("__class__")) return c.__class__;
  749. var b = c.constructor.toString(),
  750. a = b.indexOf("("),
  751. b = b.substring(9, a);
  752. return c.__class__ = b
  753. }
  754. })(egret || (egret = {}));
  755. (function(c) {
  756. var d = {};
  757. c.getDefinitionByName = function(b) {
  758. if (!b) return null;
  759. var a = d[b];
  760. if (a) return a;
  761. for (var e = b.split("."), g = e.length, a = __global, c = 0; c < g; c++)
  762. if (a = a[e[c]], !a) return null;
  763. return d[b] = a
  764. }
  765. })(egret || (egret = {}));
  766. var __global = __global || this;
  767. (function(c) {
  768. function d(e) {
  769. for (var a in b) {
  770. var c = b[a];
  771. c.delay -= e;
  772. 0 >= c.delay && (c.listener.apply(c.thisObject, c.params), delete b[a])
  773. }
  774. }
  775. var b = {},
  776. a = 0;
  777. c.setTimeout = function(e, g, q) {
  778. for (var l = [], f = 0; f < arguments.length - 3; f++) l[f] = arguments[f + 3];
  779. l = {
  780. listener: e,
  781. thisObject: g,
  782. delay: q,
  783. params: l
  784. };
  785. 0 == a && c.Ticker.getInstance().register(d, null);
  786. a++;
  787. b[a] = l;
  788. return a
  789. };
  790. c.clearTimeout = function(e) {
  791. delete b[e]
  792. }
  793. })(egret || (egret = {}));
  794. (function(c) {
  795. c.hasDefinition = function(d) {
  796. return c.getDefinitionByName(d) ? !0 : !1
  797. }
  798. })(egret || (egret = {}));
  799. (function(c) {
  800. c.toColorString = function(c) {
  801. if (isNaN(c) || 0 > c) c = 0;
  802. 16777215 < c && (c = 16777215);
  803. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  804. return "#" + c
  805. }
  806. })(egret || (egret = {}));
  807. __extends = this.__extends || function(c, d) {
  808. function b() {
  809. this.constructor = c
  810. }
  811. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  812. b.prototype = d.prototype;
  813. c.prototype = new b
  814. };
  815. (function(c) {
  816. var d = function(b) {
  817. function a(e, a, c, d, f, h) {
  818. "undefined" === typeof e && (e = 1);
  819. "undefined" === typeof a && (a = 0);
  820. "undefined" === typeof c && (c = 0);
  821. "undefined" === typeof d && (d = 1);
  822. "undefined" === typeof f && (f = 0);
  823. "undefined" === typeof h && (h = 0);
  824. b.call(this);
  825. this.a = e;
  826. this.b = a;
  827. this.c = c;
  828. this.d = d;
  829. this.tx = f;
  830. this.ty = h
  831. }
  832. __extends(a, b);
  833. a.prototype.prepend = function(e, a, b, c, d, h) {
  834. var k = this.tx;
  835. if (1 != e || 0 != a || 0 != b || 1 != c) {
  836. var m = this.a,
  837. n = this.c;
  838. this.a = m * e + this.b * b;
  839. this.b = m * a + this.b * c;
  840. this.c = n * e + this.d * b;
  841. this.d = n * a + this.d *
  842. c
  843. }
  844. this.tx = k * e + this.ty * b + d;
  845. this.ty = k * a + this.ty * c + h;
  846. return this
  847. };
  848. a.prototype.append = function(e, a, b, c, d, h) {
  849. var k = this.a,
  850. m = this.b,
  851. n = this.c,
  852. p = this.d;
  853. this.a = e * k + a * n;
  854. this.b = e * m + a * p;
  855. this.c = b * k + c * n;
  856. this.d = b * m + c * p;
  857. this.tx = d * k + h * n + this.tx;
  858. this.ty = d * m + h * p + this.ty;
  859. return this
  860. };
  861. a.prototype.prependMatrix = function(e) {
  862. this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty);
  863. return this
  864. };
  865. a.prototype.appendMatrix = function(e) {
  866. this.append(e.a, e.b, e.c, e.d, e.tx, e.ty);
  867. return this
  868. };
  869. a.prototype.prependTransform = function(e, g, b, c, d, h, k, m, n) {
  870. if (d %
  871. 360) {
  872. var p = d * a.DEG_TO_RAD;
  873. d = Math.cos(p);
  874. p = Math.sin(p)
  875. } else d = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n;
  876. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(d * b, p * b, -p * c, d * c, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), e, g)) : this.prepend(d * b, p * b, -p * c, d * c, e, g);
  877. return this
  878. };
  879. a.prototype.appendTransform = function(e, g, b, c, d, h, k, m, n) {
  880. if (d % 360) {
  881. var p = d * a.DEG_TO_RAD;
  882. d = Math.cos(p);
  883. p = Math.sin(p)
  884. } else d = 1, p = 0;
  885. h || k ? (h *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h),
  886. Math.cos(h), e, g), this.append(d * b, p * b, -p * c, d * c, 0, 0)) : this.append(d * b, p * b, -p * c, d * c, e, g);
  887. if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
  888. return this
  889. };
  890. a.prototype.rotate = function(e) {
  891. var a = Math.cos(e);
  892. e = Math.sin(e);
  893. var b = this.a,
  894. c = this.c,
  895. d = this.tx;
  896. this.a = b * a - this.b * e;
  897. this.b = b * e + this.b * a;
  898. this.c = c * a - this.d * e;
  899. this.d = c * e + this.d * a;
  900. this.tx = d * a - this.ty * e;
  901. this.ty = d * e + this.ty * a;
  902. return this
  903. };
  904. a.prototype.skew = function(e, g) {
  905. e *= a.DEG_TO_RAD;
  906. g *= a.DEG_TO_RAD;
  907. this.append(Math.cos(g), Math.sin(g), -Math.sin(e),
  908. Math.cos(e), 0, 0);
  909. return this
  910. };
  911. a.prototype.scale = function(e, a) {
  912. this.a *= e;
  913. this.d *= a;
  914. this.c *= e;
  915. this.b *= a;
  916. this.tx *= e;
  917. this.ty *= a;
  918. return this
  919. };
  920. a.prototype.translate = function(e, a) {
  921. this.tx += e;
  922. this.ty += a;
  923. return this
  924. };
  925. a.prototype.identity = function() {
  926. this.a = this.d = 1;
  927. this.b = this.c = this.tx = this.ty = 0;
  928. return this
  929. };
  930. a.prototype.invert = function() {
  931. var e = this.a,
  932. a = this.b,
  933. b = this.c,
  934. c = this.d,
  935. d = this.tx,
  936. h = e * c - a * b;
  937. this.a = c / h;
  938. this.b = -a / h;
  939. this.c = -b / h;
  940. this.d = e / h;
  941. this.tx = (b * this.ty - c * d) / h;
  942. this.ty = -(e * this.ty - a * d) / h;
  943. return this
  944. };
  945. a.transformCoords = function(e, a, b) {
  946. var d = c.Point.identity;
  947. d.x = e.a * a + e.c * b + e.tx;
  948. d.y = e.d * b + e.b * a + e.ty;
  949. return d
  950. };
  951. a.prototype.toArray = function(e) {
  952. this.array || (this.array = new Float32Array(9));
  953. e ? (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] =
  954. 0);
  955. this.array[8] = 1;
  956. return this.array
  957. };
  958. a.identity = new a;
  959. a.DEG_TO_RAD = Math.PI / 180;
  960. return a
  961. }(c.HashObject);
  962. c.Matrix = d;
  963. d.prototype.__class__ = "egret.Matrix"
  964. })(egret || (egret = {}));
  965. __extends = this.__extends || function(c, d) {
  966. function b() {
  967. this.constructor = c
  968. }
  969. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  970. b.prototype = d.prototype;
  971. c.prototype = new b
  972. };
  973. (function(c) {
  974. var d = function(b) {
  975. function a(e, a) {
  976. "undefined" === typeof e && (e = 0);
  977. "undefined" === typeof a && (a = 0);
  978. b.call(this);
  979. this.x = e;
  980. this.y = a
  981. }
  982. __extends(a, b);
  983. a.prototype.clone = function() {
  984. return new a(this.x, this.y)
  985. };
  986. a.prototype.equals = function(e) {
  987. return this.x == e.x && this.y == e.y
  988. };
  989. a.distance = function(e, a) {
  990. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  991. };
  992. a.identity = new a(0, 0);
  993. return a
  994. }(c.HashObject);
  995. c.Point = d;
  996. d.prototype.__class__ = "egret.Point"
  997. })(egret || (egret = {}));
  998. __extends = this.__extends || function(c, d) {
  999. function b() {
  1000. this.constructor = c
  1001. }
  1002. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1003. b.prototype = d.prototype;
  1004. c.prototype = new b
  1005. };
  1006. (function(c) {
  1007. var d = function(b) {
  1008. function a(e, a, c, d) {
  1009. "undefined" === typeof e && (e = 0);
  1010. "undefined" === typeof a && (a = 0);
  1011. "undefined" === typeof c && (c = 0);
  1012. "undefined" === typeof d && (d = 0);
  1013. b.call(this);
  1014. this.x = e;
  1015. this.y = a;
  1016. this.width = c;
  1017. this.height = d
  1018. }
  1019. __extends(a, b);
  1020. Object.defineProperty(a.prototype, "right", {
  1021. get: function() {
  1022. return this.x + this.width
  1023. },
  1024. set: function(e) {
  1025. this.width = e - this.x
  1026. },
  1027. enumerable: !0,
  1028. configurable: !0
  1029. });
  1030. Object.defineProperty(a.prototype, "bottom", {
  1031. get: function() {
  1032. return this.y + this.height
  1033. },
  1034. set: function(e) {
  1035. this.height =
  1036. e - this.y
  1037. },
  1038. enumerable: !0,
  1039. configurable: !0
  1040. });
  1041. a.prototype.initialize = function(e, a, b, c) {
  1042. this.x = e;
  1043. this.y = a;
  1044. this.width = b;
  1045. this.height = c;
  1046. return this
  1047. };
  1048. a.prototype.contains = function(e, a) {
  1049. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1050. };
  1051. a.prototype.intersects = function(e) {
  1052. return this.contains(e.x, e.y) || this.contains(e.x, e.bottom) || this.contains(e.right, e.y) || this.contains(e.right, e.bottom) ? !0 : !1
  1053. };
  1054. a.prototype.clone = function() {
  1055. return new a(this.x, this.y, this.width, this.height)
  1056. };
  1057. a.prototype.containsPoint =
  1058. function(e) {
  1059. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1060. };
  1061. a.identity = new a(0, 0, 0, 0);
  1062. return a
  1063. }(c.HashObject);
  1064. c.Rectangle = d;
  1065. d.prototype.__class__ = "egret.Rectangle"
  1066. })(egret || (egret = {}));
  1067. (function(c) {
  1068. var d = function() {
  1069. function b() {}
  1070. b.fatal = function(a, e) {
  1071. "undefined" === typeof e && (e = null);
  1072. c.Logger.traceToConsole("Fatal", a, e);
  1073. throw Error(c.Logger.getTraceCode("Fatal", a, e));
  1074. };
  1075. b.info = function(a, e) {
  1076. "undefined" === typeof e && (e = null);
  1077. c.Logger.traceToConsole("Info", a, e)
  1078. };
  1079. b.warning = function(a, e) {
  1080. "undefined" === typeof e && (e = null);
  1081. c.Logger.traceToConsole("Warning", a, e)
  1082. };
  1083. b.traceToConsole = function(a, e, g) {
  1084. console.log(c.Logger.getTraceCode(a, e, g))
  1085. };
  1086. b.getTraceCode = function(a, e, g) {
  1087. return "[" + a + "]" + e + ":" +
  1088. (null == g ? "" : g)
  1089. };
  1090. return b
  1091. }();
  1092. c.Logger = d;
  1093. d.prototype.__class__ = "egret.Logger"
  1094. })(egret || (egret = {}));
  1095. __extends = this.__extends || function(c, d) {
  1096. function b() {
  1097. this.constructor = c
  1098. }
  1099. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1100. b.prototype = d.prototype;
  1101. c.prototype = new b
  1102. };
  1103. (function(c) {
  1104. var d = function(b) {
  1105. function a() {
  1106. b.call(this);
  1107. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1108. this._xmlDict = {};
  1109. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1110. }
  1111. __extends(a, b);
  1112. a.getInstance = function() {
  1113. a._instance || (a._instance = new a);
  1114. return a._instance
  1115. };
  1116. a.prototype.parserXML = function(e) {
  1117. for (var a = 0;
  1118. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1119. 0 != a && (e = e.substring(a, e.length));
  1120. this._isSupportDOMParser ?
  1121. a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1122. null == a && c.Logger.info("xml not found!");
  1123. return a
  1124. };
  1125. a._instance = null;
  1126. return a
  1127. }(c.HashObject);
  1128. c.SAXParser = d;
  1129. d.prototype.__class__ = "egret.SAXParser"
  1130. })(egret || (egret = {}));
  1131. __extends = this.__extends || function(c, d) {
  1132. function b() {
  1133. this.constructor = c
  1134. }
  1135. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1136. b.prototype = d.prototype;
  1137. c.prototype = new b
  1138. };
  1139. (function(c) {
  1140. var d = function(e) {
  1141. function g() {
  1142. e.call(this);
  1143. this._designHeight = this._designWidth = 0;
  1144. this._scaleY = this._scaleX = 1;
  1145. var a = document.getElementById(g.canvas_name),
  1146. b = a.height;
  1147. this._designWidth = a.width;
  1148. this._designHeight = b
  1149. }
  1150. __extends(g, e);
  1151. g.getInstance = function() {
  1152. null == g.instance && (a.initialize(), g.instance = new g);
  1153. return g.instance
  1154. };
  1155. g.prototype.setDesignSize = function(e, a, g) {
  1156. this._designWidth = e;
  1157. this._designHeight = a;
  1158. g && (c.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),
  1159. this._setResolutionPolicy(g))
  1160. };
  1161. g.prototype._setResolutionPolicy = function(e) {
  1162. this._resolutionPolicy = e;
  1163. e.init(this);
  1164. e._apply(this, this._designWidth, this._designHeight)
  1165. };
  1166. g.prototype.getScaleX = function() {
  1167. return this._scaleX
  1168. };
  1169. g.prototype.getScaleY = function() {
  1170. return this._scaleY
  1171. };
  1172. g.canvas_name = "gameCanvas";
  1173. g.canvas_div_name = "gameDiv";
  1174. return g
  1175. }(c.HashObject);
  1176. c.StageDelegate = d;
  1177. d.prototype.__class__ = "egret.StageDelegate";
  1178. var b = function() {
  1179. function e(a, g) {
  1180. this.setContainerStrategy(a);
  1181. this.setContentStrategy(g)
  1182. }
  1183. e.prototype.init = function(e) {
  1184. this._containerStrategy.init(e);
  1185. this._contentStrategy.init(e)
  1186. };
  1187. e.prototype._apply = function(e, a, g) {
  1188. this._containerStrategy._apply(e, a, g);
  1189. this._contentStrategy._apply(e, a, g)
  1190. };
  1191. e.prototype.setContainerStrategy = function(e) {
  1192. e instanceof a && (this._containerStrategy = e)
  1193. };
  1194. e.prototype.setContentStrategy = function(e) {
  1195. e instanceof g && (this._contentStrategy = e)
  1196. };
  1197. return e
  1198. }();
  1199. c.ResolutionPolicy = b;
  1200. b.prototype.__class__ = "egret.ResolutionPolicy";
  1201. var a = function() {
  1202. function a() {}
  1203. a.initialize =
  1204. function() {
  1205. a.EQUAL_TO_FRAME = new e
  1206. };
  1207. a.prototype.init = function(e) {};
  1208. a.prototype._apply = function(e, a, g) {};
  1209. a.prototype._setupContainer = function() {
  1210. var e = document.body,
  1211. a;
  1212. e && (a = e.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 =
  1213. a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1214. };
  1215. return a
  1216. }();
  1217. c.ContainerStrategy = a;
  1218. a.prototype.__class__ = "egret.ContainerStrategy";
  1219. var e = function(e) {
  1220. function a() {
  1221. e.apply(this, arguments)
  1222. }
  1223. __extends(a, e);
  1224. a.prototype._apply = function(e) {
  1225. this._setupContainer()
  1226. };
  1227. return a
  1228. }(a);
  1229. c.EqualToFrame = e;
  1230. e.prototype.__class__ = "egret.EqualToFrame";
  1231. var g = function() {
  1232. function e() {}
  1233. e.prototype.init = function(e) {};
  1234. e.prototype._apply = function(e, a, g) {};
  1235. return e
  1236. }();
  1237. c.ContentStrategy =
  1238. g;
  1239. g.prototype.__class__ = "egret.ContentStrategy";
  1240. b = function(e) {
  1241. function a(g) {
  1242. "undefined" === typeof g && (g = 0);
  1243. e.call(this);
  1244. this.minWidth = g
  1245. }
  1246. __extends(a, e);
  1247. a.prototype._apply = function(e, a, g) {
  1248. a = document.getElementById(d.canvas_name);
  1249. var b = document.getElementById(d.canvas_div_name),
  1250. c = document.documentElement.clientWidth,
  1251. q = document.documentElement.clientHeight,
  1252. l = q / g,
  1253. r = c / l,
  1254. s = 1;
  1255. 0 != this.minWidth && (s = Math.min(1, r / this.minWidth));
  1256. a.width = r / s;
  1257. a.height = g;
  1258. a.style.width = c + "px";
  1259. a.style.height = q * s + "px";
  1260. b.style.width =
  1261. c + "px";
  1262. b.style.height = q * s + "px";
  1263. e._scaleX = l * s;
  1264. e._scaleY = l * s
  1265. };
  1266. return a
  1267. }(g);
  1268. c.FixedHeight = b;
  1269. b.prototype.__class__ = "egret.FixedHeight";
  1270. b = function(e) {
  1271. function a(g) {
  1272. "undefined" === typeof g && (g = 0);
  1273. e.call(this);
  1274. this.minHeight = g
  1275. }
  1276. __extends(a, e);
  1277. a.prototype._apply = function(e, a, g) {
  1278. g = document.getElementById(d.canvas_name);
  1279. var b = document.getElementById(d.canvas_div_name),
  1280. c = document.documentElement.clientWidth,
  1281. q = document.documentElement.clientHeight,
  1282. l = c / a,
  1283. r = q / l,
  1284. s = 1;
  1285. 0 != this.minHeight && (s = Math.min(1, r / this.minHeight));
  1286. g.width = a;
  1287. g.height = r / s;
  1288. g.style.width = c * s + "px";
  1289. g.style.height = q + "px";
  1290. b.style.width = c * s + "px";
  1291. b.style.height = q + "px";
  1292. e._scaleX = l * s;
  1293. e._scaleY = l * s
  1294. };
  1295. return a
  1296. }(g);
  1297. c.FixedWidth = b;
  1298. b.prototype.__class__ = "egret.FixedWidth";
  1299. b = function(e) {
  1300. function a(g, b) {
  1301. e.call(this);
  1302. this.width = g;
  1303. this.height = b
  1304. }
  1305. __extends(a, e);
  1306. a.prototype._apply = function(e, a, g) {
  1307. g = document.getElementById(d.canvas_name);
  1308. var b = document.getElementById(d.canvas_div_name),
  1309. c = this.width,
  1310. q = this.height,
  1311. l = c / a;
  1312. g.width = a;
  1313. g.height = q / l;
  1314. g.style.width = c + "px";
  1315. g.style.height =
  1316. q + "px";
  1317. b.style.width = c + "px";
  1318. b.style.height = q + "px";
  1319. e._scaleX = l;
  1320. e._scaleY = l
  1321. };
  1322. return a
  1323. }(g);
  1324. c.FixedSize = b;
  1325. b.prototype.__class__ = "egret.FixedSize";
  1326. b = function(e) {
  1327. function a() {
  1328. e.call(this)
  1329. }
  1330. __extends(a, e);
  1331. a.prototype._apply = function(e, a, g) {
  1332. a = document.getElementById(d.canvas_name);
  1333. a.style.width = a.width + "px";
  1334. a.style.height = a.height + "px";
  1335. e._scaleX = 1;
  1336. e._scaleY = 1
  1337. };
  1338. return a
  1339. }(g);
  1340. c.NoScale = b;
  1341. b.prototype.__class__ = "egret.NoScale"
  1342. })(egret || (egret = {}));
  1343. __extends = this.__extends || function(c, d) {
  1344. function b() {
  1345. this.constructor = c
  1346. }
  1347. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1348. b.prototype = d.prototype;
  1349. c.prototype = new b
  1350. };
  1351. (function(c) {
  1352. var d = function(b) {
  1353. function a() {
  1354. b.call(this);
  1355. this._originalData = {};
  1356. this._drawAreaList = []
  1357. }
  1358. __extends(a, b);
  1359. a.getInstance = function() {
  1360. null == a.instance && (a.instance = new a);
  1361. return a.instance
  1362. };
  1363. a.prototype.addDrawArea = function(e) {
  1364. this._drawAreaList.push(e)
  1365. };
  1366. a.prototype.clearDrawArea = function() {
  1367. this._drawAreaList = []
  1368. };
  1369. a.prototype.drawImage = function(e, a, b, d, f, h, k, m, n, p) {
  1370. k = k || 0;
  1371. m = m || 0;
  1372. var t = a._texture_to_render;
  1373. if (null != t && 0 != h && 0 != f && 0 != n && 0 != p)
  1374. if (a._worldBounds) {
  1375. var r = this._originalData;
  1376. r.sourceX =
  1377. b;
  1378. r.sourceY = d;
  1379. r.sourceWidth = f;
  1380. r.sourceHeight = h;
  1381. r.destX = k;
  1382. r.destY = m;
  1383. r.destWidth = n;
  1384. r.destHeight = p;
  1385. for (var s = this.getDrawAreaList(), u = 0; u < s.length; u++) {
  1386. var v = s[u];
  1387. if (!this.ignoreRender(a, v, r.destX, r.destY)) {
  1388. if (0 != this._drawAreaList.length)
  1389. if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1390. if (a._worldBounds.x + r.destX < v.x || a._worldBounds.y + r.destY < v.y || a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width || a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height) {
  1391. c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1392. break
  1393. }
  1394. } else {
  1395. var x = a._worldTransform.a,
  1396. y = a._worldTransform.d,
  1397. w;
  1398. a._worldBounds.x + r.destX < v.x && (w = (v.x - a._worldBounds.x) / x - r.destX, b += w / (n / f), f -= w / (n / f), n -= w, k += w);
  1399. a._worldBounds.y + r.destY < v.y && (w = (v.y - a._worldBounds.y) / y - r.destY, d += w / (p / h), h -= w / (p / h), p -= w, m += w);
  1400. a._worldBounds.x + a._worldBounds.width + r.destX > v.x + v.width && (w = (a._worldBounds.x + a._worldBounds.width - v.x - v.width) / x + r.destX, f -= w / (n / f), n -= w);
  1401. a._worldBounds.y + a._worldBounds.height + r.destY > v.y + v.height && (w = (a._worldBounds.y + a._worldBounds.height -
  1402. v.y - v.height) / y + r.destY, h -= w / (p / h), p -= w)
  1403. }
  1404. e.drawImage(t, b, d, f, h, k, m, n, p)
  1405. }
  1406. }
  1407. } else e.drawImage(t, b, d, f, h, k, m, n, p)
  1408. };
  1409. a.prototype.ignoreRender = function(e, a, b, c) {
  1410. var d = e._worldBounds;
  1411. b *= e._worldTransform.a;
  1412. c *= e._worldTransform.d;
  1413. return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + c <= a.y || d.y + c >= a.y + a.height ? !0 : !1
  1414. };
  1415. a.prototype.getDrawAreaList = function() {
  1416. var e;
  1417. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth,
  1418. c.MainContext.instance.stage.stageHeight)]), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1419. return e
  1420. };
  1421. return a
  1422. }(c.HashObject);
  1423. c.RenderFilter = d;
  1424. d.prototype.__class__ = "egret.RenderFilter"
  1425. })(egret || (egret = {}));
  1426. (function(c) {
  1427. var d = function() {
  1428. function b() {}
  1429. b.mapClass = function(a, e, g) {
  1430. "undefined" === typeof g && (g = "");
  1431. a = this.getKey(a) + "#" + g;
  1432. this.mapClassDic[a] = e
  1433. };
  1434. b.getKey = function(a) {
  1435. return "string" == typeof a ? a : c.getQualifiedClassName(a)
  1436. };
  1437. b.mapValue = function(a, e, g) {
  1438. "undefined" === typeof g && (g = "");
  1439. a = this.getKey(a) + "#" + g;
  1440. this.mapValueDic[a] = e
  1441. };
  1442. b.hasMapRule = function(a, e) {
  1443. "undefined" === typeof e && (e = "");
  1444. var g = this.getKey(a) + "#" + e;
  1445. return this.mapValueDic[g] || this.mapClassDic[g] ? !0 : !1
  1446. };
  1447. b.getInstance = function(a, e) {
  1448. "undefined" ===
  1449. typeof e && (e = "");
  1450. var g = this.getKey(a) + "#" + e;
  1451. if (this.mapValueDic[g]) return this.mapValueDic[g];
  1452. var b = this.mapClassDic[g];
  1453. if (b) return b = new b, this.mapValueDic[g] = b, delete this.mapClassDic[g], b;
  1454. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + g + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1455. };
  1456. b.mapClassDic = {};
  1457. b.mapValueDic = {};
  1458. return b
  1459. }();
  1460. c.Injector =
  1461. d;
  1462. d.prototype.__class__ = "egret.Injector"
  1463. })(egret || (egret = {}));
  1464. (function(c) {
  1465. var d = function() {
  1466. function b() {}
  1467. b.NORMAL = "normal";
  1468. b.ADD = "add";
  1469. b.LAYER = "layer";
  1470. return b
  1471. }();
  1472. c.BlendMode = d;
  1473. d.prototype.__class__ = "egret.BlendMode"
  1474. })(egret || (egret = {}));
  1475. __extends = this.__extends || function(c, d) {
  1476. function b() {
  1477. this.constructor = c
  1478. }
  1479. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1480. b.prototype = d.prototype;
  1481. c.prototype = new b
  1482. };
  1483. (function(c) {
  1484. var d = function(b) {
  1485. function a() {
  1486. b.call(this);
  1487. this._sizeDirty = this._normalDirty = !0;
  1488. this._parent = null;
  1489. this._cacheAsBitmap = !1;
  1490. this._y = this._x = 0;
  1491. this._scaleY = this._scaleX = 1;
  1492. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1493. this._visible = !0;
  1494. this._rotation = 0;
  1495. this._alpha = 1;
  1496. this._skewY = this._skewX = 0;
  1497. this._hasHeightSet = this._hasWidthSet = !1;
  1498. this.worldAlpha = 1;
  1499. this._rectH = this._rectW = 0;
  1500. this._worldTransform = new c.Matrix;
  1501. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1502. }
  1503. __extends(a, b);
  1504. a.prototype._setDirty = function() {
  1505. this._normalDirty = !0
  1506. };
  1507. a.prototype.getDirty = function() {
  1508. return this._normalDirty || this._sizeDirty
  1509. };
  1510. a.prototype._setParentSizeDirty = function() {
  1511. !this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  1512. };
  1513. a.prototype._setSizeDirty = function() {
  1514. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  1515. };
  1516. a.prototype._clearDirty = function() {
  1517. this._normalDirty = !1
  1518. };
  1519. a.prototype._clearSizeDirty = function() {
  1520. this._sizeDirty = !1
  1521. };
  1522. Object.defineProperty(a.prototype, "parent", {
  1523. get: function() {
  1524. return this._parent
  1525. },
  1526. enumerable: !0,
  1527. configurable: !0
  1528. });
  1529. a.prototype._parentChanged = function(e) {
  1530. this._parent = e
  1531. };
  1532. Object.defineProperty(a.prototype, "x", {
  1533. get: function() {
  1534. return this._x
  1535. },
  1536. set: function(e) {
  1537. c.NumberUtils.isNumber(e) && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1538. },
  1539. enumerable: !0,
  1540. configurable: !0
  1541. });
  1542. Object.defineProperty(a.prototype, "y", {
  1543. get: function() {
  1544. return this._y
  1545. },
  1546. set: function(e) {
  1547. c.NumberUtils.isNumber(e) && (this._y = e, this._setDirty(),
  1548. this._setParentSizeDirty())
  1549. },
  1550. enumerable: !0,
  1551. configurable: !0
  1552. });
  1553. Object.defineProperty(a.prototype, "scaleX", {
  1554. get: function() {
  1555. return this._scaleX
  1556. },
  1557. set: function(e) {
  1558. c.NumberUtils.isNumber(e) && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1559. },
  1560. enumerable: !0,
  1561. configurable: !0
  1562. });
  1563. Object.defineProperty(a.prototype, "scaleY", {
  1564. get: function() {
  1565. return this._scaleY
  1566. },
  1567. set: function(e) {
  1568. c.NumberUtils.isNumber(e) && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1569. },
  1570. enumerable: !0,
  1571. configurable: !0
  1572. });
  1573. Object.defineProperty(a.prototype,
  1574. "anchorOffsetX", {
  1575. get: function() {
  1576. return this._anchorOffsetX
  1577. },
  1578. set: function(e) {
  1579. c.NumberUtils.isNumber(e) && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1580. },
  1581. enumerable: !0,
  1582. configurable: !0
  1583. });
  1584. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1585. get: function() {
  1586. return this._anchorOffsetY
  1587. },
  1588. set: function(e) {
  1589. c.NumberUtils.isNumber(e) && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1590. },
  1591. enumerable: !0,
  1592. configurable: !0
  1593. });
  1594. Object.defineProperty(a.prototype, "anchorX", {
  1595. get: function() {
  1596. return this._anchorX
  1597. },
  1598. set: function(e) {
  1599. c.NumberUtils.isNumber(e) && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1600. },
  1601. enumerable: !0,
  1602. configurable: !0
  1603. });
  1604. Object.defineProperty(a.prototype, "anchorY", {
  1605. get: function() {
  1606. return this._anchorY
  1607. },
  1608. set: function(e) {
  1609. c.NumberUtils.isNumber(e) && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1610. },
  1611. enumerable: !0,
  1612. configurable: !0
  1613. });
  1614. Object.defineProperty(a.prototype, "visible", {
  1615. get: function() {
  1616. return this._visible
  1617. },
  1618. set: function(e) {
  1619. this._visible = e;
  1620. this._setSizeDirty()
  1621. },
  1622. enumerable: !0,
  1623. configurable: !0
  1624. });
  1625. Object.defineProperty(a.prototype, "rotation", {
  1626. get: function() {
  1627. return this._rotation
  1628. },
  1629. set: function(e) {
  1630. c.NumberUtils.isNumber(e) && (this._rotation = e, this._setSizeDirty())
  1631. },
  1632. enumerable: !0,
  1633. configurable: !0
  1634. });
  1635. Object.defineProperty(a.prototype, "alpha", {
  1636. get: function() {
  1637. return this._alpha
  1638. },
  1639. set: function(e) {
  1640. c.NumberUtils.isNumber(e) && (this._alpha = e, this._setDirty())
  1641. },
  1642. enumerable: !0,
  1643. configurable: !0
  1644. });
  1645. Object.defineProperty(a.prototype, "skewX", {
  1646. get: function() {
  1647. return this._skewX
  1648. },
  1649. set: function(e) {
  1650. c.NumberUtils.isNumber(e) &&
  1651. (this._skewX = e, this._setSizeDirty())
  1652. },
  1653. enumerable: !0,
  1654. configurable: !0
  1655. });
  1656. Object.defineProperty(a.prototype, "skewY", {
  1657. get: function() {
  1658. return this._skewY
  1659. },
  1660. set: function(e) {
  1661. c.NumberUtils.isNumber(e) && (this._skewY = e, this._setSizeDirty())
  1662. },
  1663. enumerable: !0,
  1664. configurable: !0
  1665. });
  1666. Object.defineProperty(a.prototype, "touchEnabled", {
  1667. get: function() {
  1668. return this._touchEnabled
  1669. },
  1670. set: function(e) {
  1671. this._touchEnabled = e
  1672. },
  1673. enumerable: !0,
  1674. configurable: !0
  1675. });
  1676. Object.defineProperty(a.prototype, "scrollRect", {
  1677. get: function() {
  1678. return this._scrollRect
  1679. },
  1680. set: function(e) {
  1681. this._scrollRect = e;
  1682. this._setSizeDirty()
  1683. },
  1684. enumerable: !0,
  1685. configurable: !0
  1686. });
  1687. Object.defineProperty(a.prototype, "measuredWidth", {
  1688. get: function() {
  1689. return this._measureBounds().width
  1690. },
  1691. enumerable: !0,
  1692. configurable: !0
  1693. });
  1694. Object.defineProperty(a.prototype, "measuredHeight", {
  1695. get: function() {
  1696. return this._measureBounds().height
  1697. },
  1698. enumerable: !0,
  1699. configurable: !0
  1700. });
  1701. Object.defineProperty(a.prototype, "explicitWidth", {
  1702. get: function() {
  1703. return this._explicitWidth
  1704. },
  1705. enumerable: !0,
  1706. configurable: !0
  1707. });
  1708. Object.defineProperty(a.prototype,
  1709. "explicitHeight", {
  1710. get: function() {
  1711. return this._explicitHeight
  1712. },
  1713. enumerable: !0,
  1714. configurable: !0
  1715. });
  1716. Object.defineProperty(a.prototype, "width", {
  1717. get: function() {
  1718. return this._getSize(c.Rectangle.identity).width
  1719. },
  1720. set: function(e) {
  1721. this._setWidth(e)
  1722. },
  1723. enumerable: !0,
  1724. configurable: !0
  1725. });
  1726. Object.defineProperty(a.prototype, "height", {
  1727. get: function() {
  1728. return this._getSize(c.Rectangle.identity).height
  1729. },
  1730. set: function(e) {
  1731. this._setHeight(e)
  1732. },
  1733. enumerable: !0,
  1734. configurable: !0
  1735. });
  1736. a.prototype._setWidth = function(e) {
  1737. this._setSizeDirty();
  1738. this._explicitWidth = e;
  1739. this._hasWidthSet = c.NumberUtils.isNumber(e)
  1740. };
  1741. a.prototype._setHeight = function(e) {
  1742. this._setSizeDirty();
  1743. this._explicitHeight = e;
  1744. this._hasHeightSet = c.NumberUtils.isNumber(e)
  1745. };
  1746. a.prototype._draw = function(e) {
  1747. if (this.visible && !this.drawCacheTexture(e)) {
  1748. e.setAlpha(this.worldAlpha, this.blendMode);
  1749. e.setTransform(this._worldTransform);
  1750. var a = this.mask || this._scrollRect;
  1751. a && e.pushMask(a);
  1752. this._render(e);
  1753. a && e.popMask()
  1754. }
  1755. this.destroyCacheBounds()
  1756. };
  1757. a.prototype.drawCacheTexture = function(e) {
  1758. if (this._cacheAsBitmap) {
  1759. var a =
  1760. this._texture_to_render,
  1761. b = a._offsetX,
  1762. d = a._offsetY,
  1763. f = a._textureWidth,
  1764. a = a._textureHeight;
  1765. this._updateTransform();
  1766. e.setAlpha(this.worldAlpha, this.blendMode);
  1767. e.setTransform(this._worldTransform);
  1768. var h = c.MainContext.instance.rendererContext.texture_scale_factor;
  1769. c.RenderFilter.getInstance().drawImage(e, this, 0, 0, f * h, a * h, b, d, f, a);
  1770. return !0
  1771. }
  1772. return !1
  1773. };
  1774. a.prototype._updateTransform = function() {
  1775. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1776. var e = this._getOffsetPoint();
  1777. this._worldTransform.appendTransform(this._x,
  1778. this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, e.x, e.y);
  1779. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1780. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1781. };
  1782. a.prototype._render = function(e) {};
  1783. a.prototype.getBounds = function(e) {
  1784. var a = this._measureBounds(),
  1785. b = this._hasWidthSet ? this._explicitWidth : a.width,
  1786. d = this._hasHeightSet ? this._explicitHeight : a.height,
  1787. f = a.x,
  1788. a = a.y,
  1789. h, k;
  1790. 0 != this._anchorX || 0 != this._anchorY ? (h = b * this._anchorX, k = d * this._anchorY) :
  1791. (h = this._anchorOffsetX, k = this._anchorOffsetY);
  1792. this._cacheBounds.initialize(f - h, a - k, b, d);
  1793. b = this._cacheBounds;
  1794. e || (e = new c.Rectangle);
  1795. return e.initialize(b.x, b.y, b.width, b.height)
  1796. };
  1797. a.prototype.destroyCacheBounds = function() {
  1798. this._cacheBounds.x = 0;
  1799. this._cacheBounds.y = 0;
  1800. this._cacheBounds.width = 0;
  1801. this._cacheBounds.height = 0
  1802. };
  1803. a.prototype._getConcatenatedMatrix = function() {
  1804. for (var e = a.identityMatrixForGetConcatenated.identity(), g = this; null != g;) {
  1805. if (0 != g._anchorX || 0 != g._anchorY) {
  1806. var b = g._getSize(c.Rectangle.identity);
  1807. e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, b.width * g._anchorX, b.height * g._anchorY)
  1808. } else e.prependTransform(g._x, g._y, g._scaleX, g._scaleY, g._rotation, g._skewX, g._skewY, g._anchorOffsetX, g._anchorOffsetY);
  1809. g = g._parent
  1810. }
  1811. return e
  1812. };
  1813. a.prototype.localToGlobal = function(e, a, b) {
  1814. "undefined" === typeof e && (e = 0);
  1815. "undefined" === typeof a && (a = 0);
  1816. var d = this._getConcatenatedMatrix();
  1817. d.append(1, 0, 0, 1, e, a);
  1818. b || (b = new c.Point);
  1819. b.x = d.tx;
  1820. b.y = d.ty;
  1821. return b
  1822. };
  1823. a.prototype.globalToLocal = function(e,
  1824. a, b) {
  1825. "undefined" === typeof e && (e = 0);
  1826. "undefined" === typeof a && (a = 0);
  1827. var d = this._getConcatenatedMatrix();
  1828. d.invert();
  1829. d.append(1, 0, 0, 1, e, a);
  1830. b || (b = new c.Point);
  1831. b.x = d.tx;
  1832. b.y = d.ty;
  1833. return b
  1834. };
  1835. a.prototype.hitTest = function(e, a, b) {
  1836. "undefined" === typeof b && (b = !1);
  1837. if (!this.visible || !b && !this._touchEnabled) return null;
  1838. b = this._getSize(c.Rectangle.identity);
  1839. return 0 <= e && e < b.width && 0 <= a && a < b.height ? this.mask || this._scrollRect ? this._scrollRect && e < this._scrollRect.width && a < this._scrollRect.height || this.mask && this.mask.x <=
  1840. e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this : null : this : null
  1841. };
  1842. a.prototype.hitTestPoint = function(e, a, b) {
  1843. e = this.globalToLocal(e, a);
  1844. return b ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), b = this._hitTestPointTexture, b.drawToTexture(this), 0 != b.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  1845. };
  1846. a.prototype._getMatrix = function() {
  1847. var e = c.Matrix.identity.identity(),
  1848. a = this._getOffsetPoint();
  1849. e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1850. return e
  1851. };
  1852. a.prototype._getSize = function(e) {
  1853. return this._hasHeightSet && this._hasWidthSet ? e.initialize(0, 0, this._explicitWidth, this._explicitHeight) : this._measureSize(c.Rectangle.identity)
  1854. };
  1855. a.prototype._measureSize = function(e) {
  1856. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  1857. return e
  1858. };
  1859. a.prototype._measureBounds = function() {
  1860. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  1861. };
  1862. a.prototype._getOffsetPoint = function() {
  1863. var e = this._anchorOffsetX,
  1864. a = this._anchorOffsetY;
  1865. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity), e = this._anchorX * a.width, a = this._anchorY * a.height;
  1866. var b = c.Point.identity;
  1867. b.x = e;
  1868. b.y = a;
  1869. return b
  1870. };
  1871. a.prototype._onAddToStage = function() {
  1872. this._stage = c.MainContext.instance.stage;
  1873. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1874. };
  1875. a.prototype._onRemoveFromStage =
  1876. function() {
  1877. this._stage = null;
  1878. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1879. };
  1880. Object.defineProperty(a.prototype, "stage", {
  1881. get: function() {
  1882. return this._stage
  1883. },
  1884. enumerable: !0,
  1885. configurable: !0
  1886. });
  1887. a.prototype.addEventListener = function(e, g, d, l, f) {
  1888. "undefined" === typeof l && (l = !1);
  1889. "undefined" === typeof f && (f = 0);
  1890. b.prototype.addEventListener.call(this, e, g, d, l, f);
  1891. ((l = e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._insertEventBin(l ? a._enterFrameCallBackList : a._renderCallBackList, g, d, f)
  1892. };
  1893. a.prototype.removeEventListener =
  1894. function(e, g, d, l) {
  1895. "undefined" === typeof l && (l = !1);
  1896. b.prototype.removeEventListener.call(this, e, g, d, l);
  1897. ((l = e == c.Event.ENTER_FRAME) || e == c.Event.RENDER) && this._removeEventBin(l ? a._enterFrameCallBackList : a._renderCallBackList, g, d)
  1898. };
  1899. a.prototype.dispatchEvent = function(e) {
  1900. if (!e._bubbles) return b.prototype.dispatchEvent.call(this, e);
  1901. for (var a = [], c = this; c;) a.unshift(c), c = c.parent;
  1902. for (var d = a.length, c = d - 1, d = d - 2; 0 <= d; d--) a.push(a[d]);
  1903. e._reset();
  1904. this._dispatchPropagationEvent(e, a, c);
  1905. return !e.isDefaultPrevented()
  1906. };
  1907. a.prototype._dispatchPropagationEvent = function(a, g, b) {
  1908. for (var c = g.length, d = 0; d < c; d++) {
  1909. var h = g[d];
  1910. a._setCurrentTarget(h);
  1911. a._target = this;
  1912. a._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  1913. h._notifyListener(a);
  1914. if (a._isPropagationStopped || a._isPropagationImmediateStopped) break
  1915. }
  1916. };
  1917. a.prototype.willTrigger = function(a) {
  1918. for (var g = this; g;) {
  1919. if (g.hasEventListener(a)) return !0;
  1920. g = g._parent
  1921. }
  1922. return !1
  1923. };
  1924. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1925. get: function() {
  1926. return this._cacheAsBitmap
  1927. },
  1928. set: function(a) {
  1929. (this._cacheAsBitmap = a) ? (this.renderTexture ||
  1930. (this.renderTexture = new c.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1931. },
  1932. enumerable: !0,
  1933. configurable: !0
  1934. });
  1935. a.getTransformBounds = function(a, g) {
  1936. var b, c, d = a.width,
  1937. h = a.height,
  1938. k = d * g.a,
  1939. d = d * g.b,
  1940. m = h * g.c,
  1941. h = h * g.d,
  1942. n = g.tx,
  1943. p = g.ty,
  1944. t = n,
  1945. r = n,
  1946. s = p,
  1947. u = p;
  1948. (b = k + n) < t ? t = b : b > r && (r = b);
  1949. (b = k + m + n) < t ? t = b : b > r && (r = b);
  1950. (b = m + n) < t ? t = b : b > r && (r = b);
  1951. (c = d + p) < s ? s = c : c > u && (u = c);
  1952. (c = d + h + p) < s ? s = c : c > u && (u = c);
  1953. (c = h + p) < s ? s = c : c > u && (u = c);
  1954. return a.initialize(t, s, r - t, u - s)
  1955. };
  1956. a.identityMatrixForGetConcatenated =
  1957. new c.Matrix;
  1958. a._enterFrameCallBackList = [];
  1959. a._renderCallBackList = [];
  1960. return a
  1961. }(c.EventDispatcher);
  1962. c.DisplayObject = d;
  1963. d.prototype.__class__ = "egret.DisplayObject"
  1964. })(egret || (egret = {}));
  1965. __extends = this.__extends || function(c, d) {
  1966. function b() {
  1967. this.constructor = c
  1968. }
  1969. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  1970. b.prototype = d.prototype;
  1971. c.prototype = new b
  1972. };
  1973. (function(c) {
  1974. var d = function(b) {
  1975. function a() {
  1976. b.call(this);
  1977. this._touchChildren = !0;
  1978. this._children = []
  1979. }
  1980. __extends(a, b);
  1981. Object.defineProperty(a.prototype, "touchChildren", {
  1982. get: function() {
  1983. return this._touchChildren
  1984. },
  1985. set: function(a) {
  1986. this._touchChildren = a
  1987. },
  1988. enumerable: !0,
  1989. configurable: !0
  1990. });
  1991. Object.defineProperty(a.prototype, "numChildren", {
  1992. get: function() {
  1993. return this._children.length
  1994. },
  1995. enumerable: !0,
  1996. configurable: !0
  1997. });
  1998. a.prototype.setChildIndex = function(a, g) {
  1999. this.doSetChildIndex(a, g)
  2000. };
  2001. a.prototype.doSetChildIndex = function(a,
  2002. g) {
  2003. var b = this._children.indexOf(a);
  2004. 0 > b && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  2005. this._children.splice(b, 1);
  2006. 0 > g || this._children.length <= g ? this._children.push(a) : this._children.splice(g, 0, a)
  2007. };
  2008. a.prototype.addChild = function(a) {
  2009. var g = this.numChildren;
  2010. a._parent == this && g--;
  2011. return this._doAddChild(a, g)
  2012. };
  2013. a.prototype.addChildAt = function(a, g) {
  2014. return this._doAddChild(a, g)
  2015. };
  2016. a.prototype._doAddChild = function(e, g, b) {
  2017. "undefined" === typeof b && (b = !0);
  2018. if (e == this) return e;
  2019. if (0 > g || g > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  2020. e;
  2021. var d = e.parent;
  2022. if (d == this) return this.doSetChildIndex(e, g), e;
  2023. d && d.removeChild(e);
  2024. this._children.splice(g, 0, e);
  2025. e._parentChanged(this);
  2026. b && e.dispatchEventWith(c.Event.ADDED, !0);
  2027. if (this._stage)
  2028. for (e._onAddToStage(), g = a.__EVENT__ADD_TO_STAGE_LIST; 0 < g.length;) g.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  2029. e._setDirty();
  2030. this._setSizeDirty();
  2031. return e
  2032. };
  2033. a.prototype.removeChild = function(a) {
  2034. a = this._children.indexOf(a);
  2035. if (0 <= a) return this._doRemoveChild(a);
  2036. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  2037. return null
  2038. };
  2039. a.prototype.removeChildAt = function(a) {
  2040. if (0 <= a && a < this._children.length) return this._doRemoveChild(a);
  2041. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2042. return null
  2043. };
  2044. a.prototype._doRemoveChild = function(e, g) {
  2045. "undefined" === typeof g && (g = !0);
  2046. var b = this._children,
  2047. d = b[e];
  2048. g && d.dispatchEventWith(c.Event.REMOVED, !0);
  2049. if (this._stage) {
  2050. d._onRemoveFromStage();
  2051. for (var f = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) f.shift().dispatchEventWith(c.Event.REMOVED_FROM_STAGE)
  2052. }
  2053. d._parentChanged(null);
  2054. b.splice(e, 1);
  2055. this._setSizeDirty();
  2056. return d
  2057. };
  2058. a.prototype.getChildAt = function(a) {
  2059. if (0 <= a && a < this._children.length) return this._children[a];
  2060. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  2061. return null
  2062. };
  2063. a.prototype.contains = function(a) {
  2064. for (; a;) {
  2065. if (a == this) return !0;
  2066. a = a._parent
  2067. }
  2068. return !1
  2069. };
  2070. a.prototype.swapChildrenAt = function(a, g) {
  2071. 0 <= a && a < this._children.length && 0 <= g && g < this._children.length ? this._swapChildrenAt(a, g) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  2072. };
  2073. a.prototype.swapChildren = function(a, g) {
  2074. var b = this._children.indexOf(a),
  2075. d = this._children.indexOf(g); - 1 == b || -1 == d ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(b, d)
  2076. };
  2077. a.prototype._swapChildrenAt = function(a, g) {
  2078. if (a != g) {
  2079. var b = this._children,
  2080. c = b[a];
  2081. b[a] = b[g];
  2082. b[g] = c
  2083. }
  2084. };
  2085. a.prototype.getChildIndex = function(a) {
  2086. return this._children.indexOf(a)
  2087. };
  2088. a.prototype.removeChildren = function() {
  2089. for (var a = this._children.length - 1; 0 <= a; a--) this._doRemoveChild(a)
  2090. };
  2091. a.prototype._updateTransform =
  2092. function() {
  2093. if (this.visible) {
  2094. b.prototype._updateTransform.call(this);
  2095. for (var a = 0, g = this._children.length; a < g; a++) this._children[a]._updateTransform()
  2096. }
  2097. };
  2098. a.prototype._render = function(a) {
  2099. for (var g = 0, b = this._children.length; g < b; g++) this._children[g]._draw(a)
  2100. };
  2101. a.prototype._measureBounds = function() {
  2102. for (var a = 0, g = 0, b = 0, d = 0, f = this._children.length, h = 0; h < f; h++) {
  2103. var k = this._children[h],
  2104. m;
  2105. if (k.visible && (m = c.DisplayObject.getTransformBounds(k._getSize(c.Rectangle.identity), k._getMatrix()))) {
  2106. var k = m.x,
  2107. n = m.y,
  2108. p =
  2109. m.width + m.x,
  2110. t = m.height + m.y;
  2111. if (k < a || 0 == h) a = k;
  2112. if (p > g || 0 == h) g = p;
  2113. if (n < b || 0 == h) b = n;
  2114. if (t > d || 0 == h) d = t
  2115. }
  2116. }
  2117. return c.Rectangle.identity.initialize(a, b, g - a, d - b)
  2118. };
  2119. a.prototype.hitTest = function(a, g, d) {
  2120. "undefined" === typeof d && (d = !1);
  2121. var l;
  2122. if (!this.visible) return null;
  2123. if (this._scrollRect) {
  2124. if (0 > a || 0 > g || a > this._scrollRect.width || g > this._scrollRect.height) return null
  2125. } else if (this.mask && (this.mask.x > a || a > this.mask.x + this.mask.width || this.mask.y > g || g > this.mask.y + this.mask.height)) return null;
  2126. for (var f = this._children, h =
  2127. this._touchChildren, k = f.length - 1; 0 <= k; k--) {
  2128. var m = f[k],
  2129. n = m,
  2130. p = n._getOffsetPoint(),
  2131. t = n._x,
  2132. r = n._y;
  2133. this._scrollRect && (t -= this._scrollRect.x, r -= this._scrollRect.y);
  2134. n = c.Matrix.identity.identity().prependTransform(t, r, n._scaleX, n._scaleY, n._rotation, 0, 0, p.x, p.y);
  2135. n.invert();
  2136. n = c.Matrix.transformCoords(n, a, g);
  2137. if (m = m.hitTest(n.x, n.y, !0)) {
  2138. if (m._touchEnabled && h) return m;
  2139. if (this._touchEnabled) return this;
  2140. null == l && (l = m)
  2141. }
  2142. }
  2143. return l ? l : b.prototype.hitTest.call(this, a, g, d)
  2144. };
  2145. a.prototype._onAddToStage = function() {
  2146. b.prototype._onAddToStage.call(this);
  2147. for (var a = this.numChildren, g = 0; g < a; g++) this._children[g]._onAddToStage()
  2148. };
  2149. a.prototype._onRemoveFromStage = function() {
  2150. b.prototype._onRemoveFromStage.call(this);
  2151. for (var a = this.numChildren, g = 0; g < a; g++) this._children[g]._onRemoveFromStage()
  2152. };
  2153. a.prototype.getChildByName = function(a) {
  2154. for (var g = this._children, b = this.numChildren, c, d = 0; d < b; d++)
  2155. if (c = g[d], c.name == a) return c;
  2156. return null
  2157. };
  2158. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2159. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2160. return a
  2161. }(c.DisplayObject);
  2162. c.DisplayObjectContainer = d;
  2163. d.prototype.__class__ =
  2164. "egret.DisplayObjectContainer"
  2165. })(egret || (egret = {}));
  2166. __extends = this.__extends || function(c, d) {
  2167. function b() {
  2168. this.constructor = c
  2169. }
  2170. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2171. b.prototype = d.prototype;
  2172. c.prototype = new b
  2173. };
  2174. (function(c) {
  2175. var d = function(b) {
  2176. function a(a, g) {
  2177. "undefined" === typeof a && (a = 480);
  2178. "undefined" === typeof g && (g = 800);
  2179. b.call(this);
  2180. this.touchEnabled = !0;
  2181. this._stage = this;
  2182. this._stageWidth = a;
  2183. this._stageHeight = g
  2184. }
  2185. __extends(a, b);
  2186. a.prototype.invalidate = function() {
  2187. a._invalidateRenderFlag = !0
  2188. };
  2189. Object.defineProperty(a.prototype, "scaleMode", {
  2190. get: function() {
  2191. return this._scaleMode
  2192. },
  2193. set: function(a) {
  2194. if (this._scaleMode != a) {
  2195. this._scaleMode = a;
  2196. var g = {};
  2197. g[c.StageScaleMode.NO_SCALE] = new c.NoScale;
  2198. g[c.StageScaleMode.SHOW_ALL] =
  2199. new c.FixedWidth;
  2200. a = g[a];
  2201. if (!a) throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode");
  2202. g = new c.EqualToFrame;
  2203. a = new c.ResolutionPolicy(g, a);
  2204. c.StageDelegate.getInstance()._setResolutionPolicy(a);
  2205. a = document.getElementById(c.StageDelegate.canvas_name);
  2206. this._stageWidth = a.width;
  2207. this._stageHeight = a.height;
  2208. this.dispatchEventWith(c.Event.RESIZE)
  2209. }
  2210. },
  2211. enumerable: !0,
  2212. configurable: !0
  2213. });
  2214. Object.defineProperty(a.prototype, "stageWidth", {
  2215. get: function() {
  2216. return this._stageWidth
  2217. },
  2218. enumerable: !0,
  2219. configurable: !0
  2220. });
  2221. Object.defineProperty(a.prototype, "stageHeight", {
  2222. get: function() {
  2223. return this._stageHeight
  2224. },
  2225. enumerable: !0,
  2226. configurable: !0
  2227. });
  2228. a.prototype.hitTest = function(a, g) {
  2229. if (!this.touchEnabled) return null;
  2230. var b;
  2231. if (!this.visible) return this;
  2232. for (var d = this._children, f = d.length - 1; 0 <= f; f--) {
  2233. var h = b = d[f],
  2234. k = h._getOffsetPoint(),
  2235. h = c.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, k.x, k.y);
  2236. h.invert();
  2237. h = c.Matrix.transformCoords(h, a, g);
  2238. if ((b = b.hitTest(h.x, h.y, !0)) && b.touchEnabled) return b
  2239. }
  2240. return this
  2241. };
  2242. a.prototype.getBounds = function(a) {
  2243. a || (a = new c.Rectangle);
  2244. return a.initialize(0, 0, this._stageWidth, this._stageHeight)
  2245. };
  2246. a.prototype._updateTransform = function() {
  2247. for (var a = 0, g = this._children.length; a < g; a++) this._children[a]._updateTransform()
  2248. };
  2249. a._invalidateRenderFlag = !1;
  2250. return a
  2251. }(c.DisplayObjectContainer);
  2252. c.Stage = d;
  2253. d.prototype.__class__ = "egret.Stage"
  2254. })(egret || (egret = {}));
  2255. (function(c) {
  2256. var d = function() {
  2257. function b() {}
  2258. b.NO_SCALE = "noScale";
  2259. b.SHOW_ALL = "showAll";
  2260. return b
  2261. }();
  2262. c.StageScaleMode = d;
  2263. d.prototype.__class__ = "egret.StageScaleMode"
  2264. })(egret || (egret = {}));
  2265. (function(c) {
  2266. var d = function() {
  2267. function b() {}
  2268. b.REPEAT = "repeat";
  2269. b.SCALE = "scale";
  2270. return b
  2271. }();
  2272. c.BitmapFillMode = d;
  2273. d.prototype.__class__ = "egret.BitmapFillMode"
  2274. })(egret || (egret = {}));
  2275. __extends = this.__extends || function(c, d) {
  2276. function b() {
  2277. this.constructor = c
  2278. }
  2279. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2280. b.prototype = d.prototype;
  2281. c.prototype = new b
  2282. };
  2283. (function(c) {
  2284. var d = function(b) {
  2285. function a(a) {
  2286. b.call(this);
  2287. this.debug = !1;
  2288. this.debugColor = 16711680;
  2289. this.fillMode = "scale";
  2290. a && (this._texture = a, this._setSizeDirty())
  2291. }
  2292. __extends(a, b);
  2293. Object.defineProperty(a.prototype, "texture", {
  2294. get: function() {
  2295. return this._texture
  2296. },
  2297. set: function(a) {
  2298. a != this._texture && (this._setSizeDirty(), this._texture = a)
  2299. },
  2300. enumerable: !0,
  2301. configurable: !0
  2302. });
  2303. a.prototype._render = function(e) {
  2304. var g = this._texture;
  2305. g ? (this._texture_to_render = g, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth : g._textureWidth,
  2306. this._hasHeightSet ? this._explicitHeight : g._textureHeight, this)) : this._texture_to_render = null
  2307. };
  2308. a._drawBitmap = function(e, g, b, d) {
  2309. var f = d._texture_to_render;
  2310. if (f) {
  2311. var h = f._textureWidth,
  2312. k = f._textureHeight;
  2313. if ("scale" == d.fillMode) {
  2314. var m = d.scale9Grid || f.scale9Grid;
  2315. if (m && h - m.width < g && k - m.height < b) a.drawScale9GridImage(e, d, m, g, b);
  2316. else {
  2317. var m = f._offsetX,
  2318. n = f._offsetY,
  2319. p = f._bitmapWidth || h,
  2320. t = f._bitmapHeight || k;
  2321. g /= h;
  2322. m = Math.round(m * g);
  2323. g = Math.round(p * g);
  2324. b /= k;
  2325. n = Math.round(n * b);
  2326. b = Math.round(t * b);
  2327. c.RenderFilter.getInstance().drawImage(e,
  2328. d, f._bitmapX, f._bitmapY, p, t, m, n, g, b)
  2329. }
  2330. } else a.drawRepeatImage(e, d, g, b)
  2331. }
  2332. };
  2333. a.drawRepeatImage = function(a, g, b, d) {
  2334. var f = g._texture_to_render;
  2335. if (f)
  2336. for (var h = f._textureWidth, k = f._textureHeight, m = f._bitmapX, n = f._bitmapY, p = f._bitmapWidth || h, t = f._bitmapHeight || k, r = f._offsetX, f = f._offsetY, s = c.RenderFilter.getInstance(); r < b; r += h)
  2337. for (var u = f; u < d; u += k) {
  2338. var v = Math.min(p, b - r),
  2339. x = Math.min(t, d - u);
  2340. s.drawImage(a, g, m, n, p, t, r, u, v, x)
  2341. }
  2342. };
  2343. a.drawScale9GridImage = function(a, g, b, d, f) {
  2344. var h = g._texture_to_render;
  2345. if (h && b) {
  2346. var k = c.RenderFilter.getInstance(),
  2347. m = h._textureWidth,
  2348. n = h._textureHeight,
  2349. p = h._bitmapX,
  2350. t = h._bitmapY,
  2351. r = h._bitmapWidth || m,
  2352. s = h._bitmapHeight || n,
  2353. u = h._offsetX,
  2354. h = h._offsetY;
  2355. b = c.Rectangle.identity.initialize(b.x - Math.round(u), b.y - Math.round(u), b.width, b.height);
  2356. u = Math.round(u);
  2357. h = Math.round(h);
  2358. d -= m - r;
  2359. f -= n - s;
  2360. b.y == b.bottom && (b.bottom < s ? b.bottom++ : b.y--);
  2361. b.x == b.right && (b.right < r ? b.right++ : b.x--);
  2362. var m = p + b.x,
  2363. n = p + b.right,
  2364. v = r - b.right,
  2365. x = t + b.y,
  2366. y = t + b.bottom,
  2367. w = s - b.bottom,
  2368. z = u + b.x,
  2369. A = h + b.y,
  2370. s = f - (s - b.bottom),
  2371. r = d - (r - b.right);
  2372. k.drawImage(a, g, p, t, b.x, b.y, u, h,
  2373. b.x, b.y);
  2374. k.drawImage(a, g, m, t, b.width, b.y, z, h, r - b.x, b.y);
  2375. k.drawImage(a, g, n, t, v, b.y, u + r, h, d - r, b.y);
  2376. k.drawImage(a, g, p, x, b.x, b.height, u, A, b.x, s - b.y);
  2377. k.drawImage(a, g, m, x, b.width, b.height, z, A, r - b.x, s - b.y);
  2378. k.drawImage(a, g, n, x, v, b.height, u + r, A, d - r, s - b.y);
  2379. k.drawImage(a, g, p, y, b.x, w, u, h + s, b.x, f - s);
  2380. k.drawImage(a, g, m, y, b.width, w, z, h + s, r - b.x, f - s);
  2381. k.drawImage(a, g, n, y, v, w, u + r, h + s, d - r, f - s)
  2382. }
  2383. };
  2384. a.prototype._measureBounds = function() {
  2385. var a = this._texture;
  2386. return a ? c.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth,
  2387. a._textureHeight) : b.prototype._measureBounds.call(this)
  2388. };
  2389. a.debug = !1;
  2390. return a
  2391. }(c.DisplayObject);
  2392. c.Bitmap = d;
  2393. d.prototype.__class__ = "egret.Bitmap"
  2394. })(egret || (egret = {}));
  2395. __extends = this.__extends || function(c, d) {
  2396. function b() {
  2397. this.constructor = c
  2398. }
  2399. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2400. b.prototype = d.prototype;
  2401. c.prototype = new b
  2402. };
  2403. (function(c) {
  2404. var d = function(b) {
  2405. function a() {
  2406. b.call(this);
  2407. this._text = "";
  2408. this._textChanged = !1;
  2409. this._bitmapPool = []
  2410. }
  2411. __extends(a, b);
  2412. Object.defineProperty(a.prototype, "text", {
  2413. get: function() {
  2414. return this._text
  2415. },
  2416. set: function(a) {
  2417. this._textChanged = !0;
  2418. this._text = a
  2419. },
  2420. enumerable: !0,
  2421. configurable: !0
  2422. });
  2423. a.prototype._updateTransform = function() {
  2424. this.visible && (this._textChanged && this._renderText(), b.prototype._updateTransform.call(this))
  2425. };
  2426. a.prototype._renderText = function(a) {
  2427. var b = a = 0;
  2428. this._textChanged && this.removeChildren();
  2429. for (var d = 0, l = this.text.length; d < l; d++) {
  2430. var f = this.text.charAt(d),
  2431. h = this.spriteSheet.getTexture(f);
  2432. if (null == h) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + f);
  2433. else {
  2434. var f = h._offsetX,
  2435. k = h._offsetY,
  2436. m = h._textureWidth;
  2437. if (this._textChanged) {
  2438. var n = this._bitmapPool[d];
  2439. n || (n = new c.Bitmap, this._bitmapPool.push(n));
  2440. n.texture = h;
  2441. this.addChild(n);
  2442. n.x = a
  2443. }
  2444. a += m + f;
  2445. k + h._textureHeight > b && (b = k + h._textureHeight)
  2446. }
  2447. }
  2448. this._textChanged = !1;
  2449. return c.Rectangle.identity.initialize(0, 0, a, b)
  2450. };
  2451. a.prototype._measureBounds =
  2452. function() {
  2453. return this._renderText(!0)
  2454. };
  2455. return a
  2456. }(c.DisplayObjectContainer);
  2457. c.BitmapText = d;
  2458. d.prototype.__class__ = "egret.BitmapText"
  2459. })(egret || (egret = {}));
  2460. (function(c) {
  2461. var d = function() {
  2462. function b() {
  2463. this.commandQueue = []
  2464. }
  2465. b.prototype.beginFill = function(a, e) {};
  2466. b.prototype._setStyle = function(a) {};
  2467. b.prototype.drawRect = function(a, e, b, c) {};
  2468. b.prototype.drawCircle = function(a, e, b) {};
  2469. b.prototype.lineStyle = function(a, e, b, c, d, f, h, k) {};
  2470. b.prototype.lineTo = function(a, e) {};
  2471. b.prototype.curveTo = function(a, e, b, c) {};
  2472. b.prototype.moveTo = function(a, e) {};
  2473. b.prototype.clear = function() {};
  2474. b.prototype.endFill = function() {};
  2475. b.prototype._draw = function(a) {};
  2476. return b
  2477. }();
  2478. c.Graphics = d;
  2479. d.prototype.__class__ = "egret.Graphics";
  2480. (function() {
  2481. return function(b, a, e) {
  2482. this.method = b;
  2483. this.thisObject = a;
  2484. this.args = e
  2485. }
  2486. })().prototype.__class__ = "Command"
  2487. })(egret || (egret = {}));
  2488. __extends = this.__extends || function(c, d) {
  2489. function b() {
  2490. this.constructor = c
  2491. }
  2492. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2493. b.prototype = d.prototype;
  2494. c.prototype = new b
  2495. };
  2496. (function(c) {
  2497. var d = function(b) {
  2498. function a() {
  2499. b.call(this)
  2500. }
  2501. __extends(a, b);
  2502. Object.defineProperty(a.prototype, "graphics", {
  2503. get: function() {
  2504. this._graphics || (this._graphics = new c.Graphics);
  2505. return this._graphics
  2506. },
  2507. enumerable: !0,
  2508. configurable: !0
  2509. });
  2510. a.prototype._render = function(a) {
  2511. this._graphics && this._graphics._draw(a)
  2512. };
  2513. return a
  2514. }(c.DisplayObject);
  2515. c.Shape = d;
  2516. d.prototype.__class__ = "egret.Shape"
  2517. })(egret || (egret = {}));
  2518. __extends = this.__extends || function(c, d) {
  2519. function b() {
  2520. this.constructor = c
  2521. }
  2522. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2523. b.prototype = d.prototype;
  2524. c.prototype = new b
  2525. };
  2526. (function(c) {
  2527. var d = function(b) {
  2528. function a() {
  2529. b.call(this)
  2530. }
  2531. __extends(a, b);
  2532. Object.defineProperty(a.prototype, "graphics", {
  2533. get: function() {
  2534. this._graphics || (this._graphics = new c.Graphics);
  2535. return this._graphics
  2536. },
  2537. enumerable: !0,
  2538. configurable: !0
  2539. });
  2540. a.prototype._render = function(a) {
  2541. this._graphics && this._graphics._draw(a);
  2542. b.prototype._render.call(this, a)
  2543. };
  2544. return a
  2545. }(c.DisplayObjectContainer);
  2546. c.Sprite = d;
  2547. d.prototype.__class__ = "egret.Sprite"
  2548. })(egret || (egret = {}));
  2549. __extends = this.__extends || function(c, d) {
  2550. function b() {
  2551. this.constructor = c
  2552. }
  2553. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2554. b.prototype = d.prototype;
  2555. c.prototype = new b
  2556. };
  2557. (function(c) {
  2558. var d = function(b) {
  2559. function a() {
  2560. b.call(this);
  2561. this._fontFamily = "Arial";
  2562. this._size = 30;
  2563. this._textColorString = "#FFFFFF";
  2564. this._textColor = 16777215;
  2565. this._strokeColorString = "#000000";
  2566. this._stroke = this._strokeColor = 0;
  2567. this._textAlign = "left";
  2568. this._verticalAlign = "top";
  2569. this._numLines = this._lineSpacing = 0;
  2570. this.measuredWidths = []
  2571. }
  2572. __extends(a, b);
  2573. Object.defineProperty(a.prototype, "text", {
  2574. get: function() {
  2575. return this._text
  2576. },
  2577. set: function(a) {
  2578. this._text != a && (this._setTextDirty(), this._text = a)
  2579. },
  2580. enumerable: !0,
  2581. configurable: !0
  2582. });
  2583. a.prototype._setTextDirty = function() {
  2584. this._setSizeDirty()
  2585. };
  2586. Object.defineProperty(a.prototype, "fontFamily", {
  2587. get: function() {
  2588. return this._fontFamily
  2589. },
  2590. set: function(a) {
  2591. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  2592. },
  2593. enumerable: !0,
  2594. configurable: !0
  2595. });
  2596. Object.defineProperty(a.prototype, "size", {
  2597. get: function() {
  2598. return this._size
  2599. },
  2600. set: function(a) {
  2601. this._size != a && (this._setTextDirty(), this._size = a)
  2602. },
  2603. enumerable: !0,
  2604. configurable: !0
  2605. });
  2606. Object.defineProperty(a.prototype, "italic", {
  2607. get: function() {
  2608. return this._italic
  2609. },
  2610. set: function(a) {
  2611. this._italic != a && (this._setTextDirty(), this._italic = a)
  2612. },
  2613. enumerable: !0,
  2614. configurable: !0
  2615. });
  2616. Object.defineProperty(a.prototype, "bold", {
  2617. get: function() {
  2618. return this._bold
  2619. },
  2620. set: function(a) {
  2621. this._bold != a && (this._setTextDirty(), this._bold = a)
  2622. },
  2623. enumerable: !0,
  2624. configurable: !0
  2625. });
  2626. Object.defineProperty(a.prototype, "textColor", {
  2627. get: function() {
  2628. return this._textColor
  2629. },
  2630. set: function(a) {
  2631. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = c.toColorString(a))
  2632. },
  2633. enumerable: !0,
  2634. configurable: !0
  2635. });
  2636. Object.defineProperty(a.prototype, "strokeColor", {
  2637. get: function() {
  2638. return this._strokeColor
  2639. },
  2640. set: function(a) {
  2641. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = c.toColorString(a))
  2642. },
  2643. enumerable: !0,
  2644. configurable: !0
  2645. });
  2646. Object.defineProperty(a.prototype, "stroke", {
  2647. get: function() {
  2648. return this._stroke
  2649. },
  2650. set: function(a) {
  2651. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  2652. },
  2653. enumerable: !0,
  2654. configurable: !0
  2655. });
  2656. Object.defineProperty(a.prototype, "textAlign", {
  2657. get: function() {
  2658. return this._textAlign
  2659. },
  2660. set: function(a) {
  2661. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  2662. },
  2663. enumerable: !0,
  2664. configurable: !0
  2665. });
  2666. Object.defineProperty(a.prototype, "verticalAlign", {
  2667. get: function() {
  2668. return this._verticalAlign
  2669. },
  2670. set: function(a) {
  2671. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  2672. },
  2673. enumerable: !0,
  2674. configurable: !0
  2675. });
  2676. Object.defineProperty(a.prototype, "lineSpacing", {
  2677. get: function() {
  2678. return this._lineSpacing
  2679. },
  2680. set: function(a) {
  2681. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  2682. },
  2683. enumerable: !0,
  2684. configurable: !0
  2685. });
  2686. Object.defineProperty(a.prototype, "numLines", {
  2687. get: function() {
  2688. return this._numLines
  2689. },
  2690. enumerable: !0,
  2691. configurable: !0
  2692. });
  2693. a.prototype._render = function(a) {
  2694. this.drawText(a, !1);
  2695. this._clearDirty()
  2696. };
  2697. a.prototype._measureBounds = function() {
  2698. return this.drawText(c.MainContext.instance.rendererContext, !0)
  2699. };
  2700. a.prototype.drawText = function(a, b) {
  2701. var d = this.getTextLines(a);
  2702. if (!d) return c.Rectangle.identity.initialize(0, 0, 0, 0);
  2703. var l = d.length,
  2704. f = 0.5 * this._size,
  2705. h = this._size + this._lineSpacing,
  2706. k = l * h - this._lineSpacing;
  2707. this._textHeight = k;
  2708. var m = this._hasHeightSet ? this._explicitHeight : Number.POSITIVE_INFINITY;
  2709. if (this._hasHeightSet && k < m) {
  2710. var n = 0;
  2711. this._verticalAlign == c.VerticalAlign.MIDDLE ? n = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (n = 1);
  2712. f += n * (m - k)
  2713. }
  2714. var n = f = Math.round(f),
  2715. p = 0;
  2716. this._textAlign == c.HorizontalAlign.CENTER ? p = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (p = 1);
  2717. var t = this.measuredWidths,
  2718. r;
  2719. r = this._hasWidthSet ? this._explicitWidth : this._textWidth;
  2720. for (var s = Number.POSITIVE_INFINITY, u = 0; u < l; u++) {
  2721. var v = d[u],
  2722. x = Math.round((r - t[u]) * p);
  2723. x < s && (s = x);
  2724. !b && f < m && a.drawText(this, v, x, f, r);
  2725. f += h
  2726. }
  2727. return c.Rectangle.identity.initialize(s, n, r, k)
  2728. };
  2729. a.prototype.getTextLines = function(a) {
  2730. var b = this.text ? this.text.toString() : "";
  2731. if (!b) return null;
  2732. var c = this.measuredWidths;
  2733. c.length = 0;
  2734. a.setupFont(this);
  2735. var b = b.split(/(?:\r\n|\r|\n)/),
  2736. d = b.length,
  2737. f = 0;
  2738. if (this._hasWidthSet)
  2739. for (var h = this._explicitWidth, k = 0; k < d; k++) {
  2740. var m = b[k],
  2741. n = a.measureText(m);
  2742. if (n > h) {
  2743. for (var p = "", t = 0, r = m.length, s = 0; s < r; s++) {
  2744. var u = m.charAt(s),
  2745. n = a.measureText(u);
  2746. t + n > h && (0 == t ? (b.splice(k, 0, u), c[k] = n, f < n && (f = n), n = 0, u = "") : (b.splice(k, 0, p), c[k] = t, f < t && (f = t), p = "", t = 0), k++, d++);
  2747. t += n;
  2748. p += u
  2749. }
  2750. b[k] = p;
  2751. c[k] = t
  2752. } else c[k] = n, f < n && (f = n)
  2753. } else
  2754. for (k = 0; k < d; k++) m = b[k], n = a.measureText(m), c[k] = n, f < n && (f = n);
  2755. this._textWidth = f;
  2756. return b
  2757. };
  2758. return a
  2759. }(c.DisplayObject);
  2760. c.TextField = d;
  2761. d.prototype.__class__ = "egret.TextField"
  2762. })(egret || (egret = {}));
  2763. (function(c) {
  2764. var d = function() {
  2765. function b() {}
  2766. b.DYNAMIC = "dynamic";
  2767. b.INPUT = "input";
  2768. return b
  2769. }();
  2770. c.TextFieldType = d;
  2771. d.prototype.__class__ = "egret.TextFieldType"
  2772. })(egret || (egret = {}));
  2773. __extends = this.__extends || function(c, d) {
  2774. function b() {
  2775. this.constructor = c
  2776. }
  2777. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2778. b.prototype = d.prototype;
  2779. c.prototype = new b
  2780. };
  2781. (function(c) {
  2782. var d = function(b) {
  2783. function a(a) {
  2784. b.call(this);
  2785. var g = a.bitmapData;
  2786. this.bitmapData = g;
  2787. this._textureMap = {};
  2788. this._sourceWidth = g.width;
  2789. this._sourceHeight = g.height;
  2790. this._bitmapX = a._bitmapX - a._offsetX;
  2791. this._bitmapY = a._bitmapY - a._offsetY
  2792. }
  2793. __extends(a, b);
  2794. a.prototype.getTexture = function(a) {
  2795. return this._textureMap[a]
  2796. };
  2797. a.prototype.createTexture = function(a, b, d, l, f, h, k, m, n) {
  2798. "undefined" === typeof h && (h = 0);
  2799. "undefined" === typeof k && (k = 0);
  2800. "undefined" === typeof m && (m = h + l);
  2801. "undefined" === typeof n && (n = k + f);
  2802. var p =
  2803. new c.Texture;
  2804. p._bitmapData = this.bitmapData;
  2805. p._bitmapX = this._bitmapX + b;
  2806. p._bitmapY = this._bitmapY + d;
  2807. p._bitmapWidth = l;
  2808. p._bitmapHeight = f;
  2809. p._offsetX = h;
  2810. p._offsetY = k;
  2811. p._textureWidth = m;
  2812. p._textureHeight = n;
  2813. p._sourceWidth = this._sourceWidth;
  2814. p._sourceHeight = this._sourceHeight;
  2815. return this._textureMap[a] = p
  2816. };
  2817. return a
  2818. }(c.HashObject);
  2819. c.SpriteSheet = d;
  2820. d.prototype.__class__ = "egret.SpriteSheet"
  2821. })(egret || (egret = {}));
  2822. __extends = this.__extends || function(c, d) {
  2823. function b() {
  2824. this.constructor = c
  2825. }
  2826. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2827. b.prototype = d.prototype;
  2828. c.prototype = new b
  2829. };
  2830. (function(c) {
  2831. var d = function(b) {
  2832. function a() {
  2833. b.apply(this, arguments);
  2834. this._placeholderText = "";
  2835. this._edFontSize = 14;
  2836. this._textColor = 16711680;
  2837. this._placeholderFontSize = 14;
  2838. this._placeholderColor = 16776960;
  2839. this._preY = this._preX = 0
  2840. }
  2841. __extends(a, b);
  2842. a.prototype._onAddToStage = function() {
  2843. b.prototype._onAddToStage.call(this);
  2844. var a = this.localToGlobal(),
  2845. g = new c.StageText;
  2846. g._open(a.x, a.y, this._explicitWidth, this._explicitHeight);
  2847. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2848. this.stageText =
  2849. g
  2850. };
  2851. a.prototype.setText = function(a) {
  2852. this.stageText._setText(a)
  2853. };
  2854. a.prototype.getText = function() {
  2855. return this.stageText._getText()
  2856. };
  2857. a.prototype.setTextType = function(a) {
  2858. this.stageText._setTextType(a)
  2859. };
  2860. a.prototype.getTextType = function() {
  2861. return this.stageText._getTextType()
  2862. };
  2863. a.prototype.onMouseDownHandler = function(a) {};
  2864. a.prototype._onRemoveFromStage = function() {
  2865. this.stageText._remove()
  2866. };
  2867. a.prototype._measureBounds = function() {
  2868. return c.Rectangle.identity
  2869. };
  2870. a.prototype.hitTest = function(a, b, c) {
  2871. return null
  2872. };
  2873. return a
  2874. }(c.DisplayObject);
  2875. c.TextInput = d;
  2876. d.prototype.__class__ = "egret.TextInput";
  2877. d = function() {
  2878. function b() {}
  2879. b.prototype.editBoxEditingDidBegin = function(a) {};
  2880. b.prototype.editBoxEditingDidEnd = function(a) {};
  2881. b.prototype.editBoxTextChanged = function(a, e) {};
  2882. b.prototype.editBoxReturn = function(a) {};
  2883. return b
  2884. }();
  2885. c.TextInputDegelete = d;
  2886. d.prototype.__class__ = "egret.TextInputDegelete"
  2887. })(egret || (egret = {}));
  2888. __extends = this.__extends || function(c, d) {
  2889. function b() {
  2890. this.constructor = c
  2891. }
  2892. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2893. b.prototype = d.prototype;
  2894. c.prototype = new b
  2895. };
  2896. (function(c) {
  2897. var d = function(b) {
  2898. function a(a, g) {
  2899. b.call(this, a);
  2900. this.charList = this.parseConfig(g)
  2901. }
  2902. __extends(a, b);
  2903. a.prototype.getTexture = function(a) {
  2904. var b = this._textureMap[a];
  2905. if (!b) {
  2906. b = this.charList[a];
  2907. if (!b) return null;
  2908. b = this.createTexture(a, b.x, b.y, b.width, b.height, b.offsetX, b.offsetY);
  2909. this._textureMap[a] = b
  2910. }
  2911. return b
  2912. };
  2913. a.prototype.parseConfig = function(a) {
  2914. a = a.split("\r\n").join("\n");
  2915. a = a.split("\n");
  2916. for (var b = this.getConfigByKey(a[3], "count"), c = {}, d = 4; d < 4 + b; d++) {
  2917. var f = a[d],
  2918. h = String.fromCharCode(this.getConfigByKey(f,
  2919. "id")),
  2920. k = {};
  2921. c[h] = k;
  2922. k.x = this.getConfigByKey(f, "x");
  2923. k.y = this.getConfigByKey(f, "y");
  2924. k.width = this.getConfigByKey(f, "width");
  2925. k.height = this.getConfigByKey(f, "height");
  2926. k.offsetX = this.getConfigByKey(f, "xoffset");
  2927. k.offsetY = this.getConfigByKey(f, "yoffset")
  2928. }
  2929. return c
  2930. };
  2931. a.prototype.getConfigByKey = function(a, b) {
  2932. for (var c = a.split(" "), d = 0, f = c.length; d < f; d++) {
  2933. var h = c[d];
  2934. if (b == h.substring(0, b.length)) return c = h.substring(b.length + 1), parseInt(c)
  2935. }
  2936. return 0
  2937. };
  2938. return a
  2939. }(c.SpriteSheet);
  2940. c.BitmapTextSpriteSheet = d;
  2941. d.prototype.__class__ =
  2942. "egret.BitmapTextSpriteSheet"
  2943. })(egret || (egret = {}));
  2944. __extends = this.__extends || function(c, d) {
  2945. function b() {
  2946. this.constructor = c
  2947. }
  2948. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  2949. b.prototype = d.prototype;
  2950. c.prototype = new b
  2951. };
  2952. (function(c) {
  2953. var d = function(a) {
  2954. function e(e, d) {
  2955. a.call(this);
  2956. this.frameRate = 60;
  2957. e instanceof b ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"), this.delegate = e) : this.delegate = new b(e, d);
  2958. this.delegate.setMovieClip(this)
  2959. }
  2960. __extends(e, a);
  2961. e.prototype.gotoAndPlay = function(a) {
  2962. this.delegate.gotoAndPlay(a)
  2963. };
  2964. e.prototype.gotoAndStop = function(a) {
  2965. this.delegate.gotoAndStop(a)
  2966. };
  2967. e.prototype.stop =
  2968. function() {
  2969. this.delegate.stop()
  2970. };
  2971. e.prototype.dispose = function() {
  2972. this.delegate.dispose()
  2973. };
  2974. e.prototype.release = function() {
  2975. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2976. this.dispose()
  2977. };
  2978. e.prototype.getCurrentFrameIndex = function() {
  2979. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2980. return this.delegate._currentFrameIndex
  2981. };
  2982. e.prototype.getTotalFrame = function() {
  2983. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2984. return this.delegate._totalFrame
  2985. };
  2986. e.prototype.setInterval = function(a) {
  2987. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2988. this.frameRate = 60 / a
  2989. };
  2990. e.prototype.getIsPlaying = function() {
  2991. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2992. return this.delegate.isPlaying
  2993. };
  2994. return e
  2995. }(c.DisplayObjectContainer);
  2996. c.MovieClip = d;
  2997. d.prototype.__class__ = "egret.MovieClip";
  2998. var b = function() {
  2999. function a(a, b) {
  3000. this.data = a;
  3001. this._currentFrameIndex = this._passTime =
  3002. this._totalFrame = 0;
  3003. this._isPlaying = !1;
  3004. this._frameData = a;
  3005. this._spriteSheet = new c.SpriteSheet(b)
  3006. }
  3007. a.prototype.setMovieClip = function(a) {
  3008. this.movieClip = a;
  3009. this.bitmap = new c.Bitmap;
  3010. this.movieClip.addChild(this.bitmap)
  3011. };
  3012. a.prototype.gotoAndPlay = function(a) {
  3013. this.checkHasFrame(a);
  3014. this._isPlaying = !0;
  3015. this._currentFrameIndex = 0;
  3016. this._currentFrameName = a;
  3017. this._totalFrame = this._frameData.frames[a].totalFrame;
  3018. this.playNextFrame();
  3019. this._passTime = 0;
  3020. c.Ticker.getInstance().register(this.update, this)
  3021. };
  3022. a.prototype.gotoAndStop =
  3023. function(a) {
  3024. this.checkHasFrame(a);
  3025. this.stop();
  3026. this._currentFrameIndex = this._passTime = 0;
  3027. this._currentFrameName = a;
  3028. this._totalFrame = this._frameData.frames[a].totalFrame;
  3029. this.playNextFrame()
  3030. };
  3031. a.prototype.stop = function() {
  3032. this._isPlaying = !1;
  3033. c.Ticker.getInstance().unregister(this.update, this)
  3034. };
  3035. a.prototype.dispose = function() {};
  3036. a.prototype.checkHasFrame = function(a) {
  3037. void 0 == this._frameData.frames[a] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", a)
  3038. };
  3039. a.prototype.update = function(a) {
  3040. for (var b =
  3041. 1E3 / this.movieClip.frameRate, b = Math.floor((this._passTime % b + a) / b); 1 <= b;) 1 == b ? this.playNextFrame() : this.playNextFrame(!1), b--;
  3042. this._passTime += a
  3043. };
  3044. a.prototype.playNextFrame = function(a) {
  3045. "undefined" === typeof a && (a = !0);
  3046. var b = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  3047. if (a) {
  3048. a = this.getTexture(b.res);
  3049. var c = this.bitmap;
  3050. c.x = b.x;
  3051. c.y = b.y;
  3052. c.texture = a
  3053. }
  3054. null != b.action && this.movieClip.dispatchEventWith(b.action);
  3055. this._currentFrameIndex++;
  3056. this._currentFrameIndex == this._totalFrame &&
  3057. (this._currentFrameIndex = 0)
  3058. };
  3059. a.prototype.getTexture = function(a) {
  3060. var b = this._frameData.res[a],
  3061. c = this._spriteSheet.getTexture(a);
  3062. c || (c = this._spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  3063. return c
  3064. };
  3065. return a
  3066. }();
  3067. c.DefaultMovieClipDelegate = b;
  3068. b.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  3069. })(egret || (egret = {}));
  3070. __extends = this.__extends || function(c, d) {
  3071. function b() {
  3072. this.constructor = c
  3073. }
  3074. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3075. b.prototype = d.prototype;
  3076. c.prototype = new b
  3077. };
  3078. (function(c) {
  3079. var d = function(b) {
  3080. function a() {
  3081. b.call(this)
  3082. }
  3083. __extends(a, b);
  3084. a.prototype._getText = function() {
  3085. return this.inputElement.value
  3086. };
  3087. a.prototype._setText = function(a) {
  3088. this.inputElement.value = a
  3089. };
  3090. a.prototype._setTextType = function(a) {
  3091. this.inputElement.type = a
  3092. };
  3093. a.prototype._getTextType = function() {
  3094. return this.inputElement.type
  3095. };
  3096. a.prototype._open = function(a, b, d, l) {
  3097. "undefined" === typeof d && (d = 160);
  3098. "undefined" === typeof l && (l = 21);
  3099. var f = c.StageDelegate.getInstance().getScaleX(),
  3100. h = c.StageDelegate.getInstance().getScaleY(),
  3101. k = document.createElement("input");
  3102. k.type = "text";
  3103. k.style.fontSize = "20px";
  3104. k.style.color = "#FFFFFF";
  3105. k.style.borderStyle = "none";
  3106. k.style.background = "none";
  3107. k.style.width = d * f + "px";
  3108. k.style.height = l * h + "px";
  3109. k.style.outline = "medium";
  3110. var m = c.Browser.getInstance().$new("div");
  3111. m.style.position = "absolute";
  3112. m.position.x = a * f;
  3113. m.style.width = d * f + "px";
  3114. m.style.height = l * h + "px";
  3115. m.position.y = b * h;
  3116. m.transforms();
  3117. m.appendChild(k);
  3118. a = c.Browser.getInstance().$("#StageDelegateDiv");
  3119. a || (d = document.getElementById(c.StageDelegate.canvas_div_name),
  3120. l = d.clientHeight, d = d.clientWidth, a = c.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", a.style.position = "absolute", a.style.width = d + "px", a.style.maxHeight = l + "px", a.style.margin = "0px", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(a), a.position.y = -l, a.transforms());
  3121. a.appendChild(m);
  3122. this.div = m;
  3123. this.inputElement = k
  3124. };
  3125. a.prototype._remove = function() {
  3126. var a = this.div;
  3127. a && a.parentNode && a.parentNode.removeChild(a)
  3128. };
  3129. return a
  3130. }(c.HashObject);
  3131. c.StageText = d;
  3132. d.prototype.__class__ = "egret.StageText"
  3133. })(egret ||
  3134. (egret = {}));
  3135. (function(c) {
  3136. var d = function() {
  3137. function b() {}
  3138. b.GET = "GET";
  3139. b.POST = "POST";
  3140. return b
  3141. }();
  3142. c.URLRequestMethod = d;
  3143. d.prototype.__class__ = "egret.URLRequestMethod"
  3144. })(egret || (egret = {}));
  3145. (function(c) {
  3146. var d = function() {
  3147. function b() {}
  3148. b.BINARY = "binary";
  3149. b.TEXT = "text";
  3150. b.VARIABLES = "variables";
  3151. b.TEXTURE = "texture";
  3152. b.SOUND = "sound";
  3153. return b
  3154. }();
  3155. c.URLLoaderDataFormat = d;
  3156. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  3157. })(egret || (egret = {}));
  3158. __extends = this.__extends || function(c, d) {
  3159. function b() {
  3160. this.constructor = c
  3161. }
  3162. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3163. b.prototype = d.prototype;
  3164. c.prototype = new b
  3165. };
  3166. (function(c) {
  3167. var d = function(b) {
  3168. function a(a) {
  3169. "undefined" === typeof a && (a = null);
  3170. b.call(this);
  3171. null !== a && this.decode(a)
  3172. }
  3173. __extends(a, b);
  3174. a.prototype.decode = function(a) {
  3175. this.variables || (this.variables = {});
  3176. a = a.split("+").join(" ");
  3177. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) this.variables[decodeURIComponent(b[1])] = decodeURIComponent(b[2])
  3178. };
  3179. a.prototype.toString = function() {
  3180. if (!this.variables) return "";
  3181. var a = this.variables,
  3182. b = "",
  3183. c = !0,
  3184. d;
  3185. for (d in a) c ? c = !1 : b += "&", b += d + "=" + a[d];
  3186. return b
  3187. };
  3188. return a
  3189. }(c.HashObject);
  3190. c.URLVariables = d;
  3191. d.prototype.__class__ = "egret.URLVariables"
  3192. })(egret || (egret = {}));
  3193. __extends = this.__extends || function(c, d) {
  3194. function b() {
  3195. this.constructor = c
  3196. }
  3197. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3198. b.prototype = d.prototype;
  3199. c.prototype = new b
  3200. };
  3201. (function(c) {
  3202. var d = function(b) {
  3203. function a(a) {
  3204. "undefined" === typeof a && (a = null);
  3205. b.call(this);
  3206. this.method = c.URLRequestMethod.GET;
  3207. this.url = a
  3208. }
  3209. __extends(a, b);
  3210. return a
  3211. }(c.HashObject);
  3212. c.URLRequest = d;
  3213. d.prototype.__class__ = "egret.URLRequest"
  3214. })(egret || (egret = {}));
  3215. __extends = this.__extends || function(c, d) {
  3216. function b() {
  3217. this.constructor = c
  3218. }
  3219. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3220. b.prototype = d.prototype;
  3221. c.prototype = new b
  3222. };
  3223. (function(c) {
  3224. var d = function(b) {
  3225. function a(a) {
  3226. "undefined" === typeof a && (a = null);
  3227. b.call(this);
  3228. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  3229. a && this.load(a)
  3230. }
  3231. __extends(a, b);
  3232. a.prototype.load = function(a) {
  3233. this._request = a;
  3234. this.data = null;
  3235. c.MainContext.instance.netContext.proceed(this)
  3236. };
  3237. return a
  3238. }(c.EventDispatcher);
  3239. c.URLLoader = d;
  3240. d.prototype.__class__ = "egret.URLLoader"
  3241. })(egret || (egret = {}));
  3242. __extends = this.__extends || function(c, d) {
  3243. function b() {
  3244. this.constructor = c
  3245. }
  3246. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3247. b.prototype = d.prototype;
  3248. c.prototype = new b
  3249. };
  3250. (function(c) {
  3251. var d = function(b) {
  3252. function a() {
  3253. b.call(this);
  3254. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3255. }
  3256. __extends(a, b);
  3257. Object.defineProperty(a.prototype, "textureWidth", {
  3258. get: function() {
  3259. return this._textureWidth
  3260. },
  3261. enumerable: !0,
  3262. configurable: !0
  3263. });
  3264. Object.defineProperty(a.prototype, "textureHeight", {
  3265. get: function() {
  3266. return this._textureHeight
  3267. },
  3268. enumerable: !0,
  3269. configurable: !0
  3270. });
  3271. Object.defineProperty(a.prototype, "bitmapData", {
  3272. get: function() {
  3273. return this._bitmapData
  3274. },
  3275. enumerable: !0,
  3276. configurable: !0
  3277. });
  3278. a.prototype._setBitmapData = function(a) {
  3279. var b = c.MainContext.instance.rendererContext.texture_scale_factor;
  3280. this._bitmapData = a;
  3281. this._sourceWidth = a.width;
  3282. this._sourceHeight = a.height;
  3283. this._textureWidth = this._sourceWidth * b;
  3284. this._textureHeight = this._sourceHeight * b;
  3285. this._bitmapWidth = this._textureWidth;
  3286. this._bitmapHeight = this._textureHeight;
  3287. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3288. };
  3289. a.prototype.getPixel32 = function(a, b) {
  3290. return this._bitmapData.getContext("2d").getImageData(a,
  3291. b, 1, 1).data
  3292. };
  3293. return a
  3294. }(c.HashObject);
  3295. c.Texture = d;
  3296. d.prototype.__class__ = "egret.Texture"
  3297. })(egret || (egret = {}));
  3298. __extends = this.__extends || function(c, d) {
  3299. function b() {
  3300. this.constructor = c
  3301. }
  3302. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3303. b.prototype = d.prototype;
  3304. c.prototype = new b
  3305. };
  3306. (function(c) {
  3307. var d = function(b) {
  3308. function a() {
  3309. b.call(this);
  3310. this._bitmapData = document.createElement("canvas");
  3311. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  3312. }
  3313. __extends(a, b);
  3314. a.prototype.drawToTexture = function(a) {
  3315. var b = this._bitmapData,
  3316. d = a.getBounds(c.Rectangle.identity);
  3317. b.width = d.width;
  3318. b.height = d.height;
  3319. a._worldTransform.identity();
  3320. a.worldAlpha = 1;
  3321. if (a instanceof c.DisplayObjectContainer) {
  3322. this._offsetX = d.x;
  3323. this._offsetY = d.y;
  3324. a._worldTransform.append(1, 0, 0, 1, -d.x, -d.y);
  3325. for (var b =
  3326. a._children, d = 0, l = b.length; d < l; d++) b[d]._updateTransform()
  3327. }
  3328. b = c.RenderFilter.getInstance();
  3329. d = b._drawAreaList.concat();
  3330. b._drawAreaList.length = 0;
  3331. this.renderContext.clearScreen();
  3332. this.webGLTexture = null;
  3333. (l = a.mask || a._scrollRect) && this.renderContext.pushMask(l);
  3334. a._render(this.renderContext);
  3335. l && this.renderContext.popMask();
  3336. b._drawAreaList = d;
  3337. this._textureWidth = this._bitmapData.width;
  3338. this._textureHeight = this._bitmapData.height;
  3339. this._sourceWidth = this._textureWidth;
  3340. this._sourceHeight = this._textureHeight
  3341. };
  3342. return a
  3343. }(c.Texture);
  3344. c.RenderTexture = d;
  3345. d.prototype.__class__ = "egret.RenderTexture"
  3346. })(egret || (egret = {}));
  3347. __extends = this.__extends || function(c, d) {
  3348. function b() {
  3349. this.constructor = c
  3350. }
  3351. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3352. b.prototype = d.prototype;
  3353. c.prototype = new b
  3354. };
  3355. (function(c) {
  3356. var d = function(b) {
  3357. function a() {
  3358. b.call(this);
  3359. this.renderCost = 0;
  3360. this.texture_scale_factor = 1
  3361. }
  3362. __extends(a, b);
  3363. a.prototype.clearScreen = function() {};
  3364. a.prototype.clearRect = function(a, b, c, d) {};
  3365. a.prototype.drawImage = function(a, b, d, l, f, h, k, m, n) {
  3366. c.Profiler.getInstance().onDrawImage()
  3367. };
  3368. a.prototype.setTransform = function(a) {};
  3369. a.prototype.setAlpha = function(a, b) {};
  3370. a.prototype.setupFont = function(a) {};
  3371. a.prototype.measureText = function(a) {
  3372. return 0
  3373. };
  3374. a.prototype.drawText = function(a, b, d, l, f) {
  3375. c.Profiler.getInstance().onDrawImage()
  3376. };
  3377. a.prototype.strokeRect = function(a, b, c, d, f) {};
  3378. a.prototype.pushMask = function(a) {};
  3379. a.prototype.popMask = function() {};
  3380. a.createRendererContext = function(a) {
  3381. return null
  3382. };
  3383. return a
  3384. }(c.HashObject);
  3385. c.RendererContext = d;
  3386. d.prototype.__class__ = "egret.RendererContext"
  3387. })(egret || (egret = {}));
  3388. (function(c) {
  3389. var d = function() {
  3390. function b() {}
  3391. b.MOUSE = "mouse";
  3392. b.TOUCH = "touch";
  3393. b.mode = "touch";
  3394. return b
  3395. }();
  3396. c.InteractionMode = d;
  3397. d.prototype.__class__ = "egret.InteractionMode"
  3398. })(egret || (egret = {}));
  3399. __extends = this.__extends || function(c, d) {
  3400. function b() {
  3401. this.constructor = c
  3402. }
  3403. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3404. b.prototype = d.prototype;
  3405. c.prototype = new b
  3406. };
  3407. (function(c) {
  3408. var d = function(b) {
  3409. function a() {
  3410. b.call(this);
  3411. this._currentTouchTarget = {};
  3412. this.maxTouches = 2;
  3413. this.touchDownTarget = {};
  3414. this.lastTouchY = this.lastTouchX = -1
  3415. }
  3416. __extends(a, b);
  3417. a.prototype.run = function() {};
  3418. a.prototype.getTouchData = function(a, b, c) {
  3419. var d = this._currentTouchTarget[a];
  3420. null == d && (d = {}, this._currentTouchTarget[a] = d);
  3421. d.stageX = b;
  3422. d.stageY = c;
  3423. d.identifier = a;
  3424. return d
  3425. };
  3426. a.prototype.dispatchEvent = function(a, b) {
  3427. c.TouchEvent.dispatchTouchEvent(b.target, a, b.identifier, b.stageX, b.stageY, !1, !1, !1, !0 ==
  3428. this.touchDownTarget[b.identifier])
  3429. };
  3430. a.prototype.onTouchBegan = function(a, b, d) {
  3431. var l = c.MainContext.instance.stage.hitTest(a, b);
  3432. l && (a = this.getTouchData(d, a, b), this.touchDownTarget[d] = !0, a.target = l, a.beginTarget = l, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, a))
  3433. };
  3434. a.prototype.onTouchMove = function(a, b, d) {
  3435. if (a != this.lastTouchX || b != this.lastTouchY) {
  3436. this.lastTouchX = a;
  3437. this.lastTouchY = b;
  3438. var l = c.MainContext.instance.stage.hitTest(a, b);
  3439. l && (a = this.getTouchData(d, a, b), a.target = l, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE,
  3440. a))
  3441. }
  3442. };
  3443. a.prototype.onTouchEnd = function(a, b, d) {
  3444. var l = c.MainContext.instance.stage.hitTest(a, b);
  3445. l && (a = this.getTouchData(d, a, b), delete this.touchDownTarget[d], d = a.beginTarget, a.target = l, this.dispatchEvent(c.TouchEvent.TOUCH_END, a), d == l ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  3446. };
  3447. return a
  3448. }(c.HashObject);
  3449. c.TouchContext = d;
  3450. d.prototype.__class__ = "egret.TouchContext"
  3451. })(egret ||
  3452. (egret = {}));
  3453. __extends = this.__extends || function(c, d) {
  3454. function b() {
  3455. this.constructor = c
  3456. }
  3457. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3458. b.prototype = d.prototype;
  3459. c.prototype = new b
  3460. };
  3461. (function(c) {
  3462. var d = function(b) {
  3463. function a() {
  3464. b.call(this)
  3465. }
  3466. __extends(a, b);
  3467. a.prototype.proceed = function(a) {};
  3468. return a
  3469. }(c.HashObject);
  3470. c.NetContext = d;
  3471. d.prototype.__class__ = "egret.NetContext"
  3472. })(egret || (egret = {}));
  3473. __extends = this.__extends || function(c, d) {
  3474. function b() {
  3475. this.constructor = c
  3476. }
  3477. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3478. b.prototype = d.prototype;
  3479. c.prototype = new b
  3480. };
  3481. (function(c) {
  3482. var d = function(b) {
  3483. function a() {
  3484. b.call(this);
  3485. this.frameRate = 60
  3486. }
  3487. __extends(a, b);
  3488. a.prototype.executeMainLoop = function(a, b) {};
  3489. return a
  3490. }(c.HashObject);
  3491. c.DeviceContext = d;
  3492. d.prototype.__class__ = "egret.DeviceContext"
  3493. })(egret || (egret = {}));
  3494. __extends = this.__extends || function(c, d) {
  3495. function b() {
  3496. this.constructor = c
  3497. }
  3498. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3499. b.prototype = d.prototype;
  3500. c.prototype = new b
  3501. };
  3502. (function(c) {
  3503. var d = function(b) {
  3504. function a() {
  3505. b.call(this);
  3506. this.translate = this.isHD ? function(a) {
  3507. return "translate3d(" + a.x + "px, " + (a.y - c.MainContext.instance.stage.stageHeight) + "px, 0) "
  3508. } : function(a) {
  3509. return "translate(" + a.x + "px, " + a.y + "px) "
  3510. };
  3511. this.rotate = this.isHD ? function(a) {
  3512. return "rotateZ(" + a + "deg) "
  3513. } : function(a) {
  3514. return "rotate(" + a + "deg) "
  3515. };
  3516. this.ua = navigator.userAgent.toLowerCase();
  3517. var a = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3518. a && 0 < a.length && (a = a[0], "micromessenger" == a && (this.type = "wechat"), this.type = a);
  3519. this.type = "unknow";
  3520. switch (this.type) {
  3521. case "firefox":
  3522. this.pfx = "Moz";
  3523. this.isHD = !0;
  3524. break;
  3525. case "chrome":
  3526. case "safari":
  3527. this.pfx = "webkit";
  3528. this.isHD = !0;
  3529. break;
  3530. case "opera":
  3531. this.pfx = "O";
  3532. this.isHD = !1;
  3533. break;
  3534. case "ie":
  3535. this.pfx = "ms";
  3536. this.isHD = !1;
  3537. break;
  3538. default:
  3539. this.pfx = "webkit", this.isHD = !0
  3540. }
  3541. this.trans = this.pfx + "Transform"
  3542. }
  3543. __extends(a, b);
  3544. a.getInstance = function() {
  3545. null == a.instance && (a.instance = new a);
  3546. return a.instance
  3547. };
  3548. Object.defineProperty(a.prototype,
  3549. "isMobile", {
  3550. get: function() {
  3551. c.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  3552. return c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE
  3553. },
  3554. enumerable: !0,
  3555. configurable: !0
  3556. });
  3557. a.prototype.$new = function(a) {
  3558. return this.$(document.createElement(a))
  3559. };
  3560. a.prototype.$ = function(e) {
  3561. var b = document;
  3562. if (e = e instanceof HTMLElement ? e : b.querySelector(e)) e.find = e.find ||
  3563. this.$, e.hasClass = e.hasClass || function(a) {
  3564. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  3565. }, e.addClass = e.addClass || function(a) {
  3566. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  3567. return this
  3568. }, e.removeClass = e.removeClass || function(a) {
  3569. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  3570. return this
  3571. }, e.remove = e.remove || function() {}, e.appendTo = e.appendTo || function(a) {
  3572. a.appendChild(this);
  3573. return this
  3574. }, e.prependTo = e.prependTo || function(a) {
  3575. a.childNodes[0] ?
  3576. a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  3577. return this
  3578. }, e.transforms = e.transforms || function() {
  3579. 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);
  3580. return this
  3581. }, e.position = e.position || {
  3582. x: 0,
  3583. y: 0
  3584. }, e.rotation = e.rotation || 0, e.scale = e.scale || {
  3585. x: 1,
  3586. y: 1
  3587. }, e.skew = e.skew || {
  3588. x: 0,
  3589. y: 0
  3590. }, e.translates = function(a, e) {
  3591. this.position.x = a;
  3592. this.position.y = e - c.MainContext.instance.stage.stageHeight;
  3593. this.transforms();
  3594. return this
  3595. }, e.rotate = function(a) {
  3596. this.rotation = a;
  3597. this.transforms();
  3598. return this
  3599. }, e.resize = function(a, e) {
  3600. this.scale.x = a;
  3601. this.scale.y = e;
  3602. this.transforms();
  3603. return this
  3604. }, e.setSkew = function(a, e) {
  3605. this.skew.x = a;
  3606. this.skew.y = e;
  3607. this.transforms();
  3608. return this
  3609. };
  3610. return e
  3611. };
  3612. a.prototype.scale = function(a) {
  3613. return "scale(" + a.x + ", " + a.y + ") "
  3614. };
  3615. a.prototype.skew = function(a) {
  3616. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  3617. };
  3618. return a
  3619. }(c.HashObject);
  3620. c.Browser = d;
  3621. d.prototype.__class__ = "egret.Browser"
  3622. })(egret || (egret = {}));
  3623. (function(c) {
  3624. var d = function() {
  3625. function b() {}
  3626. b.parse = function(a) {
  3627. a = c.SAXParser.getInstance().parserXML(a);
  3628. if (!a || !a.childNodes) return null;
  3629. for (var e = a.childNodes.length, d = !1, q = 0; q < e; q++) {
  3630. var l = a.childNodes[q];
  3631. if (1 == l.nodeType) {
  3632. d = !0;
  3633. break
  3634. }
  3635. }
  3636. return d ? b.parseNode(l) : null
  3637. };
  3638. b.parseNode = function(a) {
  3639. if (!a || 1 != a.nodeType) return null;
  3640. var e = {};
  3641. e.localName = a.localName;
  3642. e.name = a.nodeName;
  3643. a.namespaceURI && (e.namespace = a.namespaceURI);
  3644. a.prefix && (e.prefix = a.prefix);
  3645. for (var c = a.attributes, d = c.length, l = 0; l < d; l++) {
  3646. var f = c[l],
  3647. h = f.name;
  3648. 0 != h.indexOf("xmlns:") && (e["$" + h] = f.value)
  3649. }
  3650. c = a.childNodes;
  3651. d = c.length;
  3652. for (l = 0; l < d; l++)
  3653. if (f = b.parseNode(c[l])) e.children || (e.children = []), f.parent = e, e.children.push(f);!e.children && (a = a.textContent.trim()) && (e.text = a);
  3654. return e
  3655. };
  3656. b.findChildren = function(a, e, c) {
  3657. c ? c.length = 0 : c = [];
  3658. b.findByPath(a, e, c);
  3659. return c
  3660. };
  3661. b.findByPath = function(a, e, c) {
  3662. var d = e.indexOf("."),
  3663. l; - 1 == d ? (l = e, d = !0) : (l = e.substring(0, d), e = e.substring(d + 1), d = !1);
  3664. if (a = a.children)
  3665. for (var f = a.length, h = 0; h < f; h++) {
  3666. var k = a[h];
  3667. k.localName == l &&
  3668. (d ? c.push(k) : b.findByPath(k, e, c))
  3669. }
  3670. };
  3671. b.getAttributes = function(a, e) {
  3672. e ? e.length = 0 : e = [];
  3673. for (var b in a) "$" == b.charAt(0) && e.push(b.substring(1));
  3674. return e
  3675. };
  3676. return b
  3677. }();
  3678. c.XML = d;
  3679. d.prototype.__class__ = "egret.XML"
  3680. })(egret || (egret = {}));
  3681. (function(c) {
  3682. var d = function() {
  3683. function a() {}
  3684. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  3685. a.BIG_ENDIAN = "BIG_ENDIAN";
  3686. return a
  3687. }();
  3688. c.Endian = d;
  3689. d.prototype.__class__ = "egret.Endian";
  3690. var b = function() {
  3691. function a() {
  3692. this.length = this.position = 0;
  3693. this._mode = "";
  3694. this.maxlength = 0;
  3695. this._endian = d.LITTLE_ENDIAN;
  3696. this.isLittleEndian = !1;
  3697. this._mode = "Typed array";
  3698. this.maxlength = 4;
  3699. this.arraybytes = new ArrayBuffer(this.maxlength);
  3700. this.unalignedarraybytestemp = new ArrayBuffer(16);
  3701. this.endian = a.DEFAULT_ENDIAN
  3702. }
  3703. Object.defineProperty(a.prototype,
  3704. "endian", {
  3705. get: function() {
  3706. return this._endian
  3707. },
  3708. set: function(a) {
  3709. this._endian = a;
  3710. this.isLittleEndian = a == d.LITTLE_ENDIAN
  3711. },
  3712. enumerable: !0,
  3713. configurable: !0
  3714. });
  3715. a.prototype.ensureWriteableSpace = function(a) {
  3716. this.ensureSpace(a + this.position)
  3717. };
  3718. a.prototype.setArrayBuffer = function(a) {
  3719. this.ensureSpace(a.byteLength);
  3720. this.length = a.byteLength;
  3721. a = new Int8Array(a);
  3722. (new Int8Array(this.arraybytes, 0, this.length)).set(a);
  3723. this.position = 0
  3724. };
  3725. Object.defineProperty(a.prototype, "bytesAvailable", {
  3726. get: function() {
  3727. return this.length - this.position
  3728. },
  3729. enumerable: !0,
  3730. configurable: !0
  3731. });
  3732. a.prototype.ensureSpace = function(a) {
  3733. if (a > this.maxlength) {
  3734. a = a + 255 & -256;
  3735. var b = new ArrayBuffer(a),
  3736. c = new Uint8Array(this.arraybytes, 0, this.length);
  3737. (new Uint8Array(b, 0, this.length)).set(c);
  3738. this.arraybytes = b;
  3739. this.maxlength = a
  3740. }
  3741. };
  3742. a.prototype.writeByte = function(a) {
  3743. this.ensureWriteableSpace(1);
  3744. (new Int8Array(this.arraybytes))[this.position++] = ~~a;
  3745. this.position > this.length && (this.length = this.position)
  3746. };
  3747. a.prototype.readByte = function() {
  3748. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" +
  3749. this.position + ", Length=" + this.length;
  3750. return (new Int8Array(this.arraybytes))[this.position++]
  3751. };
  3752. a.prototype.readBytes = function(a, b, c) {
  3753. "undefined" === typeof b && (b = 0);
  3754. "undefined" === typeof c && (c = 0);
  3755. null == c && (c = a.length);
  3756. a.ensureWriteableSpace(b + c);
  3757. var d = new Int8Array(a.arraybytes),
  3758. f = new Int8Array(this.arraybytes);
  3759. d.set(f.subarray(this.position, this.position + c), b);
  3760. this.position += c;
  3761. c + b > a.length && (a.length += c + b - a.length)
  3762. };
  3763. a.prototype.writeUnsignedByte = function(a) {
  3764. this.ensureWriteableSpace(1);
  3765. (new Uint8Array(this.arraybytes))[this.position++] = ~~a & 255;
  3766. this.position > this.length && (this.length = this.position)
  3767. };
  3768. a.prototype.readUnsignedByte = function() {
  3769. if (this.position >= this.length) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length;
  3770. return (new Uint8Array(this.arraybytes))[this.position++]
  3771. };
  3772. a.prototype.writeUnsignedShort = function(a) {
  3773. this.ensureWriteableSpace(2);
  3774. if (0 == (this.position & 1)) {
  3775. var b = new Uint16Array(this.arraybytes);
  3776. b[this.position >> 1] = ~~a & 65535
  3777. } 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);
  3778. this.position += 2;
  3779. this.position > this.length && (this.length = this.position)
  3780. };
  3781. a.prototype.readUTFBytes = function(a) {
  3782. var b = "";
  3783. a = this.position + a;
  3784. for (var c = new DataView(this.arraybytes); this.position < a;) {
  3785. var d = c.getUint8(this.position++);
  3786. if (128 > d) {
  3787. if (0 == d) break;
  3788. b += String.fromCharCode(d)
  3789. } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | c.getUint8(this.position++) & 127);
  3790. else if (240 > d) var f = c.getUint8(this.position++),
  3791. b = b + String.fromCharCode((d & 31) << 12 | (f & 127) << 6 | c.getUint8(this.position++) & 127);
  3792. else var f = c.getUint8(this.position++),
  3793. h = c.getUint8(this.position++),
  3794. b = b + String.fromCharCode((d & 15) << 18 | (f & 127) << 12 | h << 6 & 127 | c.getUint8(this.position++) & 127)
  3795. }
  3796. return b
  3797. };
  3798. a.prototype.readInt = function() {
  3799. var a = (new DataView(this.arraybytes)).getInt32(this.position, this.isLittleEndian);
  3800. this.position += 4;
  3801. return a
  3802. };
  3803. a.prototype.readShort = function() {
  3804. var a = (new DataView(this.arraybytes)).getInt16(this.position, this.isLittleEndian);
  3805. this.position += 2;
  3806. return a
  3807. };
  3808. a.prototype.readDouble = function() {
  3809. var a = (new DataView(this.arraybytes)).getFloat64(this.position, this.isLittleEndian);
  3810. this.position += 8;
  3811. return a
  3812. };
  3813. a.prototype.readUnsignedShort = function() {
  3814. if (this.position > this.length + 2) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3815. if (0 == (this.position & 1)) {
  3816. var a = new Uint16Array(this.arraybytes),
  3817. b = this.position >> 1;
  3818. this.position += 2;
  3819. return a[b]
  3820. }
  3821. a = new Uint16Array(this.unalignedarraybytestemp, 0, 1);
  3822. b = new Uint8Array(this.arraybytes,
  3823. this.position, 2);
  3824. (new Uint8Array(this.unalignedarraybytestemp, 0, 2)).set(b);
  3825. this.position += 2;
  3826. return a[0]
  3827. };
  3828. a.prototype.writeUnsignedInt = function(a) {
  3829. this.ensureWriteableSpace(4);
  3830. if (0 == (this.position & 3)) {
  3831. var b = new Uint32Array(this.arraybytes);
  3832. b[this.position >> 2] = ~~a & 4294967295
  3833. } 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);
  3834. this.position += 4;
  3835. this.position > this.length &&
  3836. (this.length = this.position)
  3837. };
  3838. a.prototype.readUnsignedInt = function() {
  3839. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length;
  3840. if (0 == (this.position & 3)) {
  3841. var a = new Uint32Array(this.arraybytes),
  3842. b = this.position >> 2;
  3843. this.position += 4;
  3844. return a[b]
  3845. }
  3846. a = new Uint32Array(this.unalignedarraybytestemp, 0, 1);
  3847. b = new Uint8Array(this.arraybytes, this.position, 4);
  3848. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3849. this.position += 4;
  3850. return a[0]
  3851. };
  3852. a.prototype.writeFloat =
  3853. function(a) {
  3854. this.ensureWriteableSpace(4);
  3855. if (0 == (this.position & 3)) {
  3856. var b = new Float32Array(this.arraybytes);
  3857. b[this.position >> 2] = a
  3858. } 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);
  3859. this.position += 4;
  3860. this.position > this.length && (this.length = this.position)
  3861. };
  3862. a.prototype.readFloat = function() {
  3863. if (this.position > this.length + 4) throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" +
  3864. this.length;
  3865. if (0 == (this.position & 3)) {
  3866. var a = new Float32Array(this.arraybytes),
  3867. b = this.position >> 2;
  3868. this.position += 4;
  3869. return a[b]
  3870. }
  3871. a = new Float32Array(this.unalignedarraybytestemp, 0, 1);
  3872. b = new Uint8Array(this.arraybytes, this.position, 4);
  3873. (new Uint8Array(this.unalignedarraybytestemp, 0, 4)).set(b);
  3874. this.position += 4;
  3875. return a[0]
  3876. };
  3877. a.DEFAULT_ENDIAN = d.BIG_ENDIAN;
  3878. return a
  3879. }();
  3880. c.ByteArray = b;
  3881. b.prototype.__class__ = "egret.ByteArray"
  3882. })(egret || (egret = {}));
  3883. __extends = this.__extends || function(c, d) {
  3884. function b() {
  3885. this.constructor = c
  3886. }
  3887. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  3888. b.prototype = d.prototype;
  3889. c.prototype = new b
  3890. };
  3891. (function(c) {
  3892. var d = function(b) {
  3893. function a(a, c, d) {
  3894. b.call(this);
  3895. this._target = null;
  3896. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  3897. this._actions = this._steps = this.pluginData = null;
  3898. this.paused = !1;
  3899. this.duration = 0;
  3900. this._prevPos = -1;
  3901. this.position = null;
  3902. this._stepPosition = this._prevPosition = 0;
  3903. this.passive = !1;
  3904. this.initialize(a, c, d)
  3905. }
  3906. __extends(a, b);
  3907. a.get = function(e, b, c, d) {
  3908. "undefined" === typeof b && (b = null);
  3909. "undefined" === typeof c && (c = null);
  3910. "undefined" === typeof d && (d = !1);
  3911. d && a.removeTweens(e);
  3912. return new a(e, b, c)
  3913. };
  3914. a.removeTweens = function(e) {
  3915. if (e.tween_count) {
  3916. for (var b = a._tweens, c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
  3917. e.tween_count = 0
  3918. }
  3919. };
  3920. a.tick = function(e, b) {
  3921. "undefined" === typeof b && (b = !1);
  3922. for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  3923. var f = c[d];
  3924. b && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : e)
  3925. }
  3926. };
  3927. a._register = function(e, b) {
  3928. var d = e._target,
  3929. l = a._tweens;
  3930. if (b) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), l.push(e), a._inited || (c.Ticker.getInstance().register(a.tick, null),
  3931. a._inited = !0);
  3932. else
  3933. for (d && d.tween_count--, d = l.length; d--;)
  3934. if (l[d] == e) {
  3935. l.splice(d, 1);
  3936. break
  3937. }
  3938. };
  3939. a.removeAllTweens = function() {
  3940. for (var e = a._tweens, b = 0, c = e.length; b < c; b++) {
  3941. var d = e[b];
  3942. d.paused = !0;
  3943. d._target.tweenjs_count = 0
  3944. }
  3945. e.length = 0
  3946. };
  3947. a.prototype.initialize = function(e, b, c) {
  3948. this._target = e;
  3949. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
  3950. this.pluginData = c || {};
  3951. this._curQueueProps = {};
  3952. this._initQueueProps = {};
  3953. this._steps = [];
  3954. this._actions = [];
  3955. b && b.paused ? this.paused = !0 : a._register(this, !0);
  3956. b && null != b.position && this.setPosition(b.position, a.NONE)
  3957. };
  3958. a.prototype.setPosition = function(a, b) {
  3959. "undefined" === typeof b && (b = 1);
  3960. 0 > a && (a = 0);
  3961. var c = a,
  3962. d = !1;
  3963. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  3964. if (c == this._prevPos) return d;
  3965. var f = this._prevPos;
  3966. this.position = this._prevPos = c;
  3967. this._prevPosition = a;
  3968. if (this._target)
  3969. if (d) this._updateTargetProps(null, 1);
  3970. else if (0 < this._steps.length) {
  3971. for (var h =
  3972. 0, k = this._steps.length; h < k && !(this._steps[h].t > c); h++);
  3973. h = this._steps[h - 1];
  3974. this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d)
  3975. }
  3976. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < f ? (f != this.duration && this._runActions(f, this.duration), this._runActions(0, c, !0)) : this._runActions(f, c));
  3977. d && this.setPaused(!0);
  3978. this.dispatchEventWith("change");
  3979. return d
  3980. };
  3981. a.prototype._runActions = function(a, b, c) {
  3982. "undefined" === typeof c && (c = !1);
  3983. var d = a,
  3984. f = b,
  3985. h = -1,
  3986. k = this._actions.length,
  3987. m = 1;
  3988. a > b && (d = b,
  3989. f = a, h = k, k = m = -1);
  3990. for (;
  3991. (h += m) != k;) {
  3992. b = this._actions[h];
  3993. var n = b.t;
  3994. (n == f || n > d && n < f || c && n == a) && b.f.apply(b.o, b.p)
  3995. }
  3996. };
  3997. a.prototype._updateTargetProps = function(b, c) {
  3998. var d, l, f, h;
  3999. if (b || 1 != c) {
  4000. if (this.passive = !!b.v) return;
  4001. b.e && (c = b.e(c, 0, 1, 1));
  4002. d = b.p0;
  4003. l = b.p1
  4004. } else this.passive = !1, d = l = this._curQueueProps;
  4005. for (var k in this._initQueueProps) {
  4006. null == (f = d[k]) && (d[k] = f = this._initQueueProps[k]);
  4007. null == (h = l[k]) && (l[k] = h = f);
  4008. f = f == h || 0 == c || 1 == c || "number" != typeof f ? 1 == c ? h : f : f + (h - f) * c;
  4009. var m = !1;
  4010. if (h = a._plugins[k])
  4011. for (var n = 0, p = h.length; n <
  4012. p; n++) {
  4013. var t = h[n].tween(this, k, f, d, l, c, !!b && d == l, !b);
  4014. t == a.IGNORE ? m = !0 : f = t
  4015. }
  4016. m || (this._target[k] = f)
  4017. }
  4018. };
  4019. a.prototype.setPaused = function(b) {
  4020. this.paused = b;
  4021. a._register(this, !b);
  4022. return this
  4023. };
  4024. a.prototype._cloneProps = function(a) {
  4025. var b = {},
  4026. c;
  4027. for (c in a) b[c] = a[c];
  4028. return b
  4029. };
  4030. a.prototype._addStep = function(a) {
  4031. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  4032. return this
  4033. };
  4034. a.prototype._appendQueueProps = function(b) {
  4035. var c, d, l, f, h, k;
  4036. for (k in b)
  4037. if (void 0 === this._initQueueProps[k]) {
  4038. d = this._target[k];
  4039. if (c = a._plugins[k])
  4040. for (l =
  4041. 0, f = c.length; l < f; l++) d = c[l].init(this, k, d);
  4042. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  4043. }
  4044. for (k in b) {
  4045. d = this._curQueueProps[k];
  4046. if (c = a._plugins[k])
  4047. for (h = h || {}, l = 0, f = c.length; l < f; l++) c[l].step && c[l].step(this, k, d, b[k], h);
  4048. this._curQueueProps[k] = b[k]
  4049. }
  4050. h && this._appendQueueProps(h);
  4051. return this._curQueueProps
  4052. };
  4053. a.prototype._addAction = function(a) {
  4054. a.t = this.duration;
  4055. this._actions.push(a);
  4056. return this
  4057. };
  4058. a.prototype._set = function(a, b) {
  4059. for (var c in a) b[c] = a[c]
  4060. };
  4061. a.prototype.wait = function(a, b) {
  4062. if (null ==
  4063. a || 0 >= a) return this;
  4064. var c = this._cloneProps(this._curQueueProps);
  4065. return this._addStep({
  4066. d: a,
  4067. p0: c,
  4068. p1: c,
  4069. v: b
  4070. })
  4071. };
  4072. a.prototype.to = function(a, b, c) {
  4073. "undefined" === typeof c && (c = void 0);
  4074. if (isNaN(b) || 0 > b) b = 0;
  4075. return this._addStep({
  4076. d: b || 0,
  4077. p0: this._cloneProps(this._curQueueProps),
  4078. e: c,
  4079. p1: this._cloneProps(this._appendQueueProps(a))
  4080. })
  4081. };
  4082. a.prototype.call = function(a, b, c) {
  4083. "undefined" === typeof b && (b = void 0);
  4084. "undefined" === typeof c && (c = void 0);
  4085. return this._addAction({
  4086. f: a,
  4087. p: c ? c : [],
  4088. o: b ? b : this._target
  4089. })
  4090. };
  4091. a.prototype.set = function(a,
  4092. b) {
  4093. "undefined" === typeof b && (b = null);
  4094. return this._addAction({
  4095. f: this._set,
  4096. o: this,
  4097. p: [a, b ? b : this._target]
  4098. })
  4099. };
  4100. a.prototype.play = function(a) {
  4101. a || (a = this);
  4102. return this.call(a.setPaused, a, [!1])
  4103. };
  4104. a.prototype.pause = function(a) {
  4105. a || (a = this);
  4106. return this.call(a.setPaused, a, [!0])
  4107. };
  4108. a.prototype.tick = function(a) {
  4109. this.paused || this.setPosition(this._prevPosition + a)
  4110. };
  4111. a.NONE = 0;
  4112. a.LOOP = 1;
  4113. a.REVERSE = 2;
  4114. a._tweens = [];
  4115. a.IGNORE = {};
  4116. a._plugins = {};
  4117. a._inited = !1;
  4118. return a
  4119. }(c.EventDispatcher);
  4120. c.Tween = d;
  4121. d.prototype.__class__ = "egret.Tween"
  4122. })(egret ||
  4123. (egret = {}));
  4124. (function(c) {
  4125. var d = function() {
  4126. function b() {
  4127. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  4128. }
  4129. b.get = function(a) {
  4130. -1 > a && (a = -1);
  4131. 1 < a && (a = 1);
  4132. return function(b) {
  4133. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  4134. }
  4135. };
  4136. b.getPowIn = function(a) {
  4137. return function(b) {
  4138. return Math.pow(b, a)
  4139. }
  4140. };
  4141. b.getPowOut = function(a) {
  4142. return function(b) {
  4143. return 1 - Math.pow(1 - b, a)
  4144. }
  4145. };
  4146. b.getPowInOut = function(a) {
  4147. return function(b) {
  4148. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  4149. }
  4150. };
  4151. b.sineIn = function(a) {
  4152. return 1 - Math.cos(a *
  4153. Math.PI / 2)
  4154. };
  4155. b.sineOut = function(a) {
  4156. return Math.sin(a * Math.PI / 2)
  4157. };
  4158. b.sineInOut = function(a) {
  4159. return -0.5 * (Math.cos(Math.PI * a) - 1)
  4160. };
  4161. b.getBackIn = function(a) {
  4162. return function(b) {
  4163. return b * b * ((a + 1) * b - a)
  4164. }
  4165. };
  4166. b.getBackOut = function(a) {
  4167. return function(b) {
  4168. b -= 1;
  4169. return b * b * ((a + 1) * b + a) + 1
  4170. }
  4171. };
  4172. b.getBackInOut = function(a) {
  4173. a *= 1.525;
  4174. return function(b) {
  4175. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  4176. }
  4177. };
  4178. b.circIn = function(a) {
  4179. return -(Math.sqrt(1 - a * a) - 1)
  4180. };
  4181. b.circOut = function(a) {
  4182. return Math.sqrt(1 - a * a)
  4183. };
  4184. b.circInOut = function(a) {
  4185. return 1 >
  4186. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  4187. };
  4188. b.bounceIn = function(a) {
  4189. return 1 - b.bounceOut(1 - a)
  4190. };
  4191. b.bounceOut = function(a) {
  4192. 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
  4193. };
  4194. b.bounceInOut = function(a) {
  4195. return 0.5 > a ? 0.5 * b.bounceIn(2 * a) : 0.5 * b.bounceOut(2 * a - 1) + 0.5
  4196. };
  4197. b.getElasticIn = function(a, b) {
  4198. var c = 2 * Math.PI;
  4199. return function(d) {
  4200. if (0 == d || 1 == d) return d;
  4201. var l = b / c * Math.asin(1 / a);
  4202. return -(a * Math.pow(2, 10 *
  4203. (d -= 1)) * Math.sin((d - l) * c / b))
  4204. }
  4205. };
  4206. b.getElasticOut = function(a, b) {
  4207. var c = 2 * Math.PI;
  4208. return function(d) {
  4209. if (0 == d || 1 == d) return d;
  4210. var l = b / c * Math.asin(1 / a);
  4211. return a * Math.pow(2, -10 * d) * Math.sin((d - l) * c / b) + 1
  4212. }
  4213. };
  4214. b.getElasticInOut = function(a, b) {
  4215. var c = 2 * Math.PI;
  4216. return function(d) {
  4217. var l = b / c * Math.asin(1 / a);
  4218. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - l) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - l) * c / b) * 0.5 + 1
  4219. }
  4220. };
  4221. b.quadIn = b.getPowIn(2);
  4222. b.quadOut = b.getPowOut(2);
  4223. b.quadInOut = b.getPowInOut(2);
  4224. b.cubicIn = b.getPowIn(3);
  4225. b.cubicOut = b.getPowOut(3);
  4226. b.cubicInOut = b.getPowInOut(3);
  4227. b.quartIn = b.getPowIn(4);
  4228. b.quartOut = b.getPowOut(4);
  4229. b.quartInOut = b.getPowInOut(4);
  4230. b.quintIn = b.getPowIn(5);
  4231. b.quintOut = b.getPowOut(5);
  4232. b.quintInOut = b.getPowInOut(5);
  4233. b.backIn = b.getBackIn(1.7);
  4234. b.backOut = b.getBackOut(1.7);
  4235. b.backInOut = b.getBackInOut(1.7);
  4236. b.elasticIn = b.getElasticIn(1, 0.3);
  4237. b.elasticOut = b.getElasticOut(1, 0.3);
  4238. b.elasticInOut = b.getElasticInOut(1, 0.3 * 1.5);
  4239. return b
  4240. }();
  4241. c.Ease = d;
  4242. d.prototype.__class__ = "egret.Ease"
  4243. })(egret || (egret = {}));
  4244. (function(c) {
  4245. var d = function() {
  4246. function b() {}
  4247. b.prototype.play = function(a) {
  4248. "undefined" === typeof a && (a = !1);
  4249. var b = this.audio;
  4250. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  4251. };
  4252. b.prototype.pause = function() {
  4253. var a = this.audio;
  4254. a && a.pause()
  4255. };
  4256. b.prototype.load = function() {
  4257. var a = this.audio;
  4258. a && a.load()
  4259. };
  4260. b.prototype.addEventListener = function(a, b) {
  4261. this.audio && this.audio.addEventListener(a, b, !1)
  4262. };
  4263. b.prototype.removeEventListener = function(a, b) {
  4264. this.audio && this.audio.removeEventListener(a, b, !1)
  4265. };
  4266. b.prototype.setVolume =
  4267. function(a) {
  4268. var b = this.audio;
  4269. b && (b.volume = a)
  4270. };
  4271. b.prototype.getVolume = function() {
  4272. return this.audio ? this.audio.volume : 0
  4273. };
  4274. return b
  4275. }();
  4276. c.Sound = d;
  4277. d.prototype.__class__ = "egret.Sound"
  4278. })(egret || (egret = {}));
  4279. (function(c) {
  4280. var d = function() {
  4281. function b() {}
  4282. b.isNumber = function(a) {
  4283. return "number" === typeof a && !isNaN(a)
  4284. };
  4285. return b
  4286. }();
  4287. c.NumberUtils = d;
  4288. d.prototype.__class__ = "egret.NumberUtils"
  4289. })(egret || (egret = {}));
  4290. var __extends = this.__extends || function(c, d) {
  4291. function b() {
  4292. this.constructor = c
  4293. }
  4294. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4295. b.prototype = d.prototype;
  4296. c.prototype = new b
  4297. },
  4298. RES;
  4299. (function(c) {
  4300. var d = function(b) {
  4301. function a(a, c, d) {
  4302. "undefined" === typeof c && (c = !1);
  4303. "undefined" === typeof d && (d = !1);
  4304. b.call(this, a, c, d);
  4305. this.itemsTotal = this.itemsLoaded = 0
  4306. }
  4307. __extends(a, b);
  4308. a.dispatchResourceEvent = function(b, c, d, l, f, h) {
  4309. "undefined" === typeof d && (d = "");
  4310. "undefined" === typeof l && (l = null);
  4311. "undefined" === typeof f && (f = 0);
  4312. "undefined" === typeof h && (h = 0);
  4313. var k = egret.Event._getPropertyData(a);
  4314. k.groupName = d;
  4315. k.resItem = l;
  4316. k.itemsLoaded = f;
  4317. k.itemsTotal = h;
  4318. egret.Event._dispatchByTarget(a, b, c, k)
  4319. };
  4320. a.ITEM_LOAD_ERROR =
  4321. "itemLoadError";
  4322. a.CONFIG_COMPLETE = "configComplete";
  4323. a.GROUP_PROGRESS = "groupProgress";
  4324. a.GROUP_COMPLETE = "groupComplete";
  4325. return a
  4326. }(egret.Event);
  4327. c.ResourceEvent = d;
  4328. d.prototype.__class__ = "RES.ResourceEvent"
  4329. })(RES || (RES = {}));
  4330. (function(c) {
  4331. var d = function() {
  4332. function b(a, b, c) {
  4333. this._loaded = !1;
  4334. this.name = a;
  4335. this.url = b;
  4336. this.type = c
  4337. }
  4338. Object.defineProperty(b.prototype, "loaded", {
  4339. get: function() {
  4340. return this.data ? this.data.loaded : this._loaded
  4341. },
  4342. set: function(a) {
  4343. this.data && (this.data.loaded = a);
  4344. this._loaded = a
  4345. },
  4346. enumerable: !0,
  4347. configurable: !0
  4348. });
  4349. b.prototype.toString = function() {
  4350. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  4351. };
  4352. b.TYPE_XML = "xml";
  4353. b.TYPE_IMAGE = "image";
  4354. b.TYPE_BIN = "bin";
  4355. b.TYPE_TEXT = "text";
  4356. b.TYPE_JSON =
  4357. "json";
  4358. b.TYPE_SHEET = "sheet";
  4359. b.TYPE_FONT = "font";
  4360. b.TYPE_SOUND = "sound";
  4361. return b
  4362. }();
  4363. c.ResourceItem = d;
  4364. d.prototype.__class__ = "RES.ResourceItem"
  4365. })(RES || (RES = {}));
  4366. (function(c) {
  4367. var d = function() {
  4368. function b() {
  4369. this.keyMap = {};
  4370. this.groupDic = {}
  4371. }
  4372. b.prototype.getGroupByName = function(a) {
  4373. var b = [];
  4374. if (!this.groupDic[a]) return b;
  4375. a = this.groupDic[a];
  4376. for (var c = a.length, d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  4377. return b
  4378. };
  4379. b.prototype.getRawGroupByName = function(a) {
  4380. return this.groupDic[a] ? this.groupDic[a] : []
  4381. };
  4382. b.prototype.createGroup = function(a, b, c) {
  4383. "undefined" === typeof c && (c = !1);
  4384. if (!c && this.groupDic[a] || !b || 0 == b.length) return !1;
  4385. c = this.groupDic;
  4386. for (var d = [], l = b.length, f = 0; f <
  4387. l; f++) {
  4388. var h = b[f],
  4389. k = c[h];
  4390. if (k)
  4391. for (var h = k.length, m = 0; m < h; m++) {
  4392. var n = k[m]; - 1 == d.indexOf(n) && d.push(n)
  4393. } else(n = this.keyMap[h]) && -1 == d.indexOf(n) && d.push(n)
  4394. }
  4395. if (0 == d.length) return !1;
  4396. this.groupDic[a] = d;
  4397. return !0
  4398. };
  4399. b.prototype.parseConfig = function(a, b) {
  4400. if (a) {
  4401. var c = a.resources;
  4402. if (c)
  4403. for (var d = c.length, l = 0; l < d; l++) {
  4404. var f = c[l],
  4405. h = f.url;
  4406. h && -1 == h.indexOf("://") && (f.url = b + h);
  4407. this.addItemToKeyMap(f)
  4408. }
  4409. if (c = a.groups)
  4410. for (d = c.length, l = 0; l < d; l++) {
  4411. for (var h = c[l], k = [], m = h.keys.split(","), n = m.length, p = 0; p < n; p++) f = m[p].trim(), (f = this.keyMap[f]) && -1 == k.indexOf(f) && k.push(f);
  4412. this.groupDic[h.name] = k
  4413. }
  4414. }
  4415. };
  4416. b.prototype.addItemToKeyMap = function(a) {
  4417. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  4418. if (a.hasOwnProperty("subkeys")) {
  4419. var b = a.subkeys.split(",");
  4420. a.subkeys = b;
  4421. for (var c = b.length, d = 0; d < c; d++) {
  4422. var l = b[d];
  4423. null == this.keyMap[l] && (this.keyMap[l] = a)
  4424. }
  4425. }
  4426. };
  4427. b.prototype.getName = function(a) {
  4428. return (a = this.keyMap[a]) ? a.name : ""
  4429. };
  4430. b.prototype.getType = function(a) {
  4431. return (a = this.keyMap[a]) ? a.type : ""
  4432. };
  4433. b.prototype.getRawResourceItem = function(a) {
  4434. return this.keyMap[a]
  4435. };
  4436. b.prototype.getResourceItem = function(a) {
  4437. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  4438. };
  4439. b.prototype.parseResourceItem = function(a) {
  4440. var b = new c.ResourceItem(a.name, a.url, a.type);
  4441. b.data = a;
  4442. return b
  4443. };
  4444. return b
  4445. }();
  4446. c.ResourceConfig = d;
  4447. d.prototype.__class__ = "RES.ResourceConfig"
  4448. })(RES || (RES = {}));
  4449. __extends = this.__extends || function(c, d) {
  4450. function b() {
  4451. this.constructor = c
  4452. }
  4453. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4454. b.prototype = d.prototype;
  4455. c.prototype = new b
  4456. };
  4457. (function(c) {
  4458. var d = function(b) {
  4459. function a() {
  4460. b.call(this);
  4461. this.thread = 2;
  4462. this.loadingCount = 0;
  4463. this.groupTotalDic = {};
  4464. this.numLoadedDic = {};
  4465. this.itemListDic = {};
  4466. this.priorityQueue = {};
  4467. this.lazyLoadList = [];
  4468. this.analyzerDic = {};
  4469. this.queueIndex = 0
  4470. }
  4471. __extends(a, b);
  4472. a.prototype.isGroupInLoading = function(a) {
  4473. return void 0 !== this.itemListDic[a]
  4474. };
  4475. a.prototype.loadGroup = function(a, b, d) {
  4476. "undefined" === typeof d && (d = 0);
  4477. if (!this.itemListDic[b] && b)
  4478. if (a && 0 != a.length) {
  4479. this.priorityQueue[d] ? this.priorityQueue[d].push(b) : this.priorityQueue[d] =
  4480. [b];
  4481. this.itemListDic[b] = a;
  4482. d = a.length;
  4483. for (var l = 0; l < d; l++) a[l].groupName = b;
  4484. this.groupTotalDic[b] = a.length;
  4485. this.numLoadedDic[b] = 0;
  4486. this.next()
  4487. } else a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE), a.groupName = b, this.dispatchEvent(a)
  4488. };
  4489. a.prototype.loadItem = function(a) {
  4490. this.lazyLoadList.push(a);
  4491. a.groupName = "";
  4492. this.next()
  4493. };
  4494. a.prototype.next = function() {
  4495. for (; this.loadingCount < this.thread;) {
  4496. var a = this.getOneResourceItem();
  4497. if (!a) break;
  4498. this.loadingCount++;
  4499. if (a.loaded) this.onItemComplete(a);
  4500. else {
  4501. var b = this.analyzerDic[a.type];
  4502. b || (b = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  4503. b.loadFile(a, this.onItemComplete, this)
  4504. }
  4505. }
  4506. };
  4507. a.prototype.getOneResourceItem = function() {
  4508. var a = Number.NEGATIVE_INFINITY,
  4509. b;
  4510. for (b in this.priorityQueue) a = Math.max(a, b);
  4511. a = this.priorityQueue[a];
  4512. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  4513. b = a.length;
  4514. for (var c, d = 0; d < b; d++) {
  4515. this.queueIndex >= b && (this.queueIndex = 0);
  4516. c = this.itemListDic[a[this.queueIndex]];
  4517. if (0 < c.length) break;
  4518. this.queueIndex++
  4519. }
  4520. return 0 ==
  4521. c.length ? null : c.shift()
  4522. };
  4523. a.prototype.onItemComplete = function(a) {
  4524. this.loadingCount--;
  4525. var b = a.groupName;
  4526. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, b, a);
  4527. if (b) {
  4528. this.numLoadedDic[b]++;
  4529. var d = this.numLoadedDic[b],
  4530. l = this.groupTotalDic[b];
  4531. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, b, a, d, l);
  4532. d == l && (this.removeGroupName(b), delete this.groupTotalDic[b], delete this.numLoadedDic[b], delete this.itemListDic[b], c.ResourceEvent.dispatchResourceEvent(this,
  4533. c.ResourceEvent.GROUP_COMPLETE, b))
  4534. } else this.callBack.call(this.resInstance, a);
  4535. this.next()
  4536. };
  4537. a.prototype.removeGroupName = function(a) {
  4538. for (var b in this.priorityQueue) {
  4539. for (var c = this.priorityQueue[b], d = c.length, f = 0, h = !1, d = c.length, k = 0; k < d; k++) {
  4540. if (c[k] == a) {
  4541. c.splice(f, 1);
  4542. h = !0;
  4543. break
  4544. }
  4545. f++
  4546. }
  4547. if (h) {
  4548. 0 == c.length && delete this.priorityQueue[b];
  4549. break
  4550. }
  4551. }
  4552. };
  4553. return a
  4554. }(egret.EventDispatcher);
  4555. c.ResourceLoader = d;
  4556. d.prototype.__class__ = "RES.ResourceLoader"
  4557. })(RES || (RES = {}));
  4558. __extends = this.__extends || function(c, d) {
  4559. function b() {
  4560. this.constructor = c
  4561. }
  4562. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4563. b.prototype = d.prototype;
  4564. c.prototype = new b
  4565. };
  4566. (function(c) {
  4567. var d = function(b) {
  4568. function a() {
  4569. b.call(this)
  4570. }
  4571. __extends(a, b);
  4572. a.prototype.loadFile = function(a, b, c) {};
  4573. a.prototype.getRes = function(a) {};
  4574. a.prototype.destroyRes = function(a) {
  4575. return !1
  4576. };
  4577. a.getStringPrefix = function(a) {
  4578. if (!a) return "";
  4579. var b = a.indexOf(".");
  4580. return -1 != b ? a.substring(0, b) : ""
  4581. };
  4582. a.getStringTail = function(a) {
  4583. if (!a) return "";
  4584. var b = a.indexOf(".");
  4585. return -1 != b ? a.substring(b + 1) : ""
  4586. };
  4587. return a
  4588. }(egret.HashObject);
  4589. c.AnalyzerBase = d;
  4590. d.prototype.__class__ = "RES.AnalyzerBase"
  4591. })(RES || (RES = {}));
  4592. __extends = this.__extends || function(c, d) {
  4593. function b() {
  4594. this.constructor = c
  4595. }
  4596. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4597. b.prototype = d.prototype;
  4598. c.prototype = new b
  4599. };
  4600. (function(c) {
  4601. var d = function(b) {
  4602. function a() {
  4603. b.call(this);
  4604. this.fileDic = {};
  4605. this.resItemDic = [];
  4606. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  4607. this.recycler = new egret.Recycler
  4608. }
  4609. __extends(a, b);
  4610. a.prototype.loadFile = function(a, b, c) {
  4611. if (this.fileDic[a.name]) b.call(c, a);
  4612. else {
  4613. var d = this.getLoader();
  4614. this.resItemDic[d.hashCode] = {
  4615. item: a,
  4616. func: b,
  4617. thisObject: c
  4618. };
  4619. d.load(new egret.URLRequest(a.url))
  4620. }
  4621. };
  4622. a.prototype.getLoader = function() {
  4623. var a = this.recycler.pop();
  4624. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  4625. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  4626. a.dataFormat = this._dataFormat;
  4627. return a
  4628. };
  4629. a.prototype.onLoadFinish = function(a) {
  4630. var b = a.target,
  4631. c = this.resItemDic[b.hashCode];
  4632. delete this.resItemDic[b.hashCode];
  4633. this.recycler.push(b);
  4634. var d = c.item,
  4635. f = c.func;
  4636. d.loaded = a.type == egret.Event.COMPLETE;
  4637. d.loaded && this.analyzeData(d, b.data);
  4638. f.call(c.thisObject, d)
  4639. };
  4640. a.prototype.analyzeData = function(a, b) {
  4641. var c = a.name;
  4642. !this.fileDic[c] && b && (this.fileDic[c] = b)
  4643. };
  4644. a.prototype.getRes =
  4645. function(a) {
  4646. return this.fileDic[a]
  4647. };
  4648. a.prototype.hasRes = function(a) {
  4649. return null != this.getRes(a)
  4650. };
  4651. a.prototype.destroyRes = function(a) {
  4652. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  4653. };
  4654. return a
  4655. }(c.AnalyzerBase);
  4656. c.BinAnalyzer = d;
  4657. d.prototype.__class__ = "RES.BinAnalyzer"
  4658. })(RES || (RES = {}));
  4659. __extends = this.__extends || function(c, d) {
  4660. function b() {
  4661. this.constructor = c
  4662. }
  4663. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4664. b.prototype = d.prototype;
  4665. c.prototype = new b
  4666. };
  4667. (function(c) {
  4668. var d = function(b) {
  4669. function a() {
  4670. b.call(this);
  4671. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  4672. }
  4673. __extends(a, b);
  4674. a.prototype.analyzeData = function(a, b) {
  4675. var c = a.name;
  4676. !this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  4677. };
  4678. return a
  4679. }(c.BinAnalyzer);
  4680. c.ImageAnalyzer = d;
  4681. d.prototype.__class__ = "RES.ImageAnalyzer"
  4682. })(RES || (RES = {}));
  4683. __extends = this.__extends || function(c, d) {
  4684. function b() {
  4685. this.constructor = c
  4686. }
  4687. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4688. b.prototype = d.prototype;
  4689. c.prototype = new b
  4690. };
  4691. (function(c) {
  4692. var d = function(b) {
  4693. function a() {
  4694. b.call(this);
  4695. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4696. }
  4697. __extends(a, b);
  4698. a.prototype.analyzeData = function(a, b) {
  4699. var c = a.name;
  4700. if (!this.fileDic[c] && b) try {
  4701. this.fileDic[c] = JSON.parse(b)
  4702. } catch (d) {
  4703. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4704. }
  4705. };
  4706. return a
  4707. }(c.BinAnalyzer);
  4708. c.JsonAnalyzer = d;
  4709. d.prototype.__class__ = "RES.JsonAnalyzer"
  4710. })(RES || (RES = {}));
  4711. __extends = this.__extends || function(c, d) {
  4712. function b() {
  4713. this.constructor = c
  4714. }
  4715. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4716. b.prototype = d.prototype;
  4717. c.prototype = new b
  4718. };
  4719. (function(c) {
  4720. var d = function(b) {
  4721. function a() {
  4722. b.call(this);
  4723. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4724. }
  4725. __extends(a, b);
  4726. return a
  4727. }(c.BinAnalyzer);
  4728. c.TextAnalyzer = d;
  4729. d.prototype.__class__ = "RES.TextAnalyzer"
  4730. })(RES || (RES = {}));
  4731. __extends = this.__extends || function(c, d) {
  4732. function b() {
  4733. this.constructor = c
  4734. }
  4735. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4736. b.prototype = d.prototype;
  4737. c.prototype = new b
  4738. };
  4739. (function(c) {
  4740. var d = function(b) {
  4741. function a() {
  4742. b.call(this);
  4743. this.sheetMap = {};
  4744. this.textureMap = {};
  4745. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4746. }
  4747. __extends(a, b);
  4748. a.prototype.getRes = function(a) {
  4749. var b = this.fileDic[a];
  4750. b || (b = this.textureMap[a]);
  4751. !b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.fileDic[b]) && (a = c.AnalyzerBase.getStringTail(a), b = b.getTexture(a));
  4752. return b
  4753. };
  4754. a.prototype.onLoadFinish = function(a) {
  4755. var b = a.target,
  4756. c = this.resItemDic[b.hashCode];
  4757. delete this.resItemDic[b.hashCode];
  4758. this.recycler.push(b);
  4759. var d =
  4760. c.item,
  4761. f = c.func;
  4762. d.loaded = a.type == egret.Event.COMPLETE;
  4763. d.loaded && this.analyzeData(d, b.data);
  4764. "string" == typeof b.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(d, f, c.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : f.call(c.thisObject, d)
  4765. };
  4766. a.prototype.analyzeData = function(a, b) {
  4767. var c = a.name;
  4768. if (!this.fileDic[c] && b) {
  4769. var d;
  4770. if ("string" == typeof b) {
  4771. try {
  4772. d = JSON.parse(b)
  4773. } catch (f) {
  4774. egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: " + a.url)
  4775. }
  4776. d && (this.sheetMap[c] =
  4777. d, a.loaded = !1, a.url = this.getRelativePath(a.url, d.file))
  4778. } else d = this.sheetMap[c], delete this.sheetMap[c], b && (d = this.parseSpriteSheet(b, d), this.fileDic[c] = d)
  4779. }
  4780. };
  4781. a.prototype.getRelativePath = function(a, b) {
  4782. a = a.split("\\").join("/");
  4783. var c = a.lastIndexOf("/");
  4784. return a = -1 != c ? a.substring(0, c + 1) + b : b
  4785. };
  4786. a.prototype.parseSpriteSheet = function(a, b) {
  4787. var c = b.frames;
  4788. if (!c) return null;
  4789. var d = new egret.SpriteSheet(a),
  4790. f = this.textureMap,
  4791. h;
  4792. for (h in c) {
  4793. var k = c[h];
  4794. a = d.createTexture(h, k.x, k.y, k.w, k.h, k.offX, k.offY, k.sourceW, k.sourceH);
  4795. null == f[h] && (f[h] = a)
  4796. }
  4797. return d
  4798. };
  4799. return a
  4800. }(c.BinAnalyzer);
  4801. c.SheetAnalyzer = d;
  4802. d.prototype.__class__ = "RES.SheetAnalyzer"
  4803. })(RES || (RES = {}));
  4804. __extends = this.__extends || function(c, d) {
  4805. function b() {
  4806. this.constructor = c
  4807. }
  4808. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4809. b.prototype = d.prototype;
  4810. c.prototype = new b
  4811. };
  4812. (function(c) {
  4813. var d = function(b) {
  4814. function a() {
  4815. b.call(this)
  4816. }
  4817. __extends(a, b);
  4818. a.prototype.analyzeData = function(a, b) {
  4819. var c = a.name;
  4820. if (!this.fileDic[c] && b) {
  4821. var d;
  4822. "string" == typeof b ? (d = b, this.sheetMap[c] = d, a.loaded = !1, a.url = this.getTexturePath(a.url, d)) : (d = this.sheetMap[c], delete this.sheetMap[c], b && (d = new egret.BitmapTextSpriteSheet(b, d), this.fileDic[c] = d))
  4823. }
  4824. };
  4825. a.prototype.getTexturePath = function(a, b) {
  4826. var c = "",
  4827. d = b.split("\n")[2],
  4828. f = d.indexOf('file="'); - 1 != f && (d = d.substring(f + 6), f = d.indexOf('"'), c = d.substring(0,
  4829. f));
  4830. a = a.split("\\").join("/");
  4831. f = a.lastIndexOf("/");
  4832. return a = -1 != f ? a.substring(0, f + 1) + c : c
  4833. };
  4834. return a
  4835. }(c.SheetAnalyzer);
  4836. c.FontAnalyzer = d;
  4837. d.prototype.__class__ = "RES.FontAnalyzer"
  4838. })(RES || (RES = {}));
  4839. __extends = this.__extends || function(c, d) {
  4840. function b() {
  4841. this.constructor = c
  4842. }
  4843. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4844. b.prototype = d.prototype;
  4845. c.prototype = new b
  4846. };
  4847. (function(c) {
  4848. var d = function(b) {
  4849. function a() {
  4850. b.call(this);
  4851. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  4852. }
  4853. __extends(a, b);
  4854. return a
  4855. }(c.BinAnalyzer);
  4856. c.SoundAnalyzer = d;
  4857. d.prototype.__class__ = "RES.SoundAnalyzer"
  4858. })(RES || (RES = {}));
  4859. __extends = this.__extends || function(c, d) {
  4860. function b() {
  4861. this.constructor = c
  4862. }
  4863. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4864. b.prototype = d.prototype;
  4865. c.prototype = new b
  4866. };
  4867. (function(c) {
  4868. var d = function(b) {
  4869. function a() {
  4870. b.call(this);
  4871. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  4872. }
  4873. __extends(a, b);
  4874. a.prototype.analyzeData = function(a, b) {
  4875. var c = a.name;
  4876. if (!this.fileDic[c] && b) try {
  4877. var d = egret.XML.parse(b);
  4878. this.fileDic[c] = d
  4879. } catch (f) {}
  4880. };
  4881. return a
  4882. }(c.BinAnalyzer);
  4883. c.XMLAnalyzer = d;
  4884. d.prototype.__class__ = "RES.XMLAnalyzer"
  4885. })(RES || (RES = {}));
  4886. __extends = this.__extends || function(c, d) {
  4887. function b() {
  4888. this.constructor = c
  4889. }
  4890. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  4891. b.prototype = d.prototype;
  4892. c.prototype = new b
  4893. };
  4894. (function(c) {
  4895. c.loadConfig = function(a, c, d) {
  4896. "undefined" === typeof c && (c = "");
  4897. "undefined" === typeof d && (d = "json");
  4898. b.loadConfig(a, c, d)
  4899. };
  4900. c.loadGroup = function(a, c) {
  4901. "undefined" === typeof c && (c = 0);
  4902. b.loadGroup(a, c)
  4903. };
  4904. c.isGroupLoaded = function(a) {
  4905. return b.isGroupLoaded(a)
  4906. };
  4907. c.getGroupByName = function(a) {
  4908. return b.getGroupByName(a)
  4909. };
  4910. c.createGroup = function(a, c, d) {
  4911. "undefined" === typeof d && (d = !1);
  4912. return b.createGroup(a, c, d)
  4913. };
  4914. c.hasRes = function(a) {
  4915. return b.hasRes(a)
  4916. };
  4917. c.getRes = function(a) {
  4918. return b.getRes(a)
  4919. };
  4920. c.getResAsync =
  4921. function(a, c, d) {
  4922. b.getResAsync(a, c, d)
  4923. };
  4924. c.getResByUrl = function(a, c, d, q) {
  4925. "undefined" === typeof q && (q = "");
  4926. b.getResByUrl(a, c, d, q)
  4927. };
  4928. c.destroyRes = function(a) {
  4929. return b.destroyRes(a)
  4930. };
  4931. c.setMaxLoadingThread = function(a) {
  4932. b.setMaxLoadingThread(a)
  4933. };
  4934. c.addEventListener = function(a, c, d, q, l) {
  4935. "undefined" === typeof q && (q = !1);
  4936. "undefined" === typeof l && (l = 0);
  4937. b.addEventListener(a, c, d, q, l)
  4938. };
  4939. c.removeEventListener = function(a, c, d, q) {
  4940. "undefined" === typeof q && (q = !1);
  4941. b.removeEventListener(a, c, d, q)
  4942. };
  4943. var d = function(a) {
  4944. function b() {
  4945. a.call(this);
  4946. this.analyzerDic = {};
  4947. this.configItemList = [];
  4948. this.configComplete = this.callLaterFlag = !1;
  4949. this.loadedGroups = [];
  4950. this.groupNameList = [];
  4951. this.asyncDic = {};
  4952. this.init()
  4953. }
  4954. __extends(b, a);
  4955. b.prototype.getAnalyzerByType = function(a) {
  4956. var b = this.analyzerDic[a];
  4957. b || (b = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  4958. return b
  4959. };
  4960. b.prototype.init = function() {
  4961. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  4962. egret.Injector.hasMapRule(c.AnalyzerBase,
  4963. c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  4964. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  4965. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  4966. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase,
  4967. c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  4968. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  4969. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  4970. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  4971. this.resConfig =
  4972. new c.ResourceConfig;
  4973. this.resLoader = new c.ResourceLoader;
  4974. this.resLoader.callBack = this.onResourceItemComp;
  4975. this.resLoader.resInstance = this;
  4976. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  4977. };
  4978. b.prototype.loadConfig = function(a, b, c) {
  4979. "undefined" === typeof c && (c = "json");
  4980. this.configItemList.push({
  4981. url: a,
  4982. resourceRoot: b,
  4983. type: c
  4984. });
  4985. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  4986. };
  4987. b.prototype.startLoadConfig = function() {
  4988. this.callLaterFlag = !1;
  4989. var a = this.configItemList;
  4990. this.configItemList = [];
  4991. this.loadingConfigList = a;
  4992. for (var d = a.length, l = [], f = 0; f < d; f++) {
  4993. var h = a[f],
  4994. h = new c.ResourceItem(h.url, h.url, h.type);
  4995. l.push(h)
  4996. }
  4997. this.resLoader.loadGroup(l, b.GROUP_CONFIG, Number.MAX_VALUE)
  4998. };
  4999. b.prototype.isGroupLoaded = function(a) {
  5000. return -1 != this.loadedGroups.indexOf(a)
  5001. };
  5002. b.prototype.getGroupByName = function(a) {
  5003. return this.resConfig.getGroupByName(a)
  5004. };
  5005. b.prototype.loadGroup = function(a, b) {
  5006. "undefined" === typeof b && (b = 0);
  5007. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  5008. if (this.configComplete) {
  5009. var c =
  5010. this.resConfig.getGroupByName(a);
  5011. this.resLoader.loadGroup(c, a, b)
  5012. } else this.groupNameList.push({
  5013. name: a,
  5014. priority: b
  5015. })
  5016. };
  5017. b.prototype.createGroup = function(a, b, c) {
  5018. "undefined" === typeof c && (c = !1);
  5019. if (c) {
  5020. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  5021. }
  5022. return this.resConfig.createGroup(a, b, c)
  5023. };
  5024. b.prototype.onGroupComp = function(a) {
  5025. if (a.groupName == b.GROUP_CONFIG) {
  5026. a = this.loadingConfigList.length;
  5027. for (var d = 0; d < a; d++) {
  5028. var l = this.loadingConfigList[d],
  5029. f = this.getAnalyzerByType(l.type),
  5030. h = f.getRes(l.url);
  5031. f.destroyRes(l.url);
  5032. this.resConfig.parseConfig(h, l.resourceRoot)
  5033. }
  5034. this.configComplete = !0;
  5035. this.loadingConfigList = null;
  5036. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  5037. l = this.groupNameList;
  5038. a = l.length;
  5039. for (d = 0; d < a; d++) f = l[d], this.loadGroup(f.name, f.priority);
  5040. this.groupNameList = []
  5041. } else this.loadedGroups.push(a.groupName), this.dispatchEvent(a)
  5042. };
  5043. b.prototype.hasRes = function(a) {
  5044. var b = this.resConfig.getType(a);
  5045. return "" == b && (a = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(a),
  5046. "" == b) ? !1 : !0
  5047. };
  5048. b.prototype.getRes = function(a) {
  5049. var b = this.resConfig.getType(a);
  5050. return "" == b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(b), "" == b) ? null : this.getAnalyzerByType(b).getRes(a)
  5051. };
  5052. b.prototype.getResAsync = function(a, b, d) {
  5053. var e = this.resConfig.getType(a),
  5054. h = this.resConfig.getName(a);
  5055. if ("" == e && (h = c.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(h), "" == e)) {
  5056. b.call(d, null);
  5057. return
  5058. }(e = this.getAnalyzerByType(e).getRes(a)) ? b.call(d, e) : (a = {
  5059. key: a,
  5060. compFunc: b,
  5061. thisObject: d
  5062. }, this.asyncDic[h] ?
  5063. this.asyncDic[h].push(a) : (this.asyncDic[h] = [a], h = this.resConfig.getResourceItem(h), this.resLoader.loadItem(h)))
  5064. };
  5065. b.prototype.getResByUrl = function(a, b, d, e) {
  5066. "undefined" === typeof e && (e = "");
  5067. if (a) {
  5068. e || (e = this.getTypeByUrl(a));
  5069. var h = this.getAnalyzerByType(e).getRes(a);
  5070. h ? b.call(d, h) : (b = {
  5071. key: a,
  5072. compFunc: b,
  5073. thisObject: d
  5074. }, this.asyncDic[a] ? this.asyncDic[a].push(b) : (this.asyncDic[a] = [b], a = new c.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  5075. } else b.call(d, null)
  5076. };
  5077. b.prototype.getTypeByUrl = function(a) {
  5078. (a = a.substr(a.lastIndexOf(".") +
  5079. 1)) && (a = a.toLowerCase());
  5080. switch (a) {
  5081. case c.ResourceItem.TYPE_XML:
  5082. case c.ResourceItem.TYPE_JSON:
  5083. case c.ResourceItem.TYPE_SHEET:
  5084. break;
  5085. case "png":
  5086. case "jpg":
  5087. case "gif":
  5088. a = c.ResourceItem.TYPE_IMAGE;
  5089. break;
  5090. case "fnt":
  5091. a = c.ResourceItem.TYPE_FONT;
  5092. break;
  5093. case "txt":
  5094. a = c.ResourceItem.TYPE_TEXT;
  5095. break;
  5096. case "mp3":
  5097. case "ogg":
  5098. case "mpeg":
  5099. case "wav":
  5100. case "m4a":
  5101. case "mp4":
  5102. case "aiff":
  5103. case "wma":
  5104. case "mid":
  5105. a = c.ResourceItem.TYPE_SOUND;
  5106. break;
  5107. default:
  5108. a = c.ResourceItem.TYPE_BIN
  5109. }
  5110. return a
  5111. };
  5112. b.prototype.onResourceItemComp = function(a) {
  5113. var b =
  5114. this.asyncDic[a.name];
  5115. delete this.asyncDic[a.name];
  5116. a = this.getAnalyzerByType(a.type);
  5117. for (var c = b.length, d = 0; d < c; d++) {
  5118. var e = b[d],
  5119. k = a.getRes(e.key);
  5120. e.compFunc.call(e.thisObject, k)
  5121. }
  5122. };
  5123. b.prototype.destroyRes = function(a) {
  5124. var b = this.resConfig.getRawGroupByName(a);
  5125. if (b) {
  5126. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  5127. a = b.length;
  5128. for (var d = 0; d < a; d++) {
  5129. c = b[d];
  5130. c.loaded = !1;
  5131. var e = this.getAnalyzerByType(c.type);
  5132. e.destroyRes(c.name)
  5133. }
  5134. return !0
  5135. }
  5136. b = this.resConfig.getType(a);
  5137. if ("" == b) return !1;
  5138. c = this.resConfig.getRawResourceItem(a);
  5139. c.loaded = !1;
  5140. e = this.getAnalyzerByType(b);
  5141. return e.destroyRes(a)
  5142. };
  5143. b.prototype.setMaxLoadingThread = function(a) {
  5144. 1 > a && (a = 1);
  5145. this.resLoader.thread = a
  5146. };
  5147. b.GROUP_CONFIG = "RES__CONFIG";
  5148. return b
  5149. }(egret.EventDispatcher);
  5150. d.prototype.__class__ = "Resource";
  5151. var b = new d
  5152. })(RES || (RES = {}));
  5153. __extends = this.__extends || function(c, d) {
  5154. function b() {
  5155. this.constructor = c
  5156. }
  5157. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  5158. b.prototype = d.prototype;
  5159. c.prototype = new b
  5160. };
  5161. (function(c) {
  5162. var d = function(b) {
  5163. function a(c) {
  5164. "undefined" === typeof c && (c = 60);
  5165. b.call(this);
  5166. this.frameRate = c;
  5167. this._time = 0;
  5168. 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 ||
  5169. window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  5170. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  5171. return window.setTimeout(a, 1E3 / c)
  5172. });
  5173. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  5174. return window.clearTimeout(a)
  5175. });
  5176. a.instance = this;
  5177. this.registerListener()
  5178. }
  5179. __extends(a, b);
  5180. a.prototype.enterFrame = function() {
  5181. var b = a.instance,
  5182. d = a._thisObject,
  5183. q = a._callback,
  5184. l = c.getTimer();
  5185. q.call(d,
  5186. l - b._time);
  5187. b._time = l;
  5188. b._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  5189. };
  5190. a.prototype.executeMainLoop = function(b, c) {
  5191. a._callback = b;
  5192. a._thisObject = c;
  5193. this.enterFrame()
  5194. };
  5195. a.prototype.reset = function() {
  5196. var b = a.instance;
  5197. b._requestAnimationId && (b._time = c.getTimer(), a.cancelAnimationFrame.call(window, b._requestAnimationId), b.enterFrame())
  5198. };
  5199. a.prototype.registerListener = function() {
  5200. var b = function() {
  5201. a.instance.reset()
  5202. },
  5203. c = function() {
  5204. document[d] || b()
  5205. };
  5206. window.onfocus = b;
  5207. window.onblur = function() {};
  5208. var d, l;
  5209. "undefined" !== typeof document.hidden ? (d = "hidden", l = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", l = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", l = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", l = "webkitvisibilitychange");
  5210. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  5211. d && l && document.addEventListener(l, c, !1)
  5212. };
  5213. return a
  5214. }(c.DeviceContext);
  5215. c.HTML5DeviceContext =
  5216. d;
  5217. d.prototype.__class__ = "egret.HTML5DeviceContext"
  5218. })(egret || (egret = {}));
  5219. __extends = this.__extends || function(c, d) {
  5220. function b() {
  5221. this.constructor = c
  5222. }
  5223. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  5224. b.prototype = d.prototype;
  5225. c.prototype = new b
  5226. };
  5227. (function(c) {
  5228. var d = function(b) {
  5229. function a(a) {
  5230. this.canvas = a;
  5231. this.canvasContext = a.getContext("2d");
  5232. var c = this.canvasContext.setTransform,
  5233. d = this;
  5234. this.canvasContext.setTransform = function(a, b, e, k, m, n) {
  5235. d._matrixA = a;
  5236. d._matrixB = b;
  5237. d._matrixC = e;
  5238. d._matrixD = k;
  5239. d._matrixTx = m;
  5240. d._matrixTy = n;
  5241. c.call(d.canvasContext, a, b, e, k, m, n)
  5242. };
  5243. this._matrixA = 1;
  5244. this._matrixC = this._matrixB = 0;
  5245. this._matrixD = 1;
  5246. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  5247. b.call(this)
  5248. }
  5249. __extends(a, b);
  5250. a.prototype.clearScreen = function() {
  5251. this.setTransform(c.Matrix.identity.identity());
  5252. this.canvasContext.save();
  5253. this.canvasContext.fillStyle = '#fff';
  5254. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), b = 0, d = a.length; b < d; b++) {
  5255. var l = a[b];
  5256. this.canvasContext.fillRect(l.x + this._transformTx, l.y + this._transformTy, l.width, l.height);
  5257. // this.clearRect(l.x + this._transformTx, l.y + this._transformTy, l.width, l.height)
  5258. }
  5259. this.renderCost = 0
  5260. };
  5261. a.prototype.clearRect = function(a, b, c, d) {
  5262. this.canvasContext.clearRect(a, b, c, d)
  5263. };
  5264. a.prototype.drawImage = function(a, d, q, l, f, h, k, m, n) {
  5265. d /= c.MainContext.instance.rendererContext.texture_scale_factor;
  5266. q /= c.MainContext.instance.rendererContext.texture_scale_factor;
  5267. l /= c.MainContext.instance.rendererContext.texture_scale_factor;
  5268. f /= c.MainContext.instance.rendererContext.texture_scale_factor;
  5269. a = a._bitmapData;
  5270. h += this._transformTx;
  5271. k += this._transformTy;
  5272. var p = c.getTimer();
  5273. this.canvasContext.drawImage(a, d, q, l, f, h, k, m, n);
  5274. b.prototype.drawImage.call(this, a, d, q, l, f, h, k, m, n);
  5275. this.renderCost += c.getTimer() - p
  5276. };
  5277. a.prototype.setTransform = function(a) {
  5278. 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 =
  5279. this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  5280. };
  5281. a.prototype.setAlpha = function(a, b) {
  5282. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  5283. b ? (this.blendValue = b, this.canvasContext.globalCompositeOperation = b) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = c.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = c.BlendMode.NORMAL)
  5284. };
  5285. a.prototype.setupFont = function(a) {
  5286. var b = this.canvasContext,
  5287. c = a.italic ? "italic " : "normal ",
  5288. c = c + (a.bold ? "bold " : "normal "),
  5289. c = c + (a.size + "px " + a.fontFamily);
  5290. b.font = c;
  5291. b.textAlign = "left";
  5292. b.textBaseline = "middle"
  5293. };
  5294. a.prototype.measureText = function(a) {
  5295. return this.canvasContext.measureText(a).width
  5296. };
  5297. a.prototype.drawText = function(a, c, d, l, f) {
  5298. var h = a._strokeColorString,
  5299. k = a.stroke,
  5300. m = this.canvasContext;
  5301. m.fillStyle = a._textColorString;
  5302. m.strokeStyle = h;
  5303. k && (m.lineWidth = 2 * k, m.strokeText(c, d + this._transformTx, l + this._transformTy,
  5304. f || 65535));
  5305. m.fillText(c, d + this._transformTx, l + this._transformTy, f || 65535);
  5306. b.prototype.drawText.call(this, a, c, d, l, f)
  5307. };
  5308. a.prototype.strokeRect = function(a, b, c, d, f) {
  5309. this.canvasContext.strokeStyle = f;
  5310. this.canvasContext.strokeRect(a, b, c, d)
  5311. };
  5312. a.prototype.pushMask = function(a) {
  5313. this.canvasContext.save();
  5314. this.canvasContext.beginPath();
  5315. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  5316. this.canvasContext.clip();
  5317. this.canvasContext.closePath()
  5318. };
  5319. a.prototype.popMask = function() {
  5320. this.canvasContext.restore();
  5321. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  5322. };
  5323. return a
  5324. }(c.RendererContext);
  5325. c.HTML5CanvasRenderer = d;
  5326. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  5327. })(egret || (egret = {}));
  5328. var egret_h5_graphics;
  5329. (function(c) {
  5330. c.beginFill = function(b, a) {
  5331. "undefined" === typeof a && (a = 1);
  5332. var c = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  5333. this.fillStyleColor = c;
  5334. this.commandQueue.push(new d(this._setStyle, this, [c]))
  5335. };
  5336. c.drawRect = function(b, a, c, g) {
  5337. this.commandQueue.push(new d(function(a, b, c, d) {
  5338. var e = this.renderContext;
  5339. this.canvasContext.beginPath();
  5340. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  5341. this.canvasContext.closePath()
  5342. }, this, [b, a, c, g]));
  5343. this._fill()
  5344. };
  5345. c.drawCircle = function(b, a, c) {
  5346. this.commandQueue.push(new d(function(a,
  5347. b, c) {
  5348. var d = this.renderContext;
  5349. this.canvasContext.beginPath();
  5350. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  5351. this.canvasContext.closePath()
  5352. }, this, [b, a, c]));
  5353. this._fill()
  5354. };
  5355. c.lineStyle = function(b, a, c, g, q, l, f, h) {
  5356. "undefined" === typeof b && (b = NaN);
  5357. "undefined" === typeof a && (a = 0);
  5358. "undefined" === typeof c && (c = 1);
  5359. "undefined" === typeof g && (g = !1);
  5360. "undefined" === typeof q && (q = "normal");
  5361. "undefined" === typeof l && (l = null);
  5362. "undefined" === typeof f && (f = null);
  5363. "undefined" === typeof h && (h = 3);
  5364. this.strokeStyleColor &&
  5365. (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  5366. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + c + ")";
  5367. this.commandQueue.push(new d(function(a, b) {
  5368. this.canvasContext.lineWidth = a;
  5369. this.canvasContext.strokeStyle = b;
  5370. this.canvasContext.beginPath()
  5371. }, this, [b, a]));
  5372. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  5373. this.moveTo(this.lineX, this.lineY)
  5374. };
  5375. c.lineTo = function(b, a) {
  5376. this.commandQueue.push(new d(function(a, b) {
  5377. var c = this.renderContext;
  5378. this.canvasContext.lineTo(c._transformTx +
  5379. a, c._transformTy + b)
  5380. }, this, [b, a]));
  5381. this.lineX = b;
  5382. this.lineY = a
  5383. };
  5384. c.curveTo = function(b, a, c, g) {
  5385. this.commandQueue.push(new d(function(a, b, c, d) {
  5386. var e = this.renderContext;
  5387. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  5388. }, this, [b, a, c, g]));
  5389. this.lineX = c;
  5390. this.lineY = g
  5391. };
  5392. c.moveTo = function(b, a) {
  5393. this.commandQueue.push(new d(function(a, b) {
  5394. var c = this.renderContext;
  5395. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  5396. }, this, [b, a]))
  5397. };
  5398. c.clear = function() {
  5399. this.lineY = this.lineX = this.commandQueue.length =
  5400. 0;
  5401. this.fillStyleColor = this.strokeStyleColor = null
  5402. };
  5403. c.createEndFillCommand = function() {
  5404. this.endFillCommand || (this.endFillCommand = new d(function() {
  5405. this.canvasContext.fill();
  5406. this.canvasContext.closePath()
  5407. }, this, null))
  5408. };
  5409. c.endFill = function() {
  5410. null != this.fillStyleColor && this._fill();
  5411. this.fillStyleColor = null
  5412. };
  5413. c._fill = function() {
  5414. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  5415. };
  5416. c.createEndLineCommand = function() {
  5417. this.endLineCommand || (this.endLineCommand = new d(function() {
  5418. this.canvasContext.stroke();
  5419. this.canvasContext.closePath()
  5420. }, this, null))
  5421. };
  5422. c._draw = function(b) {
  5423. this.renderContext = b;
  5424. b = this.canvasContext = this.renderContext.canvasContext;
  5425. b.save();
  5426. var a = this.commandQueue.length;
  5427. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand), a = this.commandQueue.length);
  5428. for (var c = 0; c < a; c++) {
  5429. var d = this.commandQueue[c];
  5430. d.method.apply(d.thisObject, d.args)
  5431. }
  5432. b.restore()
  5433. };
  5434. var d = function() {
  5435. return function(b, a, c) {
  5436. this.method =
  5437. b;
  5438. this.thisObject = a;
  5439. this.args = c
  5440. }
  5441. }();
  5442. d.prototype.__class__ = "Command";
  5443. c._setStyle = function(b) {
  5444. this.canvasContext.fillStyle = b;
  5445. this.canvasContext.beginPath()
  5446. };
  5447. c.init = function() {
  5448. for (var b in c) egret.Graphics.prototype[b] = c[b];
  5449. egret.RendererContext.createRendererContext = function(a) {
  5450. return new egret.HTML5CanvasRenderer(a)
  5451. }
  5452. }
  5453. })(egret_h5_graphics || (egret_h5_graphics = {}));
  5454. egret_h5_graphics.init();
  5455. __extends = this.__extends || function(c, d) {
  5456. function b() {
  5457. this.constructor = c
  5458. }
  5459. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  5460. b.prototype = d.prototype;
  5461. c.prototype = new b
  5462. };
  5463. (function(c) {
  5464. var d = function(b) {
  5465. function a(a) {
  5466. b.call(this);
  5467. this.size = 2E3;
  5468. this.vertSize = 6;
  5469. this.contextLost = !1;
  5470. this.glContextId = 0;
  5471. this.currentBlendMode = "";
  5472. this.currentBaseTexture = null;
  5473. this.currentBatchSize = 0;
  5474. this.maskList = [];
  5475. this.maskDataFreeList = [];
  5476. this.canvasContext = document.createElement("canvas").getContext("2d");
  5477. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  5478. this.canvas = a;
  5479. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  5480. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  5481. this.projectionX = a.width / 2;
  5482. this.projectionY = -a.height / 2;
  5483. a = 6 * this.size;
  5484. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  5485. this.indices = new Uint16Array(a);
  5486. for (var d = 0, q = 0; d < a; d += 6, q += 4) this.indices[d + 0] = q + 0, this.indices[d + 1] = q + 1, this.indices[d + 2] = q + 2, this.indices[d + 3] = q + 0, this.indices[d + 4] = q + 2, this.indices[d + 5] = q + 3;
  5487. this.initWebGL();
  5488. this.shaderManager = new c.WebGLShaderManager(this.gl);
  5489. this.worldTransform = new c.Matrix;
  5490. this.initBlendMode();
  5491. c.MainContext.instance.addEventListener(c.Event.FINISH_RENDER,
  5492. this._draw, this);
  5493. c.TextField.prototype._draw = function(a) {
  5494. this.getDirty() && (this.cacheAsBitmap = !0);
  5495. c.DisplayObject.prototype._draw.call(this, a)
  5496. }
  5497. }
  5498. __extends(a, b);
  5499. a.prototype.handleContextLost = function() {
  5500. this.contextLost = !0
  5501. };
  5502. a.prototype.handleContextRestored = function() {
  5503. this.initWebGL();
  5504. this.shaderManager.setContext(this.gl);
  5505. this.contextLost = !1
  5506. };
  5507. a.prototype.initWebGL = function() {
  5508. for (var a = {
  5509. stencil: !0
  5510. }, b, c = ["experimental-webgl", "webgl"], d = 0; d < c.length; d++) {
  5511. try {
  5512. b = this.canvas.getContext(c[d], a)
  5513. } catch (f) {}
  5514. if (b) break
  5515. }
  5516. if (!b) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  5517. this.setContext(b)
  5518. };
  5519. a.prototype.setContext = function(a) {
  5520. this.gl = a;
  5521. a.id = this.glContextId++;
  5522. this.vertexBuffer = a.createBuffer();
  5523. this.indexBuffer = a.createBuffer();
  5524. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5525. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  5526. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5527. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  5528. a.disable(a.DEPTH_TEST);
  5529. a.disable(a.CULL_FACE);
  5530. a.enable(a.BLEND);
  5531. a.colorMask(!0, !0, !0, !0)
  5532. };
  5533. a.prototype.initBlendMode = function() {
  5534. a.blendModesWebGL[c.BlendMode.NORMAL] =
  5535. [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  5536. a.blendModesWebGL[c.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  5537. };
  5538. a.prototype.start = function() {
  5539. if (!this.contextLost) {
  5540. var a = this.gl;
  5541. a.activeTexture(a.TEXTURE0);
  5542. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  5543. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  5544. var b = this.shaderManager.defaultShader;
  5545. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  5546. var c = 4 * this.vertSize;
  5547. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  5548. a.vertexAttribPointer(b.aTextureCoord,
  5549. 2, a.FLOAT, !1, c, 8);
  5550. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  5551. }
  5552. };
  5553. a.prototype.clearScreen = function() {
  5554. var a = this.gl;
  5555. a.colorMask(!0, !0, !0, !0);
  5556. for (var b = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, l = b.length; d < l; d++) {
  5557. var f = b[d];
  5558. a.viewport(f.x, f.y, f.width, f.height);
  5559. a.bindFramebuffer(a.FRAMEBUFFER, null);
  5560. a.clearColor(0, 0, 0, 0);
  5561. a.clear(a.COLOR_BUFFER_BIT)
  5562. }
  5563. this.renderCost = 0
  5564. };
  5565. a.prototype.setBlendMode = function(b) {
  5566. b || (b = c.BlendMode.NORMAL);
  5567. if (this.currentBlendMode != b) {
  5568. var d = a.blendModesWebGL[b];
  5569. d && (this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = b)
  5570. }
  5571. };
  5572. a.prototype.drawImage = function(a, b, d, l, f, h, k, m, n) {
  5573. if (!this.contextLost) {
  5574. var p = c.MainContext.instance.rendererContext.texture_scale_factor;
  5575. b /= p;
  5576. d /= p;
  5577. l /= p;
  5578. f /= p;
  5579. this.createWebGLTexture(a);
  5580. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(), this.currentBaseTexture = a.webGLTexture;
  5581. var t = this.worldTransform,
  5582. r = t.a,
  5583. s = t.b,
  5584. u = t.c,
  5585. v = t.d,
  5586. x = t.tx,
  5587. y = t.ty;
  5588. 0 == h && 0 == k || t.append(1, 0, 0, 1, h, k);
  5589. 1 == l / m && 1 == f / n || t.append(m / l,
  5590. 0, 0, n / f, 0, 0);
  5591. h = t.a;
  5592. k = t.b;
  5593. m = t.c;
  5594. n = t.d;
  5595. var p = t.tx,
  5596. w = t.ty;
  5597. t.a = r;
  5598. t.b = s;
  5599. t.c = u;
  5600. t.d = v;
  5601. t.tx = x;
  5602. t.ty = y;
  5603. r = a._sourceWidth;
  5604. s = a._sourceHeight;
  5605. a = l;
  5606. t = f;
  5607. b /= r;
  5608. d /= s;
  5609. l /= r;
  5610. f /= s;
  5611. r = this.vertices;
  5612. s = 4 * this.currentBatchSize * this.vertSize;
  5613. u = this.worldAlpha;
  5614. r[s++] = p;
  5615. r[s++] = w;
  5616. r[s++] = b;
  5617. r[s++] = d;
  5618. r[s++] = u;
  5619. r[s++] = 16777215;
  5620. r[s++] = h * a + p;
  5621. r[s++] = k * a + w;
  5622. r[s++] = l + b;
  5623. r[s++] = d;
  5624. r[s++] = u;
  5625. r[s++] = 16777215;
  5626. r[s++] = h * a + m * t + p;
  5627. r[s++] = n * t + k * a + w;
  5628. r[s++] = l + b;
  5629. r[s++] = f + d;
  5630. r[s++] = u;
  5631. r[s++] = 16777215;
  5632. r[s++] = m * t + p;
  5633. r[s++] = n * t + w;
  5634. r[s++] = b;
  5635. r[s++] = f + d;
  5636. r[s++] = u;
  5637. r[s++] =
  5638. 16777215;
  5639. this.currentBatchSize++
  5640. }
  5641. };
  5642. a.prototype._draw = function() {
  5643. if (0 != this.currentBatchSize && !this.contextLost) {
  5644. var a = c.getTimer();
  5645. this.start();
  5646. var b = this.gl;
  5647. b.bindTexture(b.TEXTURE_2D, this.currentBaseTexture);
  5648. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  5649. b.bufferSubData(b.ARRAY_BUFFER, 0, d);
  5650. b.drawElements(b.TRIANGLES, 6 * this.currentBatchSize, b.UNSIGNED_SHORT, 0);
  5651. this.currentBatchSize = 0;
  5652. this.renderCost += c.getTimer() - a;
  5653. c.Profiler.getInstance().onDrawImage()
  5654. }
  5655. };
  5656. a.prototype.setTransform =
  5657. function(a) {
  5658. var b = this.worldTransform;
  5659. b.a = a.a;
  5660. b.b = a.b;
  5661. b.c = a.c;
  5662. b.d = a.d;
  5663. b.tx = a.tx;
  5664. b.ty = a.ty
  5665. };
  5666. a.prototype.setAlpha = function(a, b) {
  5667. this.worldAlpha = a;
  5668. b && this.setBlendMode(b)
  5669. };
  5670. a.prototype.createWebGLTexture = function(a) {
  5671. if (!a.webGLTexture) {
  5672. var b = this.gl;
  5673. a.webGLTexture = b.createTexture();
  5674. b.bindTexture(b.TEXTURE_2D, a.webGLTexture);
  5675. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  5676. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a._bitmapData);
  5677. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  5678. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  5679. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  5680. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  5681. b.bindTexture(b.TEXTURE_2D, null)
  5682. }
  5683. };
  5684. a.prototype.pushMask = function(a) {
  5685. this._draw();
  5686. var b = this.gl;
  5687. 0 == this.maskList.length && (b.enable(b.STENCIL_TEST), b.stencilFunc(b.ALWAYS, 1, 1));
  5688. var c = this.maskDataFreeList.pop();
  5689. c ? (c.x = a.x, c.y = a.y, c.w = a.width, c.h = a.height) : c = {
  5690. x: a.x,
  5691. y: a.y,
  5692. w: a.width,
  5693. h: a.height
  5694. };
  5695. this.maskList.push(c);
  5696. b.colorMask(!1, !1, !1, !1);
  5697. b.stencilOp(b.KEEP, b.KEEP, b.INCR);
  5698. this.renderGraphics(c);
  5699. b.colorMask(!0, !0, !0, !0);
  5700. b.stencilFunc(b.NOTEQUAL, 0, this.maskList.length);
  5701. b.stencilOp(b.KEEP, b.KEEP, b.KEEP)
  5702. };
  5703. a.prototype.popMask = function() {
  5704. this._draw();
  5705. var a = this.gl,
  5706. b = this.maskList.pop();
  5707. 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));
  5708. 0 == this.maskList.length &&
  5709. a.disable(a.STENCIL_TEST)
  5710. };
  5711. a.prototype.setupFont = function(a) {
  5712. var b = this.canvasContext,
  5713. c = a.italic ? "italic " : "normal ",
  5714. c = c + (a.bold ? "bold " : "normal "),
  5715. c = c + (a.size + "px " + a.fontFamily);
  5716. b.font = c;
  5717. b.textAlign = "left";
  5718. b.textBaseline = "middle"
  5719. };
  5720. a.prototype.measureText = function(a) {
  5721. return this.canvasContext.measureText(a).width
  5722. };
  5723. a.prototype.renderGraphics = function(a) {
  5724. var b = this.gl,
  5725. c = this.shaderManager.primitiveShader;
  5726. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints =
  5727. [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  5728. this.updateGraphics(a);
  5729. this.shaderManager.activateShader(c);
  5730. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  5731. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  5732. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  5733. b.uniform2f(c.offsetVector, 0, 0);
  5734. b.uniform3fv(c.tintColor, [1, 1, 1]);
  5735. b.uniform1f(c.alpha, this.worldAlpha);
  5736. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5737. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  5738. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  5739. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5740. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  5741. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  5742. };
  5743. a.prototype.updateGraphics = function(a) {
  5744. var b = this.gl;
  5745. this.buildRectangle(a);
  5746. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  5747. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints),
  5748. b.STATIC_DRAW);
  5749. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  5750. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  5751. };
  5752. a.prototype.buildRectangle = function(a) {
  5753. var b = a.x,
  5754. c = a.y,
  5755. d = a.w;
  5756. a = a.h;
  5757. var f = this.graphicsPoints,
  5758. h = this.graphicsIndices,
  5759. k = f.length / 6;
  5760. f.push(b, c);
  5761. f.push(0, 0, 0, 1);
  5762. f.push(b + d, c);
  5763. f.push(0, 0, 0, 1);
  5764. f.push(b, c + a);
  5765. f.push(0, 0, 0, 1);
  5766. f.push(b + d, c + a);
  5767. f.push(0, 0, 0, 1);
  5768. h.push(k, k, k + 1, k + 2, k + 3, k + 3)
  5769. };
  5770. a.blendModesWebGL = {};
  5771. return a
  5772. }(c.RendererContext);
  5773. c.WebGLRenderer =
  5774. d;
  5775. d.prototype.__class__ = "egret.WebGLRenderer"
  5776. })(egret || (egret = {}));
  5777. (function(c) {
  5778. var d = function() {
  5779. function b() {}
  5780. b.compileProgram = function(a, c, d) {
  5781. d = b.compileFragmentShader(a, d);
  5782. c = b.compileVertexShader(a, c);
  5783. var q = a.createProgram();
  5784. a.attachShader(q, c);
  5785. a.attachShader(q, d);
  5786. a.linkProgram(q);
  5787. a.getProgramParameter(q, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  5788. return q
  5789. };
  5790. b.compileFragmentShader = function(a, c) {
  5791. return b._compileShader(a, c, a.FRAGMENT_SHADER)
  5792. };
  5793. b.compileVertexShader = function(a, c) {
  5794. return b._compileShader(a, c, a.VERTEX_SHADER)
  5795. };
  5796. b._compileShader =
  5797. function(a, b, c) {
  5798. c = a.createShader(c);
  5799. a.shaderSource(c, b);
  5800. a.compileShader(c);
  5801. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c : (console.log(a.getShaderInfoLog(c)), null)
  5802. };
  5803. b.checkCanUseWebGL = function() {
  5804. if (void 0 == b.canUseWebGL) try {
  5805. var a = document.createElement("canvas");
  5806. b.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  5807. } catch (c) {
  5808. b.canUseWebGL = !1
  5809. }
  5810. return b.canUseWebGL
  5811. };
  5812. return b
  5813. }();
  5814. c.WebGLUtils = d;
  5815. d.prototype.__class__ = "egret.WebGLUtils"
  5816. })(egret || (egret = {}));
  5817. (function(c) {
  5818. var d = function() {
  5819. function c(a) {
  5820. this.maxAttibs = 10;
  5821. this.attribState = [];
  5822. this.tempAttribState = [];
  5823. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  5824. this.setContext(a)
  5825. }
  5826. c.prototype.setContext = function(c) {
  5827. this.gl = c;
  5828. this.primitiveShader = new a(c);
  5829. this.defaultShader = new b(c);
  5830. this.activateShader(this.defaultShader)
  5831. };
  5832. c.prototype.activateShader = function(a) {
  5833. this.gl.useProgram(a.program);
  5834. this.setAttribs(a.attributes)
  5835. };
  5836. c.prototype.setAttribs = function(a) {
  5837. var b, c;
  5838. c = this.tempAttribState.length;
  5839. for (b =
  5840. 0; b < c; b++) this.tempAttribState[b] = !1;
  5841. c = a.length;
  5842. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  5843. a = this.gl;
  5844. c = this.attribState.length;
  5845. 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))
  5846. };
  5847. return c
  5848. }();
  5849. c.WebGLShaderManager = d;
  5850. d.prototype.__class__ = "egret.WebGLShaderManager";
  5851. var b = function() {
  5852. function a(b) {
  5853. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  5854. this.program = null;
  5855. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  5856. this.gl = b;
  5857. this.init()
  5858. }
  5859. a.prototype.init = function() {
  5860. var a = this.gl,
  5861. b = c.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  5862. a.useProgram(b);
  5863. this.uSampler = a.getUniformLocation(b, "uSampler");
  5864. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  5865. this.offsetVector =
  5866. a.getUniformLocation(b, "offsetVector");
  5867. this.dimensions = a.getUniformLocation(b, "dimensions");
  5868. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  5869. this.aTextureCoord = a.getAttribLocation(b, "aTextureCoord");
  5870. this.colorAttribute = a.getAttribLocation(b, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  5871. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  5872. this.program = b
  5873. };
  5874. return a
  5875. }();
  5876. c.EgretShader = b;
  5877. b.prototype.__class__ = "egret.EgretShader";
  5878. var a = function() {
  5879. function a(b) {
  5880. this.alpha =
  5881. this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  5882. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  5883. 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}";
  5884. this.gl = b;
  5885. this.init()
  5886. }
  5887. a.prototype.init = function() {
  5888. var a = this.gl,
  5889. b = c.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  5890. a.useProgram(b);
  5891. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  5892. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  5893. this.tintColor = a.getUniformLocation(b, "tint");
  5894. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  5895. this.colorAttribute = a.getAttribLocation(b, "aColor");
  5896. this.attributes = [this.aVertexPosition, this.colorAttribute];
  5897. this.translationMatrix =
  5898. a.getUniformLocation(b, "translationMatrix");
  5899. this.alpha = a.getUniformLocation(b, "alpha");
  5900. this.program = b
  5901. };
  5902. return a
  5903. }();
  5904. c.PrimitiveShader = a;
  5905. a.prototype.__class__ = "egret.PrimitiveShader"
  5906. })(egret || (egret = {}));
  5907. __extends = this.__extends || function(c, d) {
  5908. function b() {
  5909. this.constructor = c
  5910. }
  5911. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  5912. b.prototype = d.prototype;
  5913. c.prototype = new b
  5914. };
  5915. (function(c) {
  5916. var d = function(b) {
  5917. function a() {
  5918. b.call(this)
  5919. }
  5920. __extends(a, b);
  5921. a.prototype.proceed = function(a) {
  5922. function b(d) {
  5923. c.IOErrorEvent.dispatchIOErrorEvent(a)
  5924. }
  5925. function d(b) {
  5926. switch (a.dataFormat) {
  5927. case c.URLLoaderDataFormat.TEXT:
  5928. a.data = f.responseText;
  5929. break;
  5930. case c.URLLoaderDataFormat.VARIABLES:
  5931. a.data = new c.URLVariables(f.responseText);
  5932. break;
  5933. case c.URLLoaderDataFormat.BINARY:
  5934. a.data = f.response;
  5935. break;
  5936. default:
  5937. a.data = f.responseText
  5938. }
  5939. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  5940. }
  5941. if (a.dataFormat ==
  5942. c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  5943. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  5944. else {
  5945. var l = a._request,
  5946. f = this.getXHR();
  5947. f.onerror = b;
  5948. f.onload = d;
  5949. f.open(l.method, l.url, !0);
  5950. this.setResponseType(f, a.dataFormat);
  5951. l.method != c.URLRequestMethod.GET && l.data ? l.data instanceof c.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(l.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(l.data)) : f.send()
  5952. }
  5953. };
  5954. a.prototype.loadSound =
  5955. function(a) {
  5956. function b(f) {
  5957. window.clearTimeout(l.__timeoutId);
  5958. l.removeEventListener("canplaythrough", b, !1);
  5959. l.removeEventListener("error", d, !1);
  5960. f = new c.Sound;
  5961. f.audio = l;
  5962. a.data = f;
  5963. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  5964. }
  5965. function d(f) {
  5966. window.clearTimeout(l.__timeoutId);
  5967. l.removeEventListener("canplaythrough", b, !1);
  5968. l.removeEventListener("error", d, !1);
  5969. c.IOErrorEvent.dispatchIOErrorEvent(a)
  5970. }
  5971. var l = new Audio(a._request.url);
  5972. l.__timeoutId = window.setTimeout(b, 100);
  5973. l.addEventListener("canplaythrough",
  5974. b, !1);
  5975. l.addEventListener("error", d, !1);
  5976. l.load()
  5977. };
  5978. a.prototype.getXHR = function() {
  5979. return window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  5980. };
  5981. a.prototype.setResponseType = function(a, b) {
  5982. switch (b) {
  5983. case c.URLLoaderDataFormat.TEXT:
  5984. case c.URLLoaderDataFormat.VARIABLES:
  5985. a.responseType = c.URLLoaderDataFormat.TEXT;
  5986. break;
  5987. case c.URLLoaderDataFormat.BINARY:
  5988. a.responseType = "arraybuffer";
  5989. break;
  5990. default:
  5991. a.responseType = b
  5992. }
  5993. };
  5994. a.prototype.loadTexture = function(a) {
  5995. var b = a._request,
  5996. d = new Image;
  5997. d.crossOrigin = "Anonymous";
  5998. d.onload = function(b) {
  5999. d.onerror = null;
  6000. d.onload = null;
  6001. b = new c.Texture;
  6002. b._setBitmapData(d);
  6003. a.data = b;
  6004. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  6005. };
  6006. d.onerror = function(b) {
  6007. d.onerror = null;
  6008. d.onload = null;
  6009. c.IOErrorEvent.dispatchIOErrorEvent(a)
  6010. };
  6011. d.src = b.url
  6012. };
  6013. return a
  6014. }(c.NetContext);
  6015. c.HTML5NetContext = d;
  6016. d.prototype.__class__ = "egret.HTML5NetContext"
  6017. })(egret || (egret = {}));
  6018. __extends = this.__extends || function(c, d) {
  6019. function b() {
  6020. this.constructor = c
  6021. }
  6022. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6023. b.prototype = d.prototype;
  6024. c.prototype = new b
  6025. };
  6026. (function(c) {
  6027. var d = function(b) {
  6028. function a(a) {
  6029. b.call(this);
  6030. this.canvas = a;
  6031. this._isTouchDown = !1
  6032. }
  6033. __extends(a, b);
  6034. a.prototype.run = function() {
  6035. var a = this;
  6036. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown", function(b) {
  6037. a._onTouchBegin(b);
  6038. b.stopPropagation();
  6039. b.preventDefault()
  6040. }, !1), this.canvas.addEventListener("MSPointerMove", function(b) {
  6041. a._onTouchMove(b);
  6042. b.stopPropagation();
  6043. b.preventDefault()
  6044. }, !1), this.canvas.addEventListener("MSPointerUp", function(b) {
  6045. a._onTouchEnd(b);
  6046. b.stopPropagation();
  6047. b.preventDefault()
  6048. }, !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  6049. window.addEventListener("mousedown", function(b) {
  6050. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  6051. });
  6052. window.addEventListener("mouseup", function(b) {
  6053. a._isTouchDown && a.inOutOfCanvas(b) && a.dispatchLeaveStageEvent();
  6054. a._isTouchDown = !1
  6055. })
  6056. };
  6057. a.prototype.addMouseListener = function() {
  6058. var a = this;
  6059. this.canvas.addEventListener("mousedown", function(b) {
  6060. a._onTouchBegin(b)
  6061. });
  6062. this.canvas.addEventListener("mousemove", function(b) {
  6063. a._onTouchMove(b)
  6064. });
  6065. this.canvas.addEventListener("mouseup", function(b) {
  6066. a._onTouchEnd(b)
  6067. })
  6068. };
  6069. a.prototype.addTouchListener = function() {
  6070. var a = this;
  6071. this.canvas.addEventListener("touchstart", function(b) {
  6072. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchBegin(b.changedTouches[d]);
  6073. b.stopPropagation();
  6074. b.preventDefault()
  6075. }, !1);
  6076. this.canvas.addEventListener("touchmove",
  6077. function(b) {
  6078. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchMove(b.changedTouches[d]);
  6079. b.stopPropagation();
  6080. b.preventDefault()
  6081. }, !1);
  6082. this.canvas.addEventListener("touchend", function(b) {
  6083. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchEnd(b.changedTouches[d]);
  6084. b.stopPropagation();
  6085. b.preventDefault()
  6086. }, !1);
  6087. this.canvas.addEventListener("touchcancel", function(b) {
  6088. for (var c = b.changedTouches.length, d = 0; d < c && d < a.maxTouches; d++) a._onTouchEnd(b.changedTouches[d]);
  6089. b.stopPropagation();
  6090. b.preventDefault()
  6091. }, !1)
  6092. };
  6093. a.prototype.inOutOfCanvas = function(a) {
  6094. a = this.getLocation(this.canvas, a);
  6095. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  6096. };
  6097. a.prototype.dispatchLeaveStageEvent = function() {
  6098. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  6099. };
  6100. a.prototype._onTouchBegin = function(a) {
  6101. var b = this.getLocation(this.canvas, a),
  6102. c = -1;
  6103. a.hasOwnProperty("identifier") && (c = a.identifier);
  6104. this.onTouchBegan(b.x, b.y, c)
  6105. };
  6106. a.prototype._onTouchMove = function(a) {
  6107. var b = this.getLocation(this.canvas,
  6108. a),
  6109. c = -1;
  6110. a.hasOwnProperty("identifier") && (c = a.identifier);
  6111. this.onTouchMove(b.x, b.y, c)
  6112. };
  6113. a.prototype._onTouchEnd = function(a) {
  6114. var b = this.getLocation(this.canvas, a),
  6115. c = -1;
  6116. a.hasOwnProperty("identifier") && (c = a.identifier);
  6117. this.onTouchEnd(b.x, b.y, c)
  6118. };
  6119. a.prototype.getLocation = function(a, b) {
  6120. var d = document.documentElement,
  6121. l = window,
  6122. f, h;
  6123. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), f = h.left, h = h.top) : h = f = 0;
  6124. f += l.pageXOffset - d.clientLeft;
  6125. h += l.pageYOffset - d.clientTop;
  6126. null != b.pageX ? (d = b.pageX,
  6127. l = b.pageY) : (f -= document.body.scrollLeft, h -= document.body.scrollTop, d = b.clientX, l = b.clientY);
  6128. var k = c.Point.identity;
  6129. k.x = (d - f) / c.StageDelegate.getInstance().getScaleX();
  6130. k.y = (l - h) / c.StageDelegate.getInstance().getScaleY();
  6131. return k
  6132. };
  6133. return a
  6134. }(c.TouchContext);
  6135. c.HTML5TouchContext = d;
  6136. d.prototype.__class__ = "egret.HTML5TouchContext"
  6137. })(egret || (egret = {}));
  6138. var GameRes = function() {
  6139. function c() {}
  6140. c.loadSpriteSheet = function(d) {
  6141. c.currentSheet = RES.getRes(d)
  6142. };
  6143. c.getImageRes = function(d) {
  6144. return c.currentSheet.getTexture(d)
  6145. };
  6146. return c
  6147. }();
  6148. GameRes.prototype.__class__ = "GameRes";
  6149. var __extends = this.__extends || function(c, d) {
  6150. function b() {
  6151. this.constructor = c
  6152. }
  6153. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6154. b.prototype = d.prototype;
  6155. c.prototype = new b
  6156. },
  6157. ActorImage = function(c) {
  6158. function d(b, a, d, g) {
  6159. "undefined" === typeof d && (d = 4);
  6160. "undefined" === typeof g && (g = 4);
  6161. c.call(this);
  6162. this.labelHeight = 5;
  6163. this.frameColor = 7168096;
  6164. this.healthColor = 11196240;
  6165. this.dieColor = 16726272;
  6166. this.imageLayer = new egret.DisplayObjectContainer;
  6167. this.addChild(this.imageLayer);
  6168. this.imageLayer.width = a.width;
  6169. this.imageLayer.height =
  6170. a.height;
  6171. this.image = b;
  6172. this.image.x = 40;
  6173. this.image.y = 30;
  6174. this.image.frameRate = 15;
  6175. this.imageLayer.addChild(this.image);
  6176. this.flyImage = a;
  6177. this.imageLayer.addChild(this.flyImage);
  6178. this.flyImage.alpha = 0;
  6179. this.currentBlood = d;
  6180. this.totalBlood = g;
  6181. this.labelFrame = new egret.Shape;
  6182. this.label = new egret.Shape;
  6183. this.addChildAt(this.label, this.numChildren - 1)
  6184. }
  6185. __extends(d, c);
  6186. d.prototype.showFlyImage = function() {
  6187. this.imageLayer.contains(this.image) && this.imageLayer.removeChild(this.image);
  6188. this.flyImage.alpha = 1
  6189. };
  6190. d.prototype.hideFlyImage =
  6191. function() {
  6192. this.flyImage.alpha = 0;
  6193. this.imageLayer.contains(this.image) || this.imageLayer.addChild(this.image)
  6194. };
  6195. d.prototype.setCurBlood = function(b) {
  6196. this.currentBlood = b
  6197. };
  6198. d.prototype.setTotalBlood = function(b) {
  6199. this.totalBlood = b
  6200. };
  6201. d.prototype.addBloodLabel = function(b) {
  6202. this.labelDirection = b;
  6203. d.LABELLEFT == b ? (this.labelFrame.graphics.clear(), this.labelFrame.graphics.lineStyle(1, this.frameColor), this.labelFrame.graphics.beginFill(16777215, 1), this.labelFrame.graphics.drawRect(0, 0, this.labelHeight, this.imageLayer.height),
  6204. this.labelFrame.graphics.endFill(), this.labelFrame.x = this.imageLayer.x - this.labelHeight - 2, this.labelFrame.y = this.imageLayer.y, this.addChild(this.labelFrame), this.label.graphics.clear(), this.label.graphics.beginFill(this.healthColor, 1), this.label.graphics.drawRect(0, this.imageLayer.height * (1 - this.currentBlood / this.totalBlood), this.labelHeight, this.imageLayer.height * this.currentBlood / this.totalBlood), this.label.graphics.endFill(), this.label.x = this.labelFrame.x, this.label.y = this.labelFrame.y, this.addChild(this.label)) :
  6205. d.LABELRIGHT == b ? (this.labelFrame.graphics.clear(), this.labelFrame.graphics.lineStyle(1, this.frameColor), this.labelFrame.graphics.beginFill(16777215, 1), this.labelFrame.graphics.drawRect(0, 0, this.labelHeight, this.imageLayer.height), this.labelFrame.graphics.endFill(), this.labelFrame.x = this.imageLayer.x + this.imageLayer.width + 2 + 20, this.labelFrame.y = this.imageLayer.y, this.addChild(this.labelFrame), this.label.graphics.clear(), this.label.graphics.beginFill(this.healthColor, 1), this.label.graphics.drawRect(0,
  6206. this.imageLayer.height * (1 - this.currentBlood / this.totalBlood), this.labelHeight, this.imageLayer.height * this.currentBlood / this.totalBlood), this.label.graphics.endFill(), this.label.x = this.labelFrame.x, this.label.y = this.labelFrame.y, this.addChild(this.label)) : d.LABELTOP == b ? (this.labelFrame.graphics.clear(), this.labelFrame.graphics.lineStyle(1, this.frameColor), this.labelFrame.graphics.beginFill(16777215, 1), this.labelFrame.graphics.drawRect(0, 0, this.imageLayer.width, this.labelHeight), this.labelFrame.graphics.endFill(),
  6207. this.labelFrame.x = this.imageLayer.x, this.labelFrame.y = this.imageLayer.y - this.labelHeight - 2, this.addChild(this.labelFrame), this.label.graphics.clear(), this.label.graphics.beginFill(this.healthColor, 1), this.label.graphics.drawRect(0, this.imageLayer.width * (1 - this.currentBlood / this.totalBlood), this.currentBlood / this.totalBlood * this.imageLayer.width, this.labelHeight), this.label.graphics.endFill(), this.label.x = this.labelFrame.x, this.label.y = this.labelFrame.y, this.addChild(this.label)) : d.LABELBOTTOM == b &&
  6208. (this.labelFrame.graphics.clear(), this.labelFrame.graphics.lineStyle(1, this.frameColor), this.labelFrame.graphics.beginFill(16777215, 1), this.labelFrame.graphics.drawRect(0, 0, this.imageLayer.width, this.labelHeight), this.labelFrame.graphics.endFill(), this.labelFrame.x = this.imageLayer.x, this.labelFrame.y = this.imageLayer.y + this.imageLayer.height + 2, this.addChild(this.labelFrame), this.label.graphics.clear(), this.label.graphics.beginFill(this.healthColor, 1), this.label.graphics.drawRect(0, this.imageLayer.width *
  6209. (1 - this.currentBlood / this.totalBlood), this.currentBlood / this.totalBlood * this.imageLayer.width, this.labelHeight), this.label.graphics.endFill(), this.label.x = this.labelFrame.x, this.label.y = this.labelFrame.y, this.addChild(this.label))
  6210. };
  6211. d.prototype.updateBlood = function(b) {
  6212. 0 > b && (b = 0);
  6213. var a;
  6214. a = 1 == b ? this.dieColor : this.healthColor;
  6215. b <= this.totalBlood && (this.currentBlood = b, this.label.graphics.clear(), this.labelDirection == d.LABELBOTTOM ? (this.label.graphics.beginFill(a, 1), this.label.graphics.drawRect(0, this.imageLayer.width *
  6216. (1 - this.currentBlood / this.totalBlood), this.currentBlood / this.totalBlood * this.imageLayer.width, this.labelHeight), this.label.graphics.endFill()) : this.labelDirection == d.LABELTOP ? (this.label.graphics.beginFill(a, 1), this.label.graphics.drawRect(0, this.imageLayer.width * (1 - this.currentBlood / this.totalBlood), this.currentBlood / this.totalBlood * this.imageLayer.width, this.labelHeight), this.label.graphics.endFill()) : this.labelDirection == d.LABELLEFT ? (this.label.graphics.beginFill(a, 1), this.label.graphics.drawRect(0,
  6217. this.imageLayer.height * (1 - this.currentBlood / this.totalBlood), this.labelHeight, this.imageLayer.height * this.currentBlood / this.totalBlood), this.label.graphics.endFill()) : this.labelDirection == d.LABELRIGHT && (this.label.graphics.beginFill(a, 1), this.label.graphics.drawRect(0, this.imageLayer.height * (1 - this.currentBlood / this.totalBlood), this.labelHeight, this.imageLayer.height * this.currentBlood / this.totalBlood), this.label.graphics.endFill()))
  6218. };
  6219. d.prototype.hideBloodLabel = function() {
  6220. this.removeChild(this.label);
  6221. this.removeChild(this.labelFrame)
  6222. };
  6223. d.prototype.showBloodLabel = function() {
  6224. this.addChild(this.labelFrame);
  6225. this.addChild(this.label)
  6226. };
  6227. d.LABELTOP = "top";
  6228. d.LABELBOTTOM = "bottom";
  6229. d.LABELLEFT = "left";
  6230. d.LABELRIGHT = "right";
  6231. return d
  6232. }(egret.DisplayObjectContainer);
  6233. ActorImage.prototype.__class__ = "ActorImage";
  6234. var Actor = function(c) {
  6235. function d(b, a, e, g) {
  6236. "undefined" === typeof g && (g = 0);
  6237. c.call(this);
  6238. this.isFlying = 2;
  6239. this.totalBlood = this.blood = 4;
  6240. this.settingSide = !1;
  6241. this.jumpHeight = 80;
  6242. this.flyTime = 300;
  6243. this.jumpAction = null;
  6244. this.stageH = egret.MainContext.instance.stage.stageHeight;
  6245. this.stageW = egret.MainContext.instance.stage.stageWidth;
  6246. this.offset = g;
  6247. this.image = new ActorImage(new egret.MovieClip(RES.getRes(b), RES.getRes(a)), new egret.Bitmap(GameRes.getImageRes(e)), this.blood, this.blood);
  6248. this.image.width = this.image.flyImage.width;
  6249. this.image.height = this.image.flyImage.height;
  6250. this.image.x = -this.image.width - this.offset / 2 - 15;
  6251. this.image.y = -this.image.height / 2;
  6252. this.image.addBloodLabel(ActorImage.LABELLEFT);
  6253. this.imageReverse = new ActorImage(new egret.MovieClip(RES.getRes(b + "Reverse"), RES.getRes(a + "Reverse")), new egret.Bitmap(GameRes.getImageRes(e + "Reverse")), this.blood, this.blood);
  6254. this.imageReverse.width = this.imageReverse.flyImage.width;
  6255. this.imageReverse.height = this.imageReverse.flyImage.height;
  6256. this.imageReverse.x = this.offset / 2 - 3;
  6257. this.imageReverse.y = -this.imageReverse.height / 2;
  6258. this.imageReverse.addBloodLabel(ActorImage.LABELRIGHT);
  6259. this.groundX = this.image.x;
  6260. this.groundXReverse = this.imageReverse.x;
  6261. this.imageWidth = this.image.flyImage.width;
  6262. this.imageHeight = this.image.flyImage.height;
  6263. this.imageReverse.imageLayer.removeChild(this.imageReverse.image);
  6264. this.rollImage = new egret.Bitmap(GameRes.getImageRes("rolling"));
  6265. this.addChild(this.rollImage);
  6266. this.rollImage.alpha = 0;
  6267. this.rollImage.rotation = 180;
  6268. this.rollImage.anchorOffsetX = this.rollImage.width /
  6269. 2;
  6270. this.rollImage.anchorOffsetY = this.rollImage.height / 2;
  6271. this.rollImage.x = this.image.x + this.rollImage.width / 2;
  6272. this.rollImage.y = this.image.y + this.rollImage.height / 2;
  6273. this.image.image.gotoAndPlay("run");
  6274. this.imageReverse.image.gotoAndPlay("runReverse");
  6275. this.side = d.LEFT;
  6276. this.imageReverse.hideBloodLabel();
  6277. this.isFlying = 2;
  6278. this.addChild(this.image);
  6279. this.addChild(this.imageReverse)
  6280. }
  6281. __extends(d, c);
  6282. d.prototype.getSettingSide = function() {
  6283. return this.settingSide
  6284. };
  6285. d.prototype.setSide = function(b) {
  6286. this.side != b && (this.side =
  6287. b, b == d.LEFT ? (this.rollImage.alpha = 1, egret.Tween.get(this.rollImage).to({
  6288. rotation: 360,
  6289. x: this.groundX + this.rollImage.width / 2
  6290. }, 300).call(this.showLeftImage, this, null), this.hideRightImage(), this.settingSide = !0, this.imageReverse.hideBloodLabel()) : b == d.RIGHT && (this.rollImage.alpha = 1, egret.Tween.get(this.rollImage).to({
  6291. rotation: -360,
  6292. x: this.groundXReverse + this.rollImage.width / 2
  6293. }, 300).call(this.showRightImage, this, null), this.hideLeftImage(), this.settingSide = !0, this.image.hideBloodLabel()))
  6294. };
  6295. d.prototype.hideRolling =
  6296. function() {
  6297. this.rollImage.alpha = 0
  6298. };
  6299. d.prototype.hideLeftImage = function() {
  6300. this.image.imageLayer.removeChild(this.image.image);
  6301. this.image.flyImage.width = 0
  6302. };
  6303. d.prototype.hideRightImage = function() {
  6304. this.imageReverse.imageLayer.removeChild(this.imageReverse.image);
  6305. this.imageReverse.flyImage.width = 0
  6306. };
  6307. d.prototype.showLeftImage = function() {
  6308. this.showImage(d.LEFT);
  6309. this.hideRolling();
  6310. this.image.showBloodLabel();
  6311. this.settingSide = !1
  6312. };
  6313. d.prototype.showRightImage = function() {
  6314. this.showImage(d.RIGHT);
  6315. this.hideRolling();
  6316. this.imageReverse.showBloodLabel();
  6317. this.settingSide = !1
  6318. };
  6319. d.prototype.showImage = function(b) {
  6320. b == d.LEFT ? (this.image.x = this.groundX, this.image.imageLayer.addChild(this.image.image), this.image.flyImage.width = this.imageWidth) : b == d.RIGHT && (this.imageReverse.x = this.groundXReverse, this.imageReverse.imageLayer.addChild(this.imageReverse.image), this.imageReverse.flyImage.width = this.imageWidth)
  6321. };
  6322. d.prototype.updateActorBlood = function() {
  6323. this.image.updateBlood(this.blood);
  6324. this.imageReverse.updateBlood(this.blood);
  6325. console.log("blood: " + this.blood)
  6326. };
  6327. d.prototype.getSide = function() {
  6328. return this.side
  6329. };
  6330. d.prototype.getLeftFlyTime = function() {
  6331. return this.isFlying
  6332. };
  6333. d.prototype.setJumpHeight = function(b) {
  6334. this.jumpHeight = b
  6335. };
  6336. d.prototype.setFlyTime = function(b) {
  6337. this.flyTime = b
  6338. };
  6339. d.prototype.jumpNew = function(b) {
  6340. if (b == d.LEFT) {
  6341. this.isFlying--;
  6342. this.image.showFlyImage();
  6343. egret.Tween.removeTweens(this.image);
  6344. b = this.groundX - this.image.x;
  6345. b = this.flyTime * Math.sqrt(1 + b / this.jumpHeight);
  6346. var a = this.image.x - this.jumpHeight;
  6347. this.jumpAction =
  6348. egret.Tween.get(this.image).to({
  6349. x: a
  6350. }, this.flyTime, egret.Ease.quadOut).to({
  6351. x: this.groundX
  6352. }, b, egret.Ease.quadIn).call(this.finishJump, this, [d.LEFT])
  6353. } else b == d.RIGHT && (this.isFlying--, this.imageReverse.showFlyImage(), egret.Tween.removeTweens(this.imageReverse), b = this.imageReverse.x - this.groundXReverse, b = this.flyTime * Math.sqrt(1 + b / this.jumpHeight), a = this.imageReverse.x + this.jumpHeight, this.jumpAction = egret.Tween.get(this.imageReverse).to({
  6354. x: a
  6355. }, this.flyTime, egret.Ease.quadOut).to({
  6356. x: this.groundXReverse
  6357. },
  6358. b, egret.Ease.quadIn).call(this.finishJump, this, [d.RIGHT]))
  6359. };
  6360. d.prototype.finishJump = function(b) {
  6361. this.resetJumpTime();
  6362. this.jumpAction = null;
  6363. b == d.LEFT ? this.image.hideFlyImage() : b == d.RIGHT && this.imageReverse.hideFlyImage()
  6364. };
  6365. d.prototype.resetJumpTime = function() {
  6366. this.isFlying = 2
  6367. };
  6368. d.prototype.pauseJumpNew = function() {
  6369. null != this.jumpAction && this.jumpAction.setPaused(!0)
  6370. };
  6371. d.prototype.continueJumpNew = function() {
  6372. null != this.jumpAction && this.jumpAction.setPaused(!1)
  6373. };
  6374. d.prototype.getImage = function(b) {
  6375. if (b == d.LEFT) return this.image;
  6376. if (b == d.RIGHT) return this.imageReverse
  6377. };
  6378. d.produceFlag = function(b) {
  6379. null == d.flagDict[b] && (d.flagDict[b] = []);
  6380. var a = d.flagDict[b],
  6381. c;
  6382. 0 != a.length ? c = a.pop() : 0 == a.length && (c = new egret.Bitmap(GameRes.getImageRes(b)));
  6383. return c
  6384. };
  6385. d.reclaimFlag = function(b, a) {
  6386. b.alpha = 0;
  6387. null == d.flagDict[a] && (d.flagDict[a] = []);
  6388. var c = d.flagDict[a]; - 1 == c.indexOf(b) && c.push(b)
  6389. };
  6390. d.prototype.showFlag = function(b) {
  6391. var a = d.produceFlag(b);
  6392. this.addChild(a);
  6393. this.getSide() == d.LEFT ? (a.alpha = 1, a.x = this.image.x - a.width - 15 + 40, a.y = this.image.y, egret.Tween.get(a).to({
  6394. y: this.image.y -
  6395. 30,
  6396. alpha: 0
  6397. }, 500).call(d.reclaimFlag, this, [a, b])) : this.getSide() == d.RIGHT && (a.alpha = 1, a.x = this.imageReverse.x + this.imageReverse.width + 15, a.y = this.imageReverse.y, egret.Tween.get(a).to({
  6398. y: this.imageReverse.y - 30,
  6399. alpha: 0
  6400. }, 500).call(d.reclaimFlag, this, [a, b]))
  6401. };
  6402. d.LEFT = "left";
  6403. d.RIGHT = "right";
  6404. d.flagDict = {};
  6405. d.FLAG_PLUS = "plus";
  6406. d.FLAG_MINUS = "minus";
  6407. return d
  6408. }(egret.DisplayObjectContainer);
  6409. Actor.prototype.__class__ = "Actor";
  6410. var ActorStatusController = function() {
  6411. function c(c) {
  6412. this.actor = c;
  6413. this.stageH = egret.MainContext.instance.stage.stageHeight;
  6414. this.stageW = egret.MainContext.instance.stage.stageWidth
  6415. }
  6416. c.prototype.setActor = function(c) {
  6417. this.actor = c
  6418. };
  6419. c.prototype.handleEvent = function(c) {
  6420. c.stageX < this.stageW / 2 && 0 != this.actor.getLeftFlyTime() ? this.actor.getSide() != Actor.LEFT || this.actor.getSettingSide() ? this.actor.getSide() != Actor.RIGHT || 2 != this.actor.getLeftFlyTime() || this.actor.getSettingSide() || this.actor.setSide(Actor.LEFT) :
  6421. this.actor.jumpNew(Actor.LEFT) : c.stageX > this.stageW / 2 && 0 != this.actor.getLeftFlyTime() && (this.actor.getSide() != Actor.RIGHT || this.actor.getSettingSide() ? this.actor.getSide() != Actor.LEFT || 2 != this.actor.getLeftFlyTime() || this.actor.getSettingSide() || this.actor.setSide(Actor.RIGHT) : this.actor.jumpNew(Actor.RIGHT))
  6422. };
  6423. return c
  6424. }();
  6425. ActorStatusController.prototype.__class__ = "ActorStatusController";
  6426. var GameUtil = function() {
  6427. function c() {}
  6428. c.hitTest = function(c, b) {
  6429. var a = c.getSide() == Actor.LEFT ? c.getImage(Actor.LEFT) : c.getImage(Actor.RIGHT),
  6430. e = b.getBounds(),
  6431. g = a.flyImage.getBounds();
  6432. g.x = c.x + a.x;
  6433. g.y = c.y + a.y;
  6434. e.x = b.x;
  6435. e.y = b.y;
  6436. return g.intersects(e) || e.intersects(g)
  6437. };
  6438. c.hitTestItemItem = function(c, b) {
  6439. var a = c.getBounds(),
  6440. e = b.getBounds();
  6441. a.x = c.x;
  6442. a.y = c.y;
  6443. e.x = b.x;
  6444. e.y = b.y;
  6445. return a.intersects(e)
  6446. };
  6447. c.hitTestItemList = function(d, b) {
  6448. var a = !1;
  6449. if (0 == b.length) return a;
  6450. for (var e = 0; e < b.length && !(a = a || c.hitTestItemItem(d,
  6451. b[e])); e++);
  6452. return a
  6453. };
  6454. c.getPercent = function(c) {
  6455. var bfb= Math.ceil(100 * Math.sqrt(c / 80));
  6456. if(bfb>=100){bfb=98;}
  6457. return bfb;
  6458. };
  6459. return c
  6460. }();
  6461. GameUtil.prototype.__class__ = "GameUtil";
  6462. var __extends = this.__extends || function(c, d) {
  6463. function b() {
  6464. this.constructor = c
  6465. }
  6466. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6467. b.prototype = d.prototype;
  6468. c.prototype = new b
  6469. },
  6470. EndScene = function(c) {
  6471. function d() {
  6472. c.call(this);
  6473. this.createScene()
  6474. }
  6475. __extends(d, c);
  6476. d.prototype.createScene = function() {
  6477. this.stageW = egret.MainContext.instance.stage.stageWidth;
  6478. this.stageH = egret.MainContext.instance.stage.stageHeight;
  6479. var b = RES.getRes("gameTexture"),
  6480. a = new egret.Bitmap(b.getTexture("end0"));
  6481. this.addChild(a);
  6482. a.x = (this.stageW - a.width) / 2;
  6483. a.y = this.stageH / 10 + 80;
  6484. this.againBtn = new egret.Bitmap(b.getTexture("againBtn"));
  6485. this.addChild(this.againBtn);
  6486. this.againBtn.x = (this.stageW - this.againBtn.width) / 2;
  6487. this.againBtn.y = a.y + a.height + 10;
  6488. this.againBtn.touchEnabled = !0;
  6489. this.againBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.again, this);
  6490. //炫耀一下
  6491. this.xuanyao = new egret.Bitmap(b.getTexture("xuanyao"));
  6492. this.addChild(this.xuanyao);
  6493. this.xuanyao.x = (this.stageW - this.xuanyao.width) / 2;
  6494. this.xuanyao.y = a.y + a.height + 90;
  6495. this.xuanyao.touchEnabled = !0;
  6496. this.xuanyao.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.showOff, this);
  6497. //更多游戏
  6498. this.gengduo = new egret.Bitmap(b.getTexture("gengduo"));
  6499. this.addChild(this.gengduo);
  6500. this.gengduo.x = (this.stageW - this.gengduo.width) / 2;
  6501. this.gengduo.y = a.y + a.height + 172;
  6502. this.gengduo.touchEnabled = !0;
  6503. this.gengduo.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.moreGame, this);
  6504. a = new egret.Bitmap(b.getTexture("lace"));
  6505. // this.addChild(a);
  6506. a.x = 0;
  6507. // a.y = this.againBtn.y + this.againBtn.height + 20;
  6508. var c = new egret.Sprite;
  6509. c.graphics.beginFill(16759659, 1);
  6510. c.graphics.drawRect(0, 0, 480, 120);
  6511. c.graphics.endFill();
  6512. c.x = 0;
  6513. c.y = a.y + a.height;
  6514. // this.addChild(c);
  6515. a = new egret.Sprite;
  6516. a.graphics.beginFill(16756281, 1);
  6517. a.graphics.drawRect(0, 0, 480, this.stageH - (c.y + 120));
  6518. a.graphics.endFill();
  6519. a.x = 0;
  6520. a.y = c.y + 120;
  6521. // this.addChild(a);
  6522. var d = new egret.Bitmap(b.getTexture("gongxi"));
  6523. this.addChild(d);
  6524. d.x = this.stageW / 6;
  6525. d.y = c.y + 15;
  6526. this.scoreLabel1 = new egret.BitmapText;
  6527. c = RES.getRes("bmmFont");
  6528. this.scoreLabel1.spriteSheet = c;
  6529. this.addChild(this.scoreLabel1);
  6530. this.scoreLabel1.x = d.x + d.width + 20;
  6531. this.scoreLabel1.y = d.y - 12;
  6532. this.jibai = new egret.Bitmap(b.getTexture("jibai"));
  6533. this.addChild(this.jibai);
  6534. this.jibai.x = this.stageW / 3-100;
  6535. this.jibai.y = d.y + d.height + 13;
  6536. this.percent = new egret.BitmapText;
  6537. this.percent.spriteSheet = c;
  6538. this.addChild(this.percent);
  6539. this.percent.x = this.jibai.x + this.jibai.width + 15;
  6540. this.percent.y = this.jibai.y - 12;
  6541. //击败了
  6542. this.jibaile = new egret.Bitmap(b.getTexture("jibaile"));
  6543. this.addChild(this.jibaile);
  6544. this.jibaile.x = this.stageW / 3-100;
  6545. this.jibaile.y = d.y + d.height + 53;
  6546. //的人
  6547. this.degou = new egret.Bitmap(b.getTexture("degou"));
  6548. this.addChild(this.degou);
  6549. this.degou.y = this.jibaile.y;
  6550. this.bili = new egret.BitmapText;
  6551. this.bili.spriteSheet = c;
  6552. this.addChild(this.bili);
  6553. this.bili.x = this.jibai.x + this.jibai.width + 15;
  6554. this.bili.y = this.jibaile.y-10;
  6555. this.deren = new egret.Bitmap(b.getTexture("deren"));
  6556. this.addChild(this.deren);
  6557. this.deren.y = this.jibai.y;
  6558. c = new egret.Bitmap(b.getTexture("currentDistance"));
  6559. // this.addChild(c);
  6560. c.x = this.stageW / 6;
  6561. c.y = a.y + 25;
  6562. this.scoreLabel2 =new egret.BitmapText;
  6563. this.scoreLabel2.spriteSheet = RES.getRes("bmmFont");
  6564. // this.addChild(this.scoreLabel2);
  6565. this.scoreLabel2.x = c.x + c.width + 5;
  6566. this.scoreLabel2.y = c.y - 15;
  6567. a = new egret.Bitmap(b.getTexture("maxDistance"));
  6568. // this.addChild(a);
  6569. a.x = c.x;
  6570. a.y = c.y + c.height + 40;
  6571. this.maxScoreLabel = new egret.BitmapText;
  6572. this.maxScoreLabel.spriteSheet = this.scoreLabel2.spriteSheet;
  6573. // this.addChild(this.maxScoreLabel);
  6574. this.maxScoreLabel.x = this.scoreLabel2.x;
  6575. this.maxScoreLabel.y = a.y - 15;
  6576. a = new egret.Bitmap(b.getTexture("food"));
  6577. // this.addChild(a);
  6578. a.x = 3 * this.stageW / 4;
  6579. a.y = this.scoreLabel2.y + 15;
  6580. a.width = 35;
  6581. a.height = 33;
  6582. this.textFood = new egret.BitmapText;
  6583. this.textFood.spriteSheet = RES.getRes("mmFont");
  6584. this.textFood.text = " 15";
  6585. this.textFood.x = a.x + a.width;
  6586. this.textFood.y = a.y - 7;
  6587. // this.addChild(this.textFood);
  6588. c = new egret.Bitmap(b.getTexture("poison"));
  6589. // this.addChild(c);
  6590. c.x = a.x - 5;
  6591. c.y = this.maxScoreLabel.y + 5;
  6592. c.width = 35;
  6593. c.height = 33;
  6594. this.textPoison = new egret.BitmapText;
  6595. this.textPoison.spriteSheet = RES.getRes("mmFont");
  6596. this.textPoison.text = " 20";
  6597. this.textPoison.x = c.x + c.width;
  6598. this.textPoison.y = c.y - 7;
  6599. // this.addChild(this.textPoison);
  6600. a = new egret.Bitmap(b.getTexture("ptr"));
  6601. // this.addChild(a);
  6602. a.x = this.stageW - a.width - 30;
  6603. a.y = 0;
  6604. egret.Tween.get(a, {
  6605. loop: !0
  6606. }).to({
  6607. y: 10
  6608. }, 800, egret.Ease.backInOut).to({
  6609. y: 0
  6610. }, 800, egret.Ease.backInOut);
  6611. b = new egret.Bitmap(b.getTexture("timeLine"));
  6612. // this.addChild(b);
  6613. b.x = a.x - b.width + 10;
  6614. b.y = a.y + a.height - b.height + 10;
  6615. a = b.y;
  6616. egret.Tween.get(b, {
  6617. loop: !0
  6618. }).to({
  6619. y: a + 10
  6620. }, 800, egret.Ease.backInOut).to({
  6621. y: a
  6622. }, 800, egret.Ease.backInOut)
  6623. };
  6624. d.prototype.again = function(b) {
  6625. poisonCount=0;
  6626. // _hmt.push(["_trackEvent", "button", "gameRestart","yuebing:"+this.percent.text+"juli:"+this.scoreLabel1.text]);
  6627. b.target == this.againBtn && this.dispatchEventWith(d.GAMESTART, !0);
  6628. };
  6629. d.prototype.showOff = function(b) {
  6630. // _hmt.push(["_trackEvent", "button", "share"]);
  6631. if( /liebao/gi.test(navigator.userAgent) ){
  6632. var tipimg = document.getElementById('mk')
  6633. tipimg.src = 'http://www.liebao.cn/game/iq_test/images/share_tip_2.png';
  6634. tipimg.style.position = 'absolute';
  6635. tipimg.style.bottom = '10px';
  6636. tipimg.style.left = '5%';
  6637. }
  6638. document.getElementById('share').style.display='block';
  6639. };
  6640. d.prototype.moreGame = function(b) {
  6641. // _hmt.push(["_trackEvent", "button", "moreGame"]);
  6642. window.location.href="http://game.ikongzhong.cn/"
  6643. };
  6644. d.prototype.setScore = function(b) {
  6645. this.scoreLabel1.text = "" + b + "00 m";
  6646. this.scoreLabel2.text = "" + b + "00 m";
  6647. this.bili.text = "" + GameUtil.getPercent(b) + "%";
  6648. this.deren.x = this.percent.x + this.percent.width + 45;
  6649. this.degou.x = this.bili.x + this.bili.width + 15;
  6650. };
  6651. d.prototype.setFood = function(b) {
  6652. this.textFood.text = " " + b
  6653. };
  6654. d.prototype.setPoison = function(b) {
  6655. this.textPoison.text = " " + b
  6656. this.percent.text = "" + (poisonCount-b) ;
  6657. };
  6658. d.prototype.setMaxScore = function(b) {
  6659. this.maxScoreLabel.text = "" + b + "00 m"
  6660. };
  6661. d.GAMESTART = "gamestart";
  6662. return d
  6663. }(egret.Sprite);
  6664. EndScene.prototype.__class__ = "EndScene";
  6665. var __extends = this.__extends || function(c, d) {
  6666. function b() {
  6667. this.constructor = c
  6668. }
  6669. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6670. b.prototype = d.prototype;
  6671. c.prototype = new b
  6672. },
  6673. GameItem = function(c) {
  6674. function d(b) {
  6675. c.call(this, b)
  6676. }
  6677. __extends(d, c);
  6678. d.produce = function(b) {
  6679. null == d.cacheDict[b] && (d.cacheDict[b] = []);
  6680. var a = d.cacheDict[b],
  6681. a = 0 < a.length ? a.pop() : new d(GameRes.getImageRes(b));
  6682. a.textureName = b;
  6683. return a
  6684. };
  6685. d.reclaim = function(b, a) {
  6686. null == d.cacheDict[a] && (d.cacheDict[a] = []);
  6687. var c = d.cacheDict[a]; - 1 == c.indexOf(b) && c.push(b)
  6688. };
  6689. d.getArrayLength = function(b) {
  6690. return d.cacheDict[b].length
  6691. };
  6692. d.POISON = "poison";
  6693. d.FOOD = "food";
  6694. d.cacheDict = {};
  6695. return d
  6696. }(egret.Bitmap);
  6697. GameItem.prototype.__class__ = "GameItem";
  6698. var __extends = this.__extends || function(c, d) {
  6699. function b() {
  6700. this.constructor = c
  6701. }
  6702. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6703. b.prototype = d.prototype;
  6704. c.prototype = new b
  6705. },
  6706. LoadingUI = function(c) {
  6707. function d() {
  6708. c.call(this);
  6709. this.barHeight = 5;
  6710. this.createView()
  6711. }
  6712. __extends(d, c);
  6713. d.prototype.createView = function() {
  6714. this.stageW = egret.MainContext.instance.stage.stageWidth;
  6715. this.stageH = egret.MainContext.instance.stage.stageHeight;
  6716. this.barWidth = 3 * this.stageW / 4;
  6717. this.progress = new egret.Shape;
  6718. this.addChild(this.progress);
  6719. this.progress.x = (this.stageW - this.barWidth) / 2;
  6720. this.progress.y = this.stageH / 2;
  6721. this.frame = new egret.Shape;
  6722. this.addChildAt(this.frame, this.numChildren - 1);
  6723. this.frame.x = this.progress.x;
  6724. this.frame.y = this.progress.y;
  6725. this.frame.graphics.lineStyle(1, 7168096,0);
  6726. this.frame.graphics.beginFill(16777215, 1);
  6727. this.frame.graphics.drawRect(0, 0, this.barWidth, this.barHeight);
  6728. this.frame.graphics.endFill()
  6729. };
  6730. d.prototype.setProgress = function(b, a) {
  6731. this.progress.graphics.clear();
  6732. this.progress.graphics.beginFill(11196240, 1);
  6733. this.progress.graphics.drawRect(0,
  6734. 0, b / a * this.barWidth, this.barHeight);
  6735. this.progress.graphics.endFill()
  6736. };
  6737. return d
  6738. }(egret.Sprite);
  6739. LoadingUI.prototype.__class__ = "LoadingUI";
  6740. var __extends = this.__extends || function(c, d) {
  6741. function b() {
  6742. this.constructor = c
  6743. }
  6744. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6745. b.prototype = d.prototype;
  6746. c.prototype = new b
  6747. },
  6748. Obstacle = function(c) {
  6749. function d(b) {
  6750. c.call(this, b)
  6751. }
  6752. __extends(d, c);
  6753. d.produce = function(b) {
  6754. null == d.cacheDict[b] && (d.cacheDict[b] = []);
  6755. var a = d.cacheDict[b],
  6756. a = 0 < a.length ? a.pop() : new d(GameRes.getImageRes(b));
  6757. a.textureName = b;
  6758. return a
  6759. };
  6760. d.recalim = function(b, a) {
  6761. null == d.cacheDict[a] && (d.cacheDict[a] = []);
  6762. var c = d.cacheDict[a]; - 1 == c.indexOf(b) && c.push(b)
  6763. };
  6764. d.getArrayLength = function(b) {
  6765. return null == d.cacheDict[b] ? 0 : d.cacheDict[b].length
  6766. };
  6767. d.cacheDict = {};
  6768. d.SMALLBAR = "Sbar";
  6769. d.MIDBAR = "Mbar";
  6770. d.LONGBAR = "Lbar";
  6771. d.SMALLBRICK = "Sbr";
  6772. d.MIDBRICK = "Mbr";
  6773. d.LONGBRICK = "Lbr";
  6774. return d
  6775. }(egret.Bitmap);
  6776. Obstacle.prototype.__class__ = "Obstacle";
  6777. var poisonCount=0;
  6778. var _url = "http://q" + (Math.floor(Math.random() * 5000)) + ".140qcloud.com/game/wuren/?t=" + (new Date()).valueOf();;
  6779. var __extends = this.__extends || function(c, d) {
  6780. function b() {
  6781. this.constructor = c
  6782. }
  6783. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6784. b.prototype = d.prototype;
  6785. c.prototype = new b
  6786. },
  6787. StartScene = function(c) {
  6788. function d() {
  6789. c.call(this);
  6790. this.createScene()
  6791. }
  6792. __extends(d, c);
  6793. d.prototype.createScene = function() {
  6794. this.stageH = egret.MainContext.instance.stage.stageHeight;
  6795. this.stageW = egret.MainContext.instance.stage.stageWidth;
  6796. var b = new egret.Bitmap(GameRes.getImageRes("start0"));
  6797. this.addChild(b);
  6798. b.x = (this.stageW - b.width) / 2;
  6799. b.y = -b.height;
  6800. egret.Tween.get(b).to({
  6801. y: this.stageH / 3 - 50
  6802. }, 1E3, egret.Ease.bounceOut);
  6803. this.startBtn = new egret.Bitmap(GameRes.getImageRes("startbtn"));
  6804. this.addChild(this.startBtn);
  6805. this.startBtn.x = b.x;
  6806. this.startBtn.y = this.stageH / 3 + b.height;
  6807. this.startBtn.touchEnabled = !0;
  6808. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.start, this);
  6809. //
  6810. this.desc = new egret.Bitmap(GameRes.getImageRes("desc"));
  6811. this.addChild(this.desc);
  6812. this.desc.x = (this.stageW - this.desc.width) / 2;
  6813. this.desc.y = this.stageH / 3 -b.height;
  6814. this.share()
  6815. };
  6816. d.prototype.start = function(b) {
  6817. this.dispatchEventWith(d.START, !0)
  6818. };
  6819. d.prototype.share = function() {
  6820. function setShare(title, content){
  6821. LBGAME.Share.updateData({
  6822. call:false,// false只更新数据||true更新数据+调启用户端分享
  6823. title:title||"一起来玩【别吃五仁月饼】!超好玩!",
  6824. imgUrl:"http://www.liebao.cn/game/wuren/img/icon.png",
  6825. cont:content||"一起来玩【别吃五仁月饼】!超好玩!",
  6826. url:_url,
  6827. doneJump:"http://mp.weixin.qq.com/s?__biz=MjM5NzE3NzA1Mg==&mid=204087927&idx=1&sn=3502817ee0fcc4b2a98ee44d99d49728#rd",
  6828. fun:"" // 分享时回调,不 fun:function(){}
  6829. });
  6830. }
  6831. setShare();
  6832. LBGAME.Share.setShareUrl(function(url){
  6833. _url = url;
  6834. setShare();
  6835. });
  6836. };
  6837. d.START = "start";
  6838. return d
  6839. }(egret.Sprite);
  6840. StartScene.prototype.__class__ = "StartScene";
  6841. var __extends = this.__extends || function(c, d) {
  6842. function b() {
  6843. this.constructor = c
  6844. }
  6845. for (var a in d) d.hasOwnProperty(a) && (c[a] = d[a]);
  6846. b.prototype = d.prototype;
  6847. c.prototype = new b
  6848. },
  6849. GameScene = function(c) {
  6850. function d() {
  6851. c.call(this);
  6852. this.brickTimer = new egret.Timer(1700);
  6853. this.itemTimer = new egret.Timer(1500);
  6854. this.timer = new egret.Timer(1E3);
  6855. this.brickArray = [];
  6856. this.itemArray = [];
  6857. this.groundThickness = 30;
  6858. this.eatPoison = this.eatFood = this.bestDistance = this.distance = 0;
  6859. this.isPause = !1;
  6860. this.description = ["d1", "d2", "d3"];
  6861. this.hasShowDesc = !1;
  6862. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddedToStage, this)
  6863. }
  6864. __extends(d, c);
  6865. d.prototype.onAddedToStage = function() {
  6866. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  6867. this.loadingScene = new LoadingUI;
  6868. this.addChild(this.loadingScene);
  6869. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  6870. RES.loadConfig("js/resource.json", "./")
  6871. };
  6872. d.prototype.onConfigComplete = function() {
  6873. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,
  6874. this.onConfigComplete, this);
  6875. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onGroupComplete, this);
  6876. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onGroupProgress, this);
  6877. RES.loadGroup("preload")
  6878. };
  6879. d.prototype.onGroupProgress = function(b) {
  6880. this.loadingScene.setProgress(b.itemsLoaded, b.itemsTotal)
  6881. };
  6882. d.prototype.onGroupComplete = function() {
  6883. RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onGroupProgress, this);
  6884. RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onGroupComplete,
  6885. this);
  6886. GameRes.loadSpriteSheet("gameTexture");
  6887. this.removeChildren();
  6888. var b = new StartScene;
  6889. this.addChild(b);
  6890. this.addEventListener(StartScene.START, this.createScene, this)
  6891. };
  6892. d.prototype.createScene = function() {
  6893. this.removeChildren();
  6894. this.removeEventListener(StartScene.START, this.createScene, this);
  6895. this.addEventListener(EndScene.GAMESTART, this.gameRestart, this);
  6896. this.stageH = this.stage.stageHeight;
  6897. this.stageW = this.stage.stageWidth;
  6898. this.actor = new Actor("run_json", "run_png", "flying", this.groundThickness);
  6899. this.addChild(this.actor);
  6900. this.actor.x = this.stageW / 2;
  6901. this.actor.y = 2 * this.stageH / 3;
  6902. this.actorController = new ActorStatusController(this.actor);
  6903. this.width = this.stageW;
  6904. this.height = this.stageH;
  6905. this.touchEnabled = !0;
  6906. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.actorController.handleEvent, this.actorController);
  6907. var b = new egret.Shape;
  6908. b.x = this.stageW / 2;
  6909. b.y = 0;
  6910. b.graphics.lineStyle(this.groundThickness, 16756281);
  6911. b.graphics.lineTo(0, this.stageH);
  6912. this.addChildAt(b, 0);
  6913. b = new egret.Bitmap(GameRes.getImageRes("runIcon"));
  6914. this.addChild(b);
  6915. b.x = 5;
  6916. b.y = 5;
  6917. var a = new egret.Bitmap(GameRes.getImageRes("food"));
  6918. this.addChild(a);
  6919. a.x = b.x;
  6920. a.y = b.y + b.height + 5;
  6921. var c = new egret.Bitmap(GameRes.getImageRes("poison"));
  6922. // this.addChild(c);
  6923. c.x = b.x;
  6924. c.y = a.y + a.height + 5;
  6925. this.scoreCard = new egret.BitmapText;
  6926. this.scoreCard.spriteSheet = RES.getRes("mmFont");
  6927. this.scoreCard.text = "" + this.distance + "00 m";
  6928. this.scoreCard.x = b.x + b.width + 8;
  6929. this.scoreCard.y = b.y - 7;
  6930. this.addChild(this.scoreCard);
  6931. this.foodCard = new egret.BitmapText;
  6932. this.foodCard.spriteSheet = RES.getRes("mmFont");
  6933. this.foodCard.text = "" + this.eatFood;
  6934. this.foodCard.x = a.x + a.width + 8;
  6935. this.foodCard.y = a.y - 7;
  6936. this.addChild(this.foodCard);
  6937. this.poisonCard = new egret.BitmapText;
  6938. this.poisonCard.spriteSheet = RES.getRes("mmFont");
  6939. this.poisonCard.text = "" + this.eatPoison;
  6940. this.poisonCard.x = c.x + c.width + 8;
  6941. this.poisonCard.y = c.y - 7;
  6942. // this.addChild(this.poisonCard);
  6943. this.pauseBtn = new egret.Bitmap(GameRes.getImageRes("pause"));
  6944. this.addChild(this.pauseBtn);
  6945. this.pauseBtn.x = this.stageW - this.pauseBtn.width - 5;
  6946. this.pauseBtn.y = 5;
  6947. this.pauseBtn.touchEnabled = !0;
  6948. this.pauseBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,
  6949. this.pauseGame, this);
  6950. this.playBtn = new egret.Bitmap(GameRes.getImageRes("play"));
  6951. this.playBtn.x = this.pauseBtn.x;
  6952. this.playBtn.y = this.pauseBtn.y;
  6953. this.hasShowDesc || this.showDesc();
  6954. this.gameStart();
  6955. console.log("create Scene")
  6956. };
  6957. d.prototype.showDescWords = function(b, a) {
  6958. if (b == this.description.length) this.removeChild(a);
  6959. else {
  6960. a && this.removeChild(a);
  6961. var c = new egret.Bitmap(GameRes.getImageRes(this.description[b]));
  6962. this.addChildAt(c, this.numChildren - 1);
  6963. c.alpha = 0;
  6964. c.x = (this.stageW - c.width) / 2;
  6965. var d = this.stageH / 2;
  6966. c.y = d + 30;
  6967. egret.Tween.get(c).to({
  6968. y: d,
  6969. alpha: 1
  6970. }, 50).wait(1E3).to({
  6971. y: d - 30,
  6972. alpha: 0
  6973. }, 50).call(this.showDescWords, this, [b + 1, c])
  6974. }
  6975. };
  6976. d.prototype.showDesc = function() {
  6977. var b = function(a) {
  6978. return a.to({
  6979. width: c - 10,
  6980. height: d - 10
  6981. }, 80).wait(20).to({
  6982. width: c,
  6983. height: d
  6984. }, 80)
  6985. },
  6986. a = new egret.Bitmap(GameRes.getImageRes("gesture"));
  6987. this.addChild(a);
  6988. a.x = (this.stageW / 2 - this.groundThickness / 2 - a.width) / 2;
  6989. a.y = this.stageH / 3;
  6990. a.scale9Grid = new egret.Rectangle(0, 0, a.width, a.height);
  6991. var c = a.width,
  6992. d = a.height;
  6993. b(egret.Tween.get(a).wait(400)).wait(2620).to({
  6994. alpha: 0,
  6995. y: d + 30
  6996. }, 100).call(this.removeChild, this, [a]);
  6997. var q = new egret.Bitmap(GameRes.getImageRes("gesture"));
  6998. this.addChild(q);
  6999. q.x = this.stageW / 2 + a.x;
  7000. q.y = this.stageH / 3;
  7001. b(b(egret.Tween.get(q).wait(1300)).wait(200)).wait(1340).to({
  7002. alpha: 0,
  7003. y: d + 30
  7004. }, 100).call(this.removeChild, this, [q]);
  7005. this.showDescWords(0)
  7006. };
  7007. d.prototype.pauseGame = function() {
  7008. this.removeChild(this.pauseBtn);
  7009. this.pauseBtn.touchEnabled = !1;
  7010. this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.pauseGame, this);
  7011. this.playBtn.touchEnabled = !0;
  7012. this.addChild(this.playBtn);
  7013. this.playBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.continueGame, this);
  7014. this.brickTimer.stop();
  7015. this.itemTimer.stop();
  7016. this.timer.stop();
  7017. this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.actorController.handleEvent, this.actorController);
  7018. this.actor.pauseJumpNew();
  7019. this.actor.getImage(Actor.LEFT).image.stop();
  7020. this.actor.getImage(Actor.RIGHT).image.stop();
  7021. this.isPause = !0
  7022. };
  7023. d.prototype.continueGame = function() {
  7024. this.removeChild(this.playBtn);
  7025. this.playBtn.touchEnabled = !1;
  7026. this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,
  7027. this.continueGame, this);
  7028. this.pauseBtn.touchEnabled = !0;
  7029. this.addChild(this.pauseBtn);
  7030. this.pauseBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.pauseGame, this);
  7031. this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.actorController.handleEvent, this.actorController);
  7032. this.isPause = !1;
  7033. this.brickTimer.start();
  7034. this.itemTimer.start();
  7035. this.timer.start();
  7036. this.actor.getImage(Actor.LEFT).image.gotoAndPlay("run");
  7037. this.actor.getImage(Actor.RIGHT).image.gotoAndPlay("runReverse");
  7038. this.actor.continueJumpNew()
  7039. };
  7040. d.prototype.gameStart = function() {
  7041. // _hmt.push(["_trackEvent", "button", "gameStart"]);
  7042. this.actor.blood = 4;
  7043. this.eatPoison = this.eatFood = this.distance = 0;
  7044. this._lastTime = egret.getTimer();
  7045. this.timer.addEventListener(egret.TimerEvent.TIMER, this.countTime, this);
  7046. this.timer.start();
  7047. this.addEventListener(egret.Event.ENTER_FRAME, this.gameUpdate, this, !0);
  7048. this.isPause = !1;
  7049. this.brickTimer.addEventListener(egret.TimerEvent.TIMER, this.createObstacle, this);
  7050. this.brickTimer.delay = 1500;
  7051. this.brickTimer.start();
  7052. this.itemTimer.addEventListener(egret.TimerEvent.TIMER, this.createGameItem,this);
  7053. this.itemTimer.delay = 1E3;
  7054. this.itemTimer.start();
  7055. console.log("game Start")
  7056. };
  7057. d.prototype.createObstacle = function(b) {
  7058. if(this.distance*1 < 30){ return }
  7059. null == this.preBar && (this.preBar = Obstacle.produce(Obstacle.LONGBAR), Obstacle.recalim(this.preBar, this.preBar.textureName));
  7060. if (b.target == this.brickTimer) {
  7061. b = [Obstacle.LONGBAR, Obstacle.MIDBAR, Obstacle.SMALLBAR, Obstacle.MIDBRICK, Obstacle.SMALLBRICK, Obstacle.LONGBRICK];
  7062. var a;
  7063. a = Math.random();
  7064. 0 <= a && 0.19 > a && this.preBar.textureName != Obstacle.LONGBAR ? a = 0 : 0.19 <= a && 0.2 > a && this.preBar.textureName !=
  7065. Obstacle.LONGBRICK ? a = 5 : (a = Math.random(), a = 0.25 >= a ? 1 : 0.25 < a && 0.5 >= a ? 2 : 0.5 < a && 0.75 >= a ? 3 : 4);
  7066. b = Obstacle.produce(b[a]);
  7067. 0.5 >= Math.random() ? b.x = this.stageW / 2 - this.groundThickness / 2 - b.width : b.x = this.stageW / 2 + this.groundThickness / 2;
  7068. b.y = this.hasShowDesc ? -b.height - 600 * Math.random() : -b.height - 600 * Math.random() - 800;
  7069. this.addChildAt(b, this.numChildren - 1);
  7070. this.brickArray.push(b);
  7071. this.preBar = b;
  7072. console.log("create" + b.textureName + " array length= " + this.brickArray.length + " " + Obstacle.getArrayLength(b.textureName))
  7073. }
  7074. };
  7075. d.prototype.createGameItem = function(b) {
  7076. if (b.target == this.itemTimer) {
  7077. b = [GameItem.FOOD, GameItem.POISON];
  7078. var a = Math.random();
  7079. b = GameItem.produce(b[0 <= a && 0.4 > a ? 0 : 1]);
  7080. if (b.textureName=="poison") {poisonCount++;console.log(poisonCount)};
  7081. 0.5 >= Math.random() ? b.x = this.stageW / 2 - this.groundThickness / 2 - b.width - 5 : b.x = this.stageW / 2 + this.groundThickness / 2 + 5;
  7082. b.y = this.hasShowDesc ? -b.height - 500 * Math.random() : -b.height - 500 * Math.random() - 800;
  7083. b.width=35;
  7084. b.height=33;
  7085. this.addChildAt(b, this.numChildren - 1);
  7086. this.itemArray.push(b);
  7087. console.log("create item, array length= " + this.itemArray.length + " " + GameItem.getArrayLength(b.textureName))
  7088. }
  7089. };
  7090. d.prototype.gameUpdate = function() {
  7091. var b = egret.getTimer(),
  7092. a = 1E3 / (b - this._lastTime);
  7093. this._lastTime = b;
  7094. b = 60 / a;
  7095. this.isPause && (b = 0);
  7096. for (var b = 5 * b, c, d = [], a = 0; a < this.brickArray.length; a++) c = this.brickArray[a], c.y += b, c.y > this.stageH && d.push(c);
  7097. for (a = 0; a < this.itemArray.length; a++) c = this.itemArray[a], c.y += b, c.y > this.stageH && d.push(c);
  7098. for (a = 0; a < d.length; a++) d[a] instanceof Obstacle ? (c = d[a], Obstacle.recalim(c, c.textureName), this.contains(c) && this.removeChild(c), this.brickArray.splice(this.brickArray.indexOf(c),
  7099. 1)) : d[a] instanceof GameItem && (c = d[a], GameItem.reclaim(c, c.textureName), this.contains(c) && this.removeChild(c), this.itemArray.splice(this.itemArray.indexOf(c), 1));
  7100. this.gameHitTest()
  7101. };
  7102. d.prototype.gameHitTest = function() {
  7103. var b, a, c = this.brickArray.length,
  7104. d = this.itemArray.length;
  7105. for (b = 0; b < c; b++) a = this.brickArray[b], GameUtil.hitTest(this.actor, a) && (this.actor.blood -= 10, this.actor.updateActorBlood());
  7106. c = [];
  7107. for (b = 0; b < d; b++) a = this.itemArray[b], GameUtil.hitTest(this.actor, a) && (a.textureName == GameItem.POISON ? (this.contains(a) &&
  7108. this.removeChild(a), GameItem.reclaim(a, a.textureName), c.push(a), this.actor.blood -= 1, this.actor.updateActorBlood(), this.actor.showFlag(Actor.FLAG_MINUS), this.eatPoison++) : a.textureName == GameItem.FOOD && (this.contains(a) && this.removeChild(a), GameItem.reclaim(a, a.textureName), c.push(a), this.actor.blood < this.actor.totalBlood && (this.actor.blood += 1, this.actor.updateActorBlood()), this.actor.showFlag(Actor.FLAG_PLUS), this.eatFood++));
  7109. for (b = 0; b < c.length; b++) this.itemArray.splice(this.itemArray.indexOf(c[b]),
  7110. 1);
  7111. 0 >= this.actor.blood ? this.gameOver() : (this.scoreCard.text = this.distance + "00 m", this.foodCard.text = "" + this.eatFood, this.poisonCard.text = "" + this.eatPoison)
  7112. };
  7113. d.prototype.gameOver = function() {
  7114. this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.actorController.handleEvent, this.actorController);
  7115. this.removeEventListener(egret.Event.ENTER_FRAME, this.gameUpdate, this);
  7116. this.brickTimer.stop();
  7117. this.itemTimer.stop();
  7118. this.hasShowDesc = !0;
  7119. this.brickArray = [];
  7120. this.itemArray = [];
  7121. this.actor.pauseJumpNew();
  7122. this.actor.getImage(Actor.LEFT).image.stop();
  7123. this.actor.getImage(Actor.RIGHT).image.stop();
  7124. egret.Tween.get(this.actor.getImage(this.actor.getSide()), {
  7125. loop: !0
  7126. }).to({
  7127. alpha: 0
  7128. }, 100).to({
  7129. alpha: 1
  7130. }, 100);
  7131. this.dieTimer = new egret.Timer(1E3, 1);
  7132. this.dieTimer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.changeToEndScene, this);
  7133. this.dieTimer.start();
  7134. console.log("game over")
  7135. };
  7136. d.prototype.changeToEndScene = function() {
  7137. egret.Tween.removeAllTweens();
  7138. this.dieTimer.stop();
  7139. this.dieTimer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.changeToEndScene,
  7140. this);
  7141. this.removeChildren();
  7142. this.endScene = new EndScene;
  7143. this.endScene.x = 0;
  7144. this.endScene.y = 0;
  7145. this.addChild(this.endScene);
  7146. this.endScene.setScore(this.distance);
  7147. this.endScene.setFood(this.eatFood);
  7148. this.endScene.setPoison(this.eatPoison);
  7149. this.bestDistance < this.distance && (this.bestDistance = this.distance);
  7150. this.endScene.setMaxScore(this.bestDistance);
  7151. this.share()
  7152. };
  7153. d.prototype.gameRestart = function() {
  7154. this.removeChildren();
  7155. this.removeEventListener(EndScene.GAMESTART, this.gameRestart, this);
  7156. this.createScene()
  7157. };
  7158. d.prototype.share = function() {
  7159. var title = "我跑了"+ this.bestDistance + "00 m,躲过了"+this.endScene.percent.text+"块五仁月饼,你能超过我吗?";
  7160. setShare(title, title);
  7161. LBGAME.Share.updateData({
  7162. call:true,// false只更新数据||true更新数据+调启用户端分享
  7163. title:"我跑了"+ this.bestDistance + "00 m,躲过了"+this.endScene.percent.text+"块五仁月饼,你能超过我吗?",
  7164. imgUrl:"http://www.liebao.cn/game/wuren/img/icon.png",
  7165. cont:"我跑了"+ this.bestDistance + "00 m,躲过了"+this.endScene.percent.text+"块五仁月饼,你能超过我吗?",
  7166. url:_url,
  7167. doneJump:"http://mp.weixin.qq.com/s?__biz=MjM5NzE3NzA1Mg==&mid=204087927&idx=1&sn=3502817ee0fcc4b2a98ee44d99d49728#rd",
  7168. fun:"" // 分享时回调,不 fun:function(){}
  7169. });
  7170. };
  7171. d.prototype.countTime = function() {
  7172. this.distance++;
  7173. 10 < this.brickTimer.delay && (this.brickTimer.delay -= 10);
  7174. 500 < this.itemTimer.delay && (this.itemTimer.delay -=
  7175. 5)
  7176. };
  7177. return d
  7178. }(egret.DisplayObjectContainer);
  7179. GameScene.prototype.__class__ = "GameScene";