game-min.js 253 KB

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