game-min.js 407 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559
  1. var egret; (function(b) {
  2. b.egret_string_code = {};
  3. b.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  4. b.egret_string_code[1E3] = "Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE";
  5. b.egret_string_code[1001] = "\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7";
  6. b.egret_string_code[1002] = "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
  7. b.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  8. b.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  9. b.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  10. b.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  11. b.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  12. b.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  13. b.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  14. b.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  15. b.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  16. b.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  17. b.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  18. b.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  19. b.egret_string_code[1015] = "xml not found!";
  20. b.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  21. b.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  22. b.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  23. b.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  24. b.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  25. b.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  26. b.egret_string_code[1022] = "{0} ArgumentError";
  27. b.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  28. b.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  29. b.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  30. b.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
  31. b.egret_string_code[1027] = "DecodingError";
  32. b.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002";
  33. b.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  34. b.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  35. b.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  36. b.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  37. b.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  38. b.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  39. b.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  40. b.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  41. b.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  42. b.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  43. b.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  44. b.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  45. b.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  46. b.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  47. b.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  48. b.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  49. b.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  50. b.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
  51. b.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  52. b.egret_string_code[4001] = "Abstract class can not be instantiated!";
  53. b.egret_string_code[4002] = "Unnamed data!";
  54. b.egret_string_code[4003] = "Nonsupport version!";
  55. b.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  56. b.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  57. b.egret_string_code[3102] = "\u8bf7\u5148\u8bbe\u7f6etype\u4e3a\u4e8c\u8fdb\u5236\u7c7b\u578b"
  58. })(egret || (egret = {})); (function(b) {
  59. function d(a) {
  60. for (var e = [], l = 1; l < arguments.length; l++) e[l - 1] = arguments[l];
  61. if (l = b.egret_string_code[a]) for (var m = e.length,
  62. c = 0; c < m; c++) l = l.replace("{" + c + "}", e[c]);
  63. return l
  64. }
  65. var c = function() {
  66. function a() {}
  67. a.fatal = function(e, a) {
  68. void 0 === a && (a = null);
  69. b.Logger.traceToConsole("Fatal", e, a);
  70. throw Error(b.Logger.getTraceCode("Fatal", e, a));
  71. };
  72. a.info = function(e, a) {
  73. void 0 === a && (a = null);
  74. b.Logger.traceToConsole("Info", e, a)
  75. };
  76. a.warning = function(e, a) {
  77. void 0 === a && (a = null);
  78. b.Logger.traceToConsole("Warning", e, a)
  79. };
  80. a.fatalWithErrorId = function(e) {
  81. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  82. l.unshift(e); (l = d.apply(null, l)) ? a.fatal(l) : a.warning(d( - 1, e))
  83. };
  84. a.infoWithErrorId = function(e) {
  85. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  86. l.unshift(e); (l = d.apply(null, l)) ? a.info(l) : a.warning(d( - 1, e))
  87. };
  88. a.warningWithErrorId = function(e) {
  89. for (var l = [], b = 1; b < arguments.length; b++) l[b - 1] = arguments[b];
  90. l.unshift(e); (l = d.apply(null, l)) ? a.warning(l) : a.warning(d( - 1, e))
  91. };
  92. a.traceToConsole = function(e, a, m) {
  93. // console.log(b.Logger.getTraceCode(e, a, m))
  94. };
  95. a.getTraceCode = function(e, a, b) {
  96. return "[" + e + "]" + a + (null == b ? "": ":" + b)
  97. };
  98. return a
  99. } ();
  100. b.Logger = c;
  101. c.prototype.__class__ = "egret.Logger";
  102. b.getString = d
  103. })(egret || (egret = {})); (function(b) {
  104. var d = function() {
  105. function b() {
  106. this._hashCode = b.hashCount++
  107. }
  108. Object.defineProperty(b.prototype, "hashCode", {
  109. get: function() {
  110. return this._hashCode
  111. },
  112. enumerable: !0,
  113. configurable: !0
  114. });
  115. b.hashCount = 1;
  116. return b
  117. } ();
  118. b.HashObject = d;
  119. d.prototype.__class__ = "egret.HashObject"
  120. })(egret || (egret = {}));
  121. var __extends = this.__extends ||
  122. function(b, d) {
  123. function c() {
  124. this.constructor = b
  125. }
  126. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  127. c.prototype = d.prototype;
  128. b.prototype = new c
  129. }; (function(b) {
  130. var d = function(b) {
  131. function a(e) {
  132. void 0 === e && (e = 300);
  133. b.call(this);
  134. this.objectPool = [];
  135. this._length = 0;
  136. 1 > e && (e = 1);
  137. this.autoDisposeTime = e;
  138. this.frameCount = 0
  139. }
  140. __extends(a, b);
  141. a.prototype._checkFrame = function() {
  142. this.frameCount--;
  143. 0 >= this.frameCount && this.dispose()
  144. };
  145. Object.defineProperty(a.prototype, "length", {
  146. get: function() {
  147. return this._length
  148. },
  149. enumerable: !0,
  150. configurable: !0
  151. });
  152. a.prototype.push = function(e) {
  153. var l = this.objectPool; - 1 == l.indexOf(e) && (l.push(e), e.__recycle && e.__recycle(), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  154. };
  155. a.prototype.pop = function() {
  156. if (0 == this._length) return null;
  157. this._length--;
  158. return this.objectPool.pop()
  159. };
  160. a.prototype.dispose = function() {
  161. 0 < this._length && (this.objectPool = [], this._length = 0);
  162. this.frameCount = 0;
  163. var e = a._callBackList,
  164. l = e.indexOf(this); - 1 != l && e.splice(l, 1)
  165. };
  166. a._callBackList = [];
  167. return a
  168. } (b.HashObject);
  169. b.Recycler = d;
  170. d.prototype.__class__ = "egret.Recycler"
  171. })(egret || (egret = {})); (function(b) {
  172. b.__START_TIME;
  173. b.getTimer = function() {
  174. return Date.now() - b.__START_TIME
  175. }
  176. })(egret || (egret = {})); (function(b) {
  177. b.__callLaterFunctionList = [];
  178. b.__callLaterThisList = [];
  179. b.__callLaterArgsList = [];
  180. b.callLater = function(d, c) {
  181. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  182. b.__callLaterFunctionList.push(d);
  183. b.__callLaterThisList.push(c);
  184. b.__callLaterArgsList.push(a)
  185. };
  186. b.__callAsyncFunctionList = [];
  187. b.__callAsyncThisList = [];
  188. b.__callAsyncArgsList = [];
  189. b.__callAsync = function(d, c) {
  190. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  191. b.__callAsyncFunctionList.push(d);
  192. b.__callAsyncThisList.push(c);
  193. b.__callAsyncArgsList.push(a)
  194. }
  195. })(egret || (egret = {})); (function(b) {
  196. var d = function() {
  197. function c() {}
  198. c.prototype.call = function(a) {
  199. this.callback && this.callback.call(this.thisObject, a)
  200. };
  201. c.prototype.dispose = function() {
  202. this.thisObject = this.callback = null;
  203. c.__freeList.push(this)
  204. };
  205. c.push = function(a, e) {
  206. var l;
  207. l = c.__freeList.length ? c.__freeList.pop() : new b.RenderCommand;
  208. l.callback = a;
  209. l.thisObject = e;
  210. b.MainContext.__DRAW_COMMAND_LIST.push(l)
  211. };
  212. c.__freeList = [];
  213. return c
  214. } ();
  215. b.RenderCommand = d;
  216. d.prototype.__class__ = "egret.RenderCommand"
  217. })(egret || (egret = {}));
  218. __extends = this.__extends ||
  219. function(b, d) {
  220. function c() {
  221. this.constructor = b
  222. }
  223. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  224. c.prototype = d.prototype;
  225. b.prototype = new c
  226. }; (function(b) {
  227. var d = function(c) {
  228. function a(e, a, b) {
  229. void 0 === a && (a = !1);
  230. void 0 === b && (b = !1);
  231. c.call(this);
  232. this.data = null;
  233. this._type = "";
  234. this._cancelable = this._bubbles = !1;
  235. this._eventPhase = 2;
  236. this._target = this._currentTarget = null;
  237. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  238. this.isNew = !0;
  239. this._type = e;
  240. this._bubbles = a;
  241. this._cancelable = b
  242. }
  243. __extends(a, c);
  244. Object.defineProperty(a.prototype, "type", {
  245. get: function() {
  246. return this._type
  247. },
  248. enumerable: !0,
  249. configurable: !0
  250. });
  251. Object.defineProperty(a.prototype, "bubbles", {
  252. get: function() {
  253. return this._bubbles
  254. },
  255. enumerable: !0,
  256. configurable: !0
  257. });
  258. Object.defineProperty(a.prototype, "cancelable", {
  259. get: function() {
  260. return this._cancelable
  261. },
  262. enumerable: !0,
  263. configurable: !0
  264. });
  265. Object.defineProperty(a.prototype, "eventPhase", {
  266. get: function() {
  267. return this._eventPhase
  268. },
  269. enumerable: !0,
  270. configurable: !0
  271. });
  272. Object.defineProperty(a.prototype, "currentTarget", {
  273. get: function() {
  274. return this._currentTarget
  275. },
  276. enumerable: !0,
  277. configurable: !0
  278. });
  279. Object.defineProperty(a.prototype, "target", {
  280. get: function() {
  281. return this._target
  282. },
  283. enumerable: !0,
  284. configurable: !0
  285. });
  286. a.prototype.isDefaultPrevented = function() {
  287. return this._isDefaultPrevented
  288. };
  289. a.prototype.preventDefault = function() {
  290. this._cancelable && (this._isDefaultPrevented = !0)
  291. };
  292. a.prototype.stopPropagation = function() {
  293. this._bubbles && (this._isPropagationStopped = !0)
  294. };
  295. a.prototype.stopImmediatePropagation = function() {
  296. this._bubbles && (this._isPropagationImmediateStopped = !0)
  297. };
  298. a.prototype._reset = function() {
  299. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  300. };
  301. a.prototype.__recycle = function() {
  302. this.data = this._target = this._currentTarget = null
  303. };
  304. a._dispatchByTarget = function(e, a, m, c, d, f) {
  305. void 0 === d && (d = !1);
  306. void 0 === f && (f = !1);
  307. var h = e.eventRecycler;
  308. h || (h = e.eventRecycler = new b.Recycler);
  309. var n = h.pop();
  310. n ? n._type = m: n = new e(m);
  311. n._bubbles = d;
  312. n._cancelable = f;
  313. if (c) for (var p in c) n[p] = c[p],
  314. null !== n[p] && (c[p] = null);
  315. e = a.dispatchEvent(n);
  316. h.push(n);
  317. return e
  318. };
  319. a._getPropertyData = function(e) {
  320. var a = e._props;
  321. a || (a = e._props = {});
  322. return a
  323. };
  324. a.dispatchEvent = function(e, l, b, c) {
  325. void 0 === b && (b = !1);
  326. var d = a._getPropertyData(a);
  327. c && (d.data = c);
  328. a._dispatchByTarget(a, e, l, d, b)
  329. };
  330. a.ADDED_TO_STAGE = "addedToStage";
  331. a.REMOVED_FROM_STAGE = "removedFromStage";
  332. a.ADDED = "added";
  333. a.REMOVED = "removed";
  334. a.COMPLETE = "complete";
  335. a.LOOP_COMPLETE = "loopcomplete";
  336. a.ENTER_FRAME = "enterFrame";
  337. a.RENDER = "render";
  338. a.FINISH_RENDER = "finishRender";
  339. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  340. a.LEAVE_STAGE = "leaveStage";
  341. a.RESIZE = "resize";
  342. a.CHANGE = "change";
  343. a.ACTIVATE = "activate";
  344. a.DEACTIVATE = "deactivate";
  345. a.CLOSE = "close";
  346. a.CONNECT = "connect";
  347. return a
  348. } (b.HashObject);
  349. b.Event = d;
  350. d.prototype.__class__ = "egret.Event"
  351. })(egret || (egret = {}));
  352. __extends = this.__extends ||
  353. function(b, d) {
  354. function c() {
  355. this.constructor = b
  356. }
  357. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  358. c.prototype = d.prototype;
  359. b.prototype = new c
  360. }; (function(b) {
  361. var d = function(b) {
  362. function a(e, a, m) {
  363. void 0 === a && (a = !1);
  364. void 0 === m && (m = !1);
  365. b.call(this, e, a, m);
  366. this._status = 0
  367. }
  368. __extends(a, b);
  369. Object.defineProperty(a.prototype, "status", {
  370. get: function() {
  371. return this._status
  372. },
  373. enumerable: !0,
  374. configurable: !0
  375. });
  376. a.dispatchHTTPStatusEvent = function(e, l) {
  377. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  378. a.httpStatusEvent._status = l;
  379. e.dispatchEvent(a.httpStatusEvent)
  380. };
  381. a.HTTP_STATUS = "httpStatus";
  382. a.httpStatusEvent = null;
  383. return a
  384. } (b.Event);
  385. b.HTTPStatusEvent = d;
  386. d.prototype.__class__ = "egret.HTTPStatusEvent"
  387. })(egret || (egret = {}));
  388. __extends = this.__extends ||
  389. function(b, d) {
  390. function c() {
  391. this.constructor = b
  392. }
  393. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  394. c.prototype = d.prototype;
  395. b.prototype = new c
  396. }; (function(b) {
  397. var d = function(c) {
  398. function a(e, a, b) {
  399. void 0 === a && (a = !1);
  400. void 0 === b && (b = !1);
  401. c.call(this, e, a, b)
  402. }
  403. __extends(a, c);
  404. a.dispatchIOErrorEvent = function(e) {
  405. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  406. };
  407. a.IO_ERROR = "ioError";
  408. return a
  409. } (b.Event);
  410. b.IOErrorEvent = d;
  411. d.prototype.__class__ = "egret.IOErrorEvent"
  412. })(egret || (egret = {}));
  413. __extends = this.__extends ||
  414. function(b, d) {
  415. function c() {
  416. this.constructor = b
  417. }
  418. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  419. c.prototype = d.prototype;
  420. b.prototype = new c
  421. }; (function(b) {
  422. var d = function(c) {
  423. function a(e, a, b, d, g, f, h, n, p, q) {
  424. void 0 === a && (a = !0);
  425. void 0 === b && (b = !0);
  426. void 0 === d && (d = 0);
  427. void 0 === g && (g = 0);
  428. void 0 === f && (f = 0);
  429. void 0 === h && (h = !1);
  430. void 0 === n && (n = !1);
  431. void 0 === q && (q = !1);
  432. c.call(this, e, a, b);
  433. this._stageY = this._stageX = 0;
  434. this.touchPointID = NaN;
  435. this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
  436. this.touchPointID = d;
  437. this._stageX = g;
  438. this._stageY = f;
  439. this.ctrlKey = h;
  440. this.altKey = n;
  441. this.touchDown = q
  442. }
  443. __extends(a, c);
  444. Object.defineProperty(a.prototype, "stageX", {
  445. get: function() {
  446. return this._stageX
  447. },
  448. enumerable: !0,
  449. configurable: !0
  450. });
  451. Object.defineProperty(a.prototype, "stageY", {
  452. get: function() {
  453. return this._stageY
  454. },
  455. enumerable: !0,
  456. configurable: !0
  457. });
  458. Object.defineProperty(a.prototype, "localX", {
  459. get: function() {
  460. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  461. },
  462. enumerable: !0,
  463. configurable: !0
  464. });
  465. Object.defineProperty(a.prototype, "localY", {
  466. get: function() {
  467. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  468. },
  469. enumerable: !0,
  470. configurable: !0
  471. });
  472. a.dispatchTouchEvent = function(e, l, m, c, d, f, h, n, p) {
  473. void 0 === m && (m = 0);
  474. void 0 === c && (c = 0);
  475. void 0 === d && (d = 0);
  476. void 0 === f && (f = !1);
  477. void 0 === h && (h = !1);
  478. void 0 === n && (n = !1);
  479. void 0 === p && (p = !1);
  480. var q = b.Event._getPropertyData(a);
  481. q.touchPointID = m;
  482. q._stageX = c;
  483. q._stageY = d;
  484. q.ctrlKey = f;
  485. q.altKey = h;
  486. q.shiftKey = n;
  487. q.touchDown = p;
  488. b.Event._dispatchByTarget(a, e, l, q, !0, !0)
  489. };
  490. a.TOUCH_TAP = "touchTap";
  491. a.TOUCH_MOVE = "touchMove";
  492. a.TOUCH_BEGIN = "touchBegin";
  493. a.TOUCH_END = "touchEnd";
  494. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  495. a.TOUCH_ROLL_OUT = "touchRollOut";
  496. a.TOUCH_ROLL_OVER = "touchRollOver";
  497. a.TOUCH_OUT = "touchOut";
  498. a.TOUCH_OVER = "touchOver";
  499. return a
  500. } (b.Event);
  501. b.TouchEvent = d;
  502. d.prototype.__class__ = "egret.TouchEvent"
  503. })(egret || (egret = {}));
  504. __extends = this.__extends ||
  505. function(b, d) {
  506. function c() {
  507. this.constructor = b
  508. }
  509. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  510. c.prototype = d.prototype;
  511. b.prototype = new c
  512. }; (function(b) {
  513. var d = function(c) {
  514. function a(e, a, b) {
  515. void 0 === a && (a = !1);
  516. void 0 === b && (b = !1);
  517. c.call(this, e, a, b)
  518. }
  519. __extends(a, c);
  520. a.dispatchTimerEvent = function(e, l) {
  521. b.Event._dispatchByTarget(a, e, l)
  522. };
  523. a.TIMER = "timer";
  524. a.TIMER_COMPLETE = "timerComplete";
  525. return a
  526. } (b.Event);
  527. b.TimerEvent = d;
  528. d.prototype.__class__ = "egret.TimerEvent"
  529. })(egret || (egret = {}));
  530. __extends = this.__extends ||
  531. function(b, d) {
  532. function c() {
  533. this.constructor = b
  534. }
  535. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  536. c.prototype = d.prototype;
  537. b.prototype = new c
  538. }; (function(b) {
  539. var d = function(c) {
  540. function a(e, a, b, d) {
  541. void 0 === a && (a = !1);
  542. void 0 === b && (b = !1);
  543. void 0 === d && (d = "");
  544. c.call(this, e, a, b);
  545. this.text = d
  546. }
  547. __extends(a, c);
  548. a.dispatchTextEvent = function(e, l, m) {
  549. var c = b.Event._getPropertyData(a);
  550. c.text = m;
  551. b.Event._dispatchByTarget(a, e, l, c)
  552. };
  553. a.LINK = "link";
  554. return a
  555. } (b.Event);
  556. b.TextEvent = d;
  557. d.prototype.__class__ = "egret.TextEvent"
  558. })(egret || (egret = {}));
  559. __extends = this.__extends ||
  560. function(b, d) {
  561. function c() {
  562. this.constructor = b
  563. }
  564. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  565. c.prototype = d.prototype;
  566. b.prototype = new c
  567. }; (function(b) {
  568. var d = function(c) {
  569. function a(e, a, b, d, g) {
  570. void 0 === a && (a = !1);
  571. void 0 === b && (b = !1);
  572. void 0 === d && (d = 0);
  573. void 0 === g && (g = 0);
  574. c.call(this, e, a, b);
  575. this.bytesTotal = this.bytesLoaded = 0;
  576. this.bytesLoaded = d;
  577. this.bytesTotal = g
  578. }
  579. __extends(a, c);
  580. a.dispatchProgressEvent = function(e, l, m, c) {
  581. void 0 === m && (m = 0);
  582. void 0 === c && (c = 0);
  583. b.Event._dispatchByTarget(a, e, l, {
  584. bytesLoaded: m,
  585. bytesTotal: c
  586. })
  587. };
  588. a.PROGRESS = "progress";
  589. a.SOCKET_DATA = "socketData";
  590. return a
  591. } (b.Event);
  592. b.ProgressEvent = d;
  593. d.prototype.__class__ = "egret.ProgressEvent"
  594. })(egret || (egret = {})); (function(b) {
  595. var d = function() {
  596. function b() {}
  597. b.CAPTURING_PHASE = 1;
  598. b.AT_TARGET = 2;
  599. b.BUBBLING_PHASE = 3;
  600. return b
  601. } ();
  602. b.EventPhase = d;
  603. d.prototype.__class__ = "egret.EventPhase"
  604. })(egret || (egret = {}));
  605. __extends = this.__extends ||
  606. function(b, d) {
  607. function c() {
  608. this.constructor = b
  609. }
  610. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  611. c.prototype = d.prototype;
  612. b.prototype = new c
  613. }; (function(b) {
  614. var d = function(c) {
  615. function a(e) {
  616. void 0 === e && (e = null);
  617. c.call(this);
  618. this._captureEventsMap = this._eventsMap = this._eventTarget = null;
  619. this._eventTarget = e ? e: this
  620. }
  621. __extends(a, c);
  622. a.prototype.addEventListener = function(e, a, m, c, d) {
  623. void 0 === c && (c = !1);
  624. void 0 === d && (d = 0);
  625. "undefined" === typeof c && (c = !1);
  626. "undefined" === typeof d && (d = 0);
  627. a || b.Logger.fatalWithErrorId(1010);
  628. c ? (this._captureEventsMap || (this._captureEventsMap = {}), c = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), c = this._eventsMap);
  629. var f = c[e];
  630. f || (f = c[e] = []);
  631. this._insertEventBin(f, a, m, d)
  632. };
  633. a.prototype._insertEventBin = function(e, a, b, c, d) {
  634. void 0 === d && (d = void 0);
  635. for (var f = -1,
  636. h = e.length,
  637. n = 0; n < h; n++) {
  638. var p = e[n];
  639. if (p.listener === a && p.thisObject === b && p.display === d) return ! 1; - 1 == f && p.priority < c && (f = n)
  640. }
  641. a = {
  642. listener: a,
  643. thisObject: b,
  644. priority: c
  645. };
  646. d && (a.display = d); - 1 != f ? e.splice(f, 0, a) : e.push(a);
  647. return ! 0
  648. };
  649. a.prototype.removeEventListener = function(e, a, b, c) {
  650. void 0 === c && (c = !1);
  651. if (c = c ? this._captureEventsMap: this._eventsMap) {
  652. var d = c[e];
  653. d && (this._removeEventBin(d, a, b), 0 == d.length && delete c[e])
  654. }
  655. };
  656. a.prototype._removeEventBin = function(e, a, b, c, d) {
  657. void 0 === c && (c = void 0);
  658. void 0 === d && (d = 0);
  659. for (var f = e.length; d < f; d++) {
  660. var h = e[d];
  661. if (h.listener === a && h.thisObject === b && h.display == c) return e.splice(d, 1),
  662. !0
  663. }
  664. return ! 1
  665. };
  666. a.prototype.hasEventListener = function(e) {
  667. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  668. };
  669. a.prototype.willTrigger = function(e) {
  670. return this.hasEventListener(e)
  671. };
  672. a.prototype.dispatchEvent = function(e) {
  673. e._reset();
  674. e._target = this._eventTarget;
  675. e._currentTarget = this._eventTarget;
  676. return this._notifyListener(e)
  677. };
  678. a.prototype._notifyListener = function(e) {
  679. var a = 1 == e._eventPhase ? this._captureEventsMap: this._eventsMap;
  680. if (!a) return ! 0;
  681. a = a[e._type];
  682. if (!a) return ! 0;
  683. var b = a.length;
  684. if (0 == b) return ! 0;
  685. for (var a = a.concat(), c = 0; c < b; c++) {
  686. var d = a[c];
  687. d.listener.call(d.thisObject, e);
  688. if (e._isPropagationImmediateStopped) break
  689. }
  690. return ! e._isDefaultPrevented
  691. };
  692. a.prototype.dispatchEventWith = function(e, a, m) {
  693. void 0 === a && (a = !1);
  694. b.Event.dispatchEvent(this, e, a, m)
  695. };
  696. return a
  697. } (b.HashObject);
  698. b.EventDispatcher = d;
  699. d.prototype.__class__ = "egret.EventDispatcher"
  700. })(egret || (egret = {}));
  701. __extends = this.__extends ||
  702. function(b, d) {
  703. function c() {
  704. this.constructor = b
  705. }
  706. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  707. c.prototype = d.prototype;
  708. b.prototype = new c
  709. }; (function(b) {
  710. var d = function(c) {
  711. function a() {
  712. c.call(this);
  713. this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
  714. this.reuseEvent = new b.Event("")
  715. }
  716. __extends(a, c);
  717. a.prototype.run = function() {
  718. b.Ticker.getInstance().run();
  719. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  720. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  721. this.touchContext.run();
  722. this._profileInstance = b.Profiler.getInstance()
  723. };
  724. a.prototype.renderLoop = function(e) {
  725. if (0 < b.__callLaterFunctionList.length) {
  726. var l = b.__callLaterFunctionList;
  727. b.__callLaterFunctionList = [];
  728. var m = b.__callLaterThisList;
  729. b.__callLaterThisList = [];
  730. var c = b.__callLaterArgsList;
  731. b.__callLaterArgsList = []
  732. }
  733. e = this.stage;
  734. var d = a.cachedEvent;
  735. d._type = b.Event.RENDER;
  736. this.dispatchEvent(d);
  737. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  738. l && this.doCallLaterList(l, m, c);
  739. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  740. l = this.rendererContext;
  741. l.onRenderStart();
  742. l.clearScreen();
  743. a.__DRAW_COMMAND_LIST = [];
  744. a._renderLoopPhase = "updateTransform";
  745. e._updateTransform();
  746. a._renderLoopPhase = "draw";
  747. d._type = b.Event.FINISH_UPDATE_TRANSFORM;
  748. this.dispatchEvent(d);
  749. a.__use_new_draw ? this._draw(l) : e._draw(l);
  750. d._type = b.Event.FINISH_RENDER;
  751. this.dispatchEvent(d);
  752. this._profileInstance._isRunning && this._profileInstance._drawProfiler();
  753. l.onRenderFinish()
  754. };
  755. a.prototype._draw = function(e) {
  756. for (var l = a.__DRAW_COMMAND_LIST,
  757. b = l.length,
  758. c = 0; c < b; c++) {
  759. var d = l[c];
  760. d.call(e);
  761. d.dispose()
  762. }
  763. };
  764. a.prototype.broadcastEnterFrame = function(e) {
  765. e = this.reuseEvent;
  766. e._type = b.Event.ENTER_FRAME;
  767. this.dispatchEvent(e);
  768. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), m = a.length, c = 0; c < m; c++) {
  769. var d = a[c];
  770. e._target = d.display;
  771. e._currentTarget = d.display;
  772. d.listener.call(d.thisObject, e)
  773. }
  774. a = b.Recycler._callBackList;
  775. for (c = a.length - 1; 0 <= c; c--) a[c]._checkFrame()
  776. };
  777. a.prototype.broadcastRender = function() {
  778. var e = this.reuseEvent;
  779. e._type = b.Event.RENDER;
  780. for (var a = b.DisplayObject._renderCallBackList.concat(), m = a.length, c = 0; c < m; c++) {
  781. var d = a[c],
  782. f = d.display;
  783. e._target = f;
  784. e._currentTarget = f;
  785. d.listener.call(d.thisObject, e)
  786. }
  787. };
  788. a.prototype.doCallLaterList = function(e, a, b) {
  789. for (var c = e.length,
  790. d = 0; d < c; d++) {
  791. var f = e[d];
  792. null != f && f.apply(a[d], b[d])
  793. }
  794. };
  795. a.prototype.doCallAsyncList = function() {
  796. var e = b.__callAsyncFunctionList.concat(),
  797. a = b.__callAsyncThisList.concat(),
  798. m = b.__callAsyncArgsList.concat();
  799. b.__callAsyncFunctionList.length = 0;
  800. b.__callAsyncThisList.length = 0;
  801. for (var c = b.__callAsyncArgsList.length = 0; c < e.length; c++) {
  802. var d = e[c];
  803. null != d && d.apply(a[c], m[c])
  804. }
  805. };
  806. a.deviceType = null;
  807. a.DEVICE_PC = "web";
  808. a.DEVICE_MOBILE = "native";
  809. a.RUNTIME_HTML5 = "runtime_html5";
  810. a.RUNTIME_NATIVE = "runtime_native";
  811. a.__DRAW_COMMAND_LIST = [];
  812. a.__use_new_draw = !0;
  813. a.cachedEvent = new b.Event("");
  814. return a
  815. } (b.EventDispatcher);
  816. b.MainContext = d;
  817. d.prototype.__class__ = "egret.MainContext"
  818. })(egret || (egret = {}));
  819. var testDeviceType = function() {
  820. if (!this.navigator) return ! 0;
  821. var b = navigator.userAgent.toLowerCase();
  822. return - 1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  823. },
  824. testRuntimeType = function() {
  825. return this.navigator ? !0 : !1
  826. };
  827. egret.MainContext.instance = new egret.MainContext;
  828. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC;
  829. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5: egret.MainContext.RUNTIME_NATIVE;
  830. delete testDeviceType;
  831. delete testRuntimeType; (function(b) {
  832. var d = function() {
  833. function c() {
  834. this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  835. this._txt = null;
  836. this._tick = 0;
  837. this._maxDeltaTime = 500;
  838. this._totalDeltaTime = 0;
  839. this._isRunning = !1
  840. }
  841. c.getInstance = function() {
  842. null == c.instance && (c.instance = new c);
  843. return c.instance
  844. };
  845. c.prototype.stop = function() {
  846. if (this._isRunning) {
  847. this._isRunning = !1;
  848. b.Ticker.getInstance().unregister(this.update, this);
  849. var a = b.MainContext.instance;
  850. a.removeEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  851. a.removeEventListener(b.Event.RENDER, this.onStartRender, this);
  852. a.removeEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  853. a.removeEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  854. }
  855. };
  856. c.prototype.run = function() {
  857. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._parent = new b.DisplayObjectContainer);
  858. if (!this._isRunning) {
  859. this._isRunning = !0;
  860. b.Ticker.getInstance().register(this.update, this);
  861. var a = b.MainContext.instance;
  862. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  863. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  864. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  865. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  866. }
  867. };
  868. c.prototype._drawProfiler = function() {
  869. this._txt._updateTransform();
  870. this._txt._draw(b.MainContext.instance.rendererContext)
  871. };
  872. c.prototype._setTxtFontSize = function(a) {
  873. this._txt.size = a
  874. };
  875. c.prototype.onEnterFrame = function(a) {
  876. this._lastTime = b.getTimer()
  877. };
  878. c.prototype.onStartRender = function(a) {
  879. a = b.getTimer();
  880. this._logicPerformanceCost = a - this._lastTime;
  881. this._lastTime = a
  882. };
  883. c.prototype.onFinishUpdateTransform = function(a) {
  884. a = b.getTimer();
  885. this._updateTransformPerformanceCost = a - this._lastTime;
  886. this._lastTime = a
  887. };
  888. c.prototype.onFinishRender = function(a) {
  889. a = b.getTimer();
  890. this._renderPerformanceCost = a - this._lastTime;
  891. this._lastTime = a
  892. };
  893. c.prototype.update = function(a) {
  894. this._tick++;
  895. this._totalDeltaTime += a;
  896. if (this._totalDeltaTime >= this._maxDeltaTime) {
  897. a = (this._preDrawCount - 3).toString();
  898. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  899. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  900. this._tick = this._totalDeltaTime = 0
  901. }
  902. this._preDrawCount = 0
  903. };
  904. c.prototype.onDrawImage = function() {
  905. this._preDrawCount++
  906. };
  907. return c
  908. } ();
  909. b.Profiler = d;
  910. d.prototype.__class__ = "egret.Profiler"
  911. })(egret || (egret = {}));
  912. __extends = this.__extends ||
  913. function(b, d) {
  914. function c() {
  915. this.constructor = b
  916. }
  917. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  918. c.prototype = d.prototype;
  919. b.prototype = new c
  920. }; (function(b) {
  921. var d = function(c) {
  922. function a() {
  923. c.call(this);
  924. this._timeScale = 1;
  925. this._paused = !1;
  926. this._callIndex = -1;
  927. this.callBackList = [];
  928. null != a.instance && b.Logger.fatalWithErrorId(1002)
  929. }
  930. __extends(a, c);
  931. a.prototype.run = function() {
  932. b.__START_TIME = (new Date).getTime();
  933. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  934. };
  935. a.prototype.update = function(e) {
  936. if (!this._paused) {
  937. e *= this._timeScale;
  938. e *= this._timeScale;
  939. this._callList = this.callBackList.concat();
  940. for (this._callIndex = 0; this._callIndex < this._callList.length; this._callIndex++) {
  941. var a = this._callList[this._callIndex];
  942. a.listener.call(a.thisObject, e)
  943. }
  944. this._callIndex = -1;
  945. this._callList = null
  946. }
  947. };
  948. a.prototype.register = function(e, a, b) {
  949. void 0 === b && (b = 0);
  950. this._insertEventBin(this.callBackList, e, a, b)
  951. };
  952. a.prototype.unregister = function(e, a) {
  953. this._removeEventBin(this.callBackList, e, a);
  954. this._callList && -1 < this._callIndex && this._removeEventBin(this._callList, e, a, null, this._callIndex + 1)
  955. };
  956. a.prototype.setTimeout = function(e, a, m) {
  957. for (var c = [], d = 3; d < arguments.length; d++) c[d - 3] = arguments[d];
  958. b.Logger.warningWithErrorId(1003);
  959. b.setTimeout.apply(null, [e, a, m].concat(c))
  960. };
  961. a.prototype.setTimeScale = function(e) {
  962. this._timeScale = e
  963. };
  964. a.prototype.getTimeScale = function() {
  965. return this._timeScale
  966. };
  967. a.prototype.pause = function() {
  968. this._paused = !0
  969. };
  970. a.prototype.resume = function() {
  971. this._paused = !1
  972. };
  973. a.getInstance = function() {
  974. null == a.instance && (a.instance = new a);
  975. return a.instance
  976. };
  977. return a
  978. } (b.EventDispatcher);
  979. b.Ticker = d;
  980. d.prototype.__class__ = "egret.Ticker"
  981. })(egret || (egret = {})); (function(b) {
  982. var d = function() {
  983. function b() {}
  984. b.LEFT = "left";
  985. b.RIGHT = "right";
  986. b.CENTER = "center";
  987. b.JUSTIFY = "justify";
  988. b.CONTENT_JUSTIFY = "contentJustify";
  989. return b
  990. } ();
  991. b.HorizontalAlign = d;
  992. d.prototype.__class__ = "egret.HorizontalAlign"
  993. })(egret || (egret = {})); (function(b) {
  994. var d = function() {
  995. function b() {}
  996. b.TOP = "top";
  997. b.BOTTOM = "bottom";
  998. b.MIDDLE = "middle";
  999. b.JUSTIFY = "justify";
  1000. b.CONTENT_JUSTIFY = "contentJustify";
  1001. return b
  1002. } ();
  1003. b.VerticalAlign = d;
  1004. d.prototype.__class__ = "egret.VerticalAlign"
  1005. })(egret || (egret = {}));
  1006. __extends = this.__extends ||
  1007. function(b, d) {
  1008. function c() {
  1009. this.constructor = b
  1010. }
  1011. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1012. c.prototype = d.prototype;
  1013. b.prototype = new c
  1014. }; (function(b) {
  1015. var d = function(c) {
  1016. function a(e, a) {
  1017. void 0 === a && (a = 0);
  1018. c.call(this);
  1019. this._currentCount = 0;
  1020. this._running = !1;
  1021. this.lastTime = 0;
  1022. this.delay = e;
  1023. this.repeatCount = a
  1024. }
  1025. __extends(a, c);
  1026. Object.defineProperty(a.prototype, "currentCount", {
  1027. get: function() {
  1028. return this._currentCount
  1029. },
  1030. enumerable: !0,
  1031. configurable: !0
  1032. });
  1033. Object.defineProperty(a.prototype, "running", {
  1034. get: function() {
  1035. return this._running
  1036. },
  1037. enumerable: !0,
  1038. configurable: !0
  1039. });
  1040. a.prototype.reset = function() {
  1041. this.stop();
  1042. this._currentCount = 0
  1043. };
  1044. a.prototype.start = function() {
  1045. this._running || (this.lastTime = b.getTimer(), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  1046. };
  1047. a.prototype.stop = function() {
  1048. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  1049. };
  1050. a.prototype.onEnterFrame = function(e) {
  1051. e = b.getTimer();
  1052. e - this.lastTime > this.delay && (this.lastTime = e, 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)))
  1053. };
  1054. return a
  1055. } (b.EventDispatcher);
  1056. b.Timer = d;
  1057. d.prototype.__class__ = "egret.Timer"
  1058. })(egret || (egret = {})); (function(b) {
  1059. function d(b) {
  1060. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1061. if (b.hasOwnProperty("__class__")) return b.__class__;
  1062. var a = b.constructor.toString(),
  1063. e = a.indexOf("("),
  1064. a = a.substring(9, e);
  1065. Object.defineProperty(b, "__class__", {
  1066. value: a,
  1067. enumerable: !1,
  1068. writable: !0
  1069. });
  1070. return a
  1071. }
  1072. b.getQualifiedClassName = d;
  1073. b.getQualifiedSuperclassName = function(b) {
  1074. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1075. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  1076. var a = Object.getPrototypeOf(b);
  1077. if (null == a) return null;
  1078. a = d(a.constructor);
  1079. if (!a) return null;
  1080. Object.defineProperty(b, "__superclass__", {
  1081. value: a,
  1082. enumerable: !1,
  1083. writable: !0
  1084. });
  1085. return a
  1086. }
  1087. })(egret || (egret = {})); (function(b) {
  1088. var d = {};
  1089. b.getDefinitionByName = function(b) {
  1090. if (!b) return null;
  1091. var a = d[b];
  1092. if (a) return a;
  1093. for (var e = b.split("."), l = e.length, a = __global, m = 0; m < l; m++) if (a = a[e[m]], !a) return null;
  1094. return d[b] = a
  1095. }
  1096. })(egret || (egret = {}));
  1097. var __global = __global || this; (function(b) {
  1098. function d(e) {
  1099. for (var a in c) {
  1100. var b = c[a];
  1101. b.delay -= e;
  1102. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete c[a])
  1103. }
  1104. }
  1105. var c = {},
  1106. a = 0;
  1107. b.setTimeout = function(e, l, m) {
  1108. for (var k = [], g = 3; g < arguments.length; g++) k[g - 3] = arguments[g];
  1109. k = {
  1110. listener: e,
  1111. thisObject: l,
  1112. delay: m,
  1113. params: k
  1114. };
  1115. 0 == a && b.Ticker.getInstance().register(d, null);
  1116. a++;
  1117. c[a] = k;
  1118. return a
  1119. };
  1120. b.clearTimeout = function(e) {
  1121. delete c[e]
  1122. }
  1123. })(egret || (egret = {})); (function(b) {
  1124. b.hasDefinition = function(d) {
  1125. return b.getDefinitionByName(d) ? !0 : !1
  1126. }
  1127. })(egret || (egret = {})); (function(b) {
  1128. b.toColorString = function(b) {
  1129. if (isNaN(b) || 0 > b) b = 0;
  1130. 16777215 < b && (b = 16777215);
  1131. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  1132. return "#" + b
  1133. }
  1134. })(egret || (egret = {}));
  1135. __extends = this.__extends ||
  1136. function(b, d) {
  1137. function c() {
  1138. this.constructor = b
  1139. }
  1140. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1141. c.prototype = d.prototype;
  1142. b.prototype = new c
  1143. }; (function(b) {
  1144. var d = function(c) {
  1145. function a(e, a, b, d, g, f) {
  1146. void 0 === e && (e = 1);
  1147. void 0 === a && (a = 0);
  1148. void 0 === b && (b = 0);
  1149. void 0 === d && (d = 1);
  1150. void 0 === g && (g = 0);
  1151. void 0 === f && (f = 0);
  1152. c.call(this);
  1153. this.a = e;
  1154. this.b = a;
  1155. this.c = b;
  1156. this.d = d;
  1157. this.tx = g;
  1158. this.ty = f
  1159. }
  1160. __extends(a, c);
  1161. a.prototype.prepend = function(e, a, b, c, d, f) {
  1162. var h = this.tx;
  1163. if (1 != e || 0 != a || 0 != b || 1 != c) {
  1164. var n = this.a,
  1165. p = this.c;
  1166. this.a = n * e + this.b * b;
  1167. this.b = n * a + this.b * c;
  1168. this.c = p * e + this.d * b;
  1169. this.d = p * a + this.d * c
  1170. }
  1171. this.tx = h * e + this.ty * b + d;
  1172. this.ty = h * a + this.ty * c + f;
  1173. return this
  1174. };
  1175. a.prototype.append = function(e, a, b, c, d, f) {
  1176. var h = this.a,
  1177. n = this.b,
  1178. p = this.c,
  1179. q = this.d;
  1180. if (1 != e || 0 != a || 0 != b || 1 != c) this.a = e * h + a * p,
  1181. this.b = e * n + a * q,
  1182. this.c = b * h + c * p,
  1183. this.d = b * n + c * q;
  1184. this.tx = d * h + f * p + this.tx;
  1185. this.ty = d * n + f * q + this.ty;
  1186. return this
  1187. };
  1188. a.prototype.prependTransform = function(e, a, m, c, d, f, h, n, p) {
  1189. if (d % 360) {
  1190. var q = b.NumberUtils.cos(d);
  1191. d = b.NumberUtils.sin(d)
  1192. } else q = 1,
  1193. d = 0;
  1194. if (n || p) this.tx -= n,
  1195. this.ty -= p;
  1196. f || h ? (this.prepend(q * m, d * m, -d * c, q * c, 0, 0), this.prepend(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a)) : this.prepend(q * m, d * m, -d * c, q * c, e, a);
  1197. return this
  1198. };
  1199. a.prototype.appendTransform = function(e, a, m, c, d, f, h, n, p) {
  1200. if (d % 360) {
  1201. var q = b.NumberUtils.cos(d);
  1202. d = b.NumberUtils.sin(d)
  1203. } else q = 1,
  1204. d = 0;
  1205. f || h ? (this.append(b.NumberUtils.cos(h), b.NumberUtils.sin(h), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a), this.append(q * m, d * m, -d * c, q * c, 0, 0)) : this.append(q * m, d * m, -d * c, q * c, e, a);
  1206. if (n || p) this.tx -= n * this.a + p * this.c,
  1207. this.ty -= n * this.b + p * this.d;
  1208. return this
  1209. };
  1210. a.prototype.rotate = function(e) {
  1211. var a = Math.cos(e);
  1212. e = Math.sin(e);
  1213. var b = this.a,
  1214. c = this.c,
  1215. d = this.tx;
  1216. this.a = b * a - this.b * e;
  1217. this.b = b * e + this.b * a;
  1218. this.c = c * a - this.d * e;
  1219. this.d = c * e + this.d * a;
  1220. this.tx = d * a - this.ty * e;
  1221. this.ty = d * e + this.ty * a;
  1222. return this
  1223. };
  1224. a.prototype.skew = function(e, a) {
  1225. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(e), b.NumberUtils.cos(e), 0, 0);
  1226. return this
  1227. };
  1228. a.prototype.scale = function(e, a) {
  1229. this.a *= e;
  1230. this.d *= a;
  1231. this.c *= e;
  1232. this.b *= a;
  1233. this.tx *= e;
  1234. this.ty *= a;
  1235. return this
  1236. };
  1237. a.prototype.translate = function(e, a) {
  1238. this.tx += e;
  1239. this.ty += a;
  1240. return this
  1241. };
  1242. a.prototype.identity = function() {
  1243. this.a = this.d = 1;
  1244. this.b = this.c = this.tx = this.ty = 0;
  1245. return this
  1246. };
  1247. a.prototype.identityMatrix = function(e) {
  1248. this.a = e.a;
  1249. this.b = e.b;
  1250. this.c = e.c;
  1251. this.d = e.d;
  1252. this.tx = e.tx;
  1253. this.ty = e.ty;
  1254. return this
  1255. };
  1256. a.prototype.invert = function() {
  1257. var e = this.a,
  1258. a = this.b,
  1259. b = this.c,
  1260. c = this.d,
  1261. d = this.tx,
  1262. f = e * c - a * b;
  1263. this.a = c / f;
  1264. this.b = -a / f;
  1265. this.c = -b / f;
  1266. this.d = e / f;
  1267. this.tx = (b * this.ty - c * d) / f;
  1268. this.ty = -(e * this.ty - a * d) / f;
  1269. return this
  1270. };
  1271. a.transformCoords = function(e, a, m) {
  1272. var c = b.Point.identity;
  1273. c.x = e.a * a + e.c * m + e.tx;
  1274. c.y = e.d * m + e.b * a + e.ty;
  1275. return c
  1276. };
  1277. a.prototype.toArray = function(e) {
  1278. this.array || (this.array = new Float32Array(9));
  1279. e ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1280. this.array[8] = 1;
  1281. return this.array
  1282. };
  1283. a.identity = new a;
  1284. a.DEG_TO_RAD = Math.PI / 180;
  1285. return a
  1286. } (b.HashObject);
  1287. b.Matrix = d;
  1288. d.prototype.__class__ = "egret.Matrix"
  1289. })(egret || (egret = {}));
  1290. __extends = this.__extends ||
  1291. function(b, d) {
  1292. function c() {
  1293. this.constructor = b
  1294. }
  1295. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1296. c.prototype = d.prototype;
  1297. b.prototype = new c
  1298. }; (function(b) {
  1299. var d = function(b) {
  1300. function a(e, a) {
  1301. void 0 === e && (e = 0);
  1302. void 0 === a && (a = 0);
  1303. b.call(this);
  1304. this.x = e;
  1305. this.y = a
  1306. }
  1307. __extends(a, b);
  1308. a.prototype.clone = function() {
  1309. return new a(this.x, this.y)
  1310. };
  1311. a.prototype.equals = function(e) {
  1312. return this.x == e.x && this.y == e.y
  1313. };
  1314. a.distance = function(e, a) {
  1315. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  1316. };
  1317. a.identity = new a(0, 0);
  1318. return a
  1319. } (b.HashObject);
  1320. b.Point = d;
  1321. d.prototype.__class__ = "egret.Point"
  1322. })(egret || (egret = {}));
  1323. __extends = this.__extends ||
  1324. function(b, d) {
  1325. function c() {
  1326. this.constructor = b
  1327. }
  1328. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1329. c.prototype = d.prototype;
  1330. b.prototype = new c
  1331. }; (function(b) {
  1332. var d = function(b) {
  1333. function a(e, a, m, d) {
  1334. void 0 === e && (e = 0);
  1335. void 0 === a && (a = 0);
  1336. void 0 === m && (m = 0);
  1337. void 0 === d && (d = 0);
  1338. b.call(this);
  1339. this.x = e;
  1340. this.y = a;
  1341. this.width = m;
  1342. this.height = d
  1343. }
  1344. __extends(a, b);
  1345. Object.defineProperty(a.prototype, "right", {
  1346. get: function() {
  1347. return this.x + this.width
  1348. },
  1349. set: function(e) {
  1350. this.width = e - this.x
  1351. },
  1352. enumerable: !0,
  1353. configurable: !0
  1354. });
  1355. Object.defineProperty(a.prototype, "bottom", {
  1356. get: function() {
  1357. return this.y + this.height
  1358. },
  1359. set: function(e) {
  1360. this.height = e - this.y
  1361. },
  1362. enumerable: !0,
  1363. configurable: !0
  1364. });
  1365. a.prototype.initialize = function(e, a, b, c) {
  1366. this.x = e;
  1367. this.y = a;
  1368. this.width = b;
  1369. this.height = c;
  1370. return this
  1371. };
  1372. a.prototype.contains = function(e, a) {
  1373. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1374. };
  1375. a.prototype.intersects = function(e) {
  1376. return Math.max(this.x, e.x) <= Math.min(this.right, e.right) && Math.max(this.y, e.y) <= Math.min(this.bottom, e.bottom)
  1377. };
  1378. a.prototype.setEmpty = function() {
  1379. this.height = this.width = this.y = this.x = 0
  1380. };
  1381. a.prototype.clone = function() {
  1382. return new a(this.x, this.y, this.width, this.height)
  1383. };
  1384. a.prototype.containsPoint = function(e) {
  1385. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1386. };
  1387. a.identity = new a(0, 0, 0, 0);
  1388. return a
  1389. } (b.HashObject);
  1390. b.Rectangle = d;
  1391. d.prototype.__class__ = "egret.Rectangle"
  1392. })(egret || (egret = {}));
  1393. __extends = this.__extends ||
  1394. function(b, d) {
  1395. function c() {
  1396. this.constructor = b
  1397. }
  1398. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1399. c.prototype = d.prototype;
  1400. b.prototype = new c
  1401. }; (function(b) {
  1402. var d = function(c) {
  1403. function a() {
  1404. c.call(this);
  1405. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1406. this._xmlDict = {};
  1407. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1408. }
  1409. __extends(a, c);
  1410. a.getInstance = function() {
  1411. a._instance || (a._instance = new a);
  1412. return a._instance
  1413. };
  1414. a.prototype.parserXML = function(e) {
  1415. for (var a = 0;
  1416. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1417. 0 != a && (e = e.substring(a, e.length));
  1418. this._isSupportDOMParser ? a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1419. null == a && b.Logger.infoWithErrorId(1015);
  1420. return a
  1421. };
  1422. a._instance = null;
  1423. return a
  1424. } (b.HashObject);
  1425. b.SAXParser = d;
  1426. d.prototype.__class__ = "egret.SAXParser"
  1427. })(egret || (egret = {}));
  1428. __extends = this.__extends ||
  1429. function(b, d) {
  1430. function c() {
  1431. this.constructor = b
  1432. }
  1433. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1434. c.prototype = d.prototype;
  1435. b.prototype = new c
  1436. }; (function(b) {
  1437. var d = function(e) {
  1438. function l() {
  1439. e.call(this);
  1440. this._designHeight = this._designWidth = 0;
  1441. this._scaleY = this._scaleX = 1;
  1442. this._stageHeight = this._stageWidth = this._offSetY = 0
  1443. }
  1444. __extends(l, e);
  1445. l.getInstance = function() {
  1446. null == l.instance && (a.initialize(), l.instance = new l);
  1447. return l.instance
  1448. };
  1449. l.prototype.setDesignSize = function(e, a, l) {
  1450. this._designWidth = e;
  1451. this._designHeight = a;
  1452. l && (b.Logger.warningWithErrorId(1001), this._setResolutionPolicy(l))
  1453. };
  1454. l.prototype._setResolutionPolicy = function(e) {
  1455. this._resolutionPolicy = e;
  1456. e.init(this);
  1457. e._apply(this, this._designWidth, this._designHeight)
  1458. };
  1459. l.prototype.getScaleX = function() {
  1460. return this._scaleX
  1461. };
  1462. l.prototype.getScaleY = function() {
  1463. return this._scaleY
  1464. };
  1465. l.prototype.getOffSetY = function() {
  1466. return this._offSetY
  1467. };
  1468. l.canvas_name = "egretCanvas";
  1469. l.canvas_div_name = "gameDiv";
  1470. return l
  1471. } (b.HashObject);
  1472. b.StageDelegate = d;
  1473. d.prototype.__class__ = "egret.StageDelegate";
  1474. var c = function() {
  1475. function e(a, b) {
  1476. this._containerStrategy = a;
  1477. this._contentStrategy = b
  1478. }
  1479. e.prototype.init = function(e) {
  1480. this._containerStrategy.init(e);
  1481. this._contentStrategy.init(e)
  1482. };
  1483. e.prototype._apply = function(e, a, b) {
  1484. this._containerStrategy._apply(e, a, b);
  1485. this._contentStrategy._apply(e, a, b)
  1486. };
  1487. return e
  1488. } ();
  1489. b.ResolutionPolicy = c;
  1490. c.prototype.__class__ = "egret.ResolutionPolicy";
  1491. var a = function() {
  1492. function a() {}
  1493. a.initialize = function() {
  1494. a.EQUAL_TO_FRAME = new e
  1495. };
  1496. a.prototype.init = function(e) {};
  1497. a.prototype._apply = function(e, a, b) {};
  1498. a.prototype._setupContainer = function() {
  1499. var e = document.body,
  1500. a;
  1501. e && (a = e.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1502. };
  1503. return a
  1504. } ();
  1505. b.ContainerStrategy = a;
  1506. a.prototype.__class__ = "egret.ContainerStrategy";
  1507. var e = function(e) {
  1508. function a() {
  1509. e.apply(this, arguments)
  1510. }
  1511. __extends(a, e);
  1512. a.prototype._apply = function(e) {
  1513. this._setupContainer()
  1514. };
  1515. return a
  1516. } (a);
  1517. b.EqualToFrame = e;
  1518. e.prototype.__class__ = "egret.EqualToFrame";
  1519. c = function() {
  1520. function e() {}
  1521. e.prototype.init = function(e) {};
  1522. e.prototype._apply = function(e, a, b) {};
  1523. e.prototype.setEgretSize = function(e, a, l, m, c, p) {
  1524. void 0 === p && (p = 0);
  1525. b.StageDelegate.getInstance()._stageWidth = Math.round(e);
  1526. b.StageDelegate.getInstance()._stageHeight = Math.round(a);
  1527. e = document.getElementById(d.canvas_div_name);
  1528. e.style.width = l + "px";
  1529. e.style.height = m + "px";
  1530. e.style.top = p + "px"
  1531. };
  1532. e.prototype._getClientWidth = function() {
  1533. return document.documentElement.clientWidth
  1534. };
  1535. e.prototype._getClientHeight = function() {
  1536. return document.documentElement.clientHeight
  1537. };
  1538. return e
  1539. } ();
  1540. b.ContentStrategy = c;
  1541. c.prototype.__class__ = "egret.ContentStrategy";
  1542. var l = function(e) {
  1543. function a(b) {
  1544. void 0 === b && (b = 0);
  1545. e.call(this);
  1546. this.minWidth = NaN;
  1547. this.minWidth = b
  1548. }
  1549. __extends(a, e);
  1550. a.prototype._apply = function(e, a, b) {
  1551. a = this._getClientWidth();
  1552. var l = this._getClientHeight(),
  1553. m = l / b,
  1554. c = a / m,
  1555. d = 1;
  1556. 0 != this.minWidth && (d = Math.min(1, c / this.minWidth));
  1557. this.setEgretSize(c / d, b, a, l * d);
  1558. e._scaleX = m * d;
  1559. e._scaleY = m * d
  1560. };
  1561. return a
  1562. } (c);
  1563. b.FixedHeight = l;
  1564. l.prototype.__class__ = "egret.FixedHeight";
  1565. l = function(e) {
  1566. function a(b) {
  1567. void 0 === b && (b = 0);
  1568. e.call(this);
  1569. this.minHeight = NaN;
  1570. this.minHeight = b
  1571. }
  1572. __extends(a, e);
  1573. a.prototype._apply = function(e, a, b) {
  1574. b = this._getClientWidth();
  1575. var l = this._getClientHeight(),
  1576. m = b / a,
  1577. c = l / m,
  1578. d = 1;
  1579. 0 != this.minHeight && (d = Math.min(1, c / this.minHeight));
  1580. this.setEgretSize(a, c / d, b * d, l, b * (1 - d) / 2);
  1581. e._scaleX = m * d;
  1582. e._scaleY = m * d
  1583. };
  1584. return a
  1585. } (c);
  1586. b.FixedWidth = l;
  1587. l.prototype.__class__ = "egret.FixedWidth";
  1588. l = function(e) {
  1589. function a(b, l) {
  1590. e.call(this);
  1591. this.width = b;
  1592. this.height = l
  1593. }
  1594. __extends(a, e);
  1595. a.prototype._apply = function(e, a, b) {
  1596. b = this.width;
  1597. var l = this.height,
  1598. m = b / a;
  1599. this.setEgretSize(a, l / m, b, l);
  1600. e._scaleX = m;
  1601. e._scaleY = m
  1602. };
  1603. return a
  1604. } (c);
  1605. b.FixedSize = l;
  1606. l.prototype.__class__ = "egret.FixedSize";
  1607. l = function(e) {
  1608. function a() {
  1609. e.call(this)
  1610. }
  1611. __extends(a, e);
  1612. a.prototype._apply = function(e, a, b) {
  1613. this.setEgretSize(a, b, a, b, Math.floor((a - a) / 2));
  1614. e._scaleX = 1;
  1615. e._scaleY = 1
  1616. };
  1617. return a
  1618. } (c);
  1619. b.NoScale = l;
  1620. l.prototype.__class__ = "egret.NoScale";
  1621. l = function(e) {
  1622. function a() {
  1623. e.call(this)
  1624. }
  1625. __extends(a, e);
  1626. a.prototype._apply = function(e, a, b) {
  1627. var l = this._getClientWidth(),
  1628. m = this._getClientHeight(),
  1629. c = l,
  1630. d = m,
  1631. k = c / a < d / b ? c / a: d / b,
  1632. c = a * k,
  1633. d = b * k,
  1634. l = Math.floor((l - c) / 2);
  1635. e._offSetY = Math.floor((m - d) / 2);
  1636. this.setEgretSize(a, b / 1, 1 * c, d, l, e._offSetY);
  1637. e._scaleX = 1 * k;
  1638. e._scaleY = 1 * k
  1639. };
  1640. return a
  1641. } (c);
  1642. b.ShowAll = l;
  1643. l.prototype.__class__ = "egret.ShowAll";
  1644. c = function(e) {
  1645. function a() {
  1646. e.call(this)
  1647. }
  1648. __extends(a, e);
  1649. a.prototype._apply = function(e, a, b) {
  1650. var l = this._getClientWidth(),
  1651. m = this._getClientHeight(),
  1652. l = l / a,
  1653. m = m / b;
  1654. this.setEgretSize(a, b, a * l, b * m);
  1655. e._scaleX = l;
  1656. e._scaleY = m
  1657. };
  1658. return a
  1659. } (c);
  1660. b.FullScreen = c;
  1661. c.prototype.__class__ = "egret.FullScreen"
  1662. })(egret || (egret = {}));
  1663. __extends = this.__extends ||
  1664. function(b, d) {
  1665. function c() {
  1666. this.constructor = b
  1667. }
  1668. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1669. c.prototype = d.prototype;
  1670. b.prototype = new c
  1671. }; (function(b) {
  1672. var d = function(c) {
  1673. function a() {
  1674. c.call(this);
  1675. this._originalData = {};
  1676. this._drawAreaList = []
  1677. }
  1678. __extends(a, c);
  1679. a.getInstance = function() {
  1680. null == a.instance && (a.instance = new a);
  1681. return a.instance
  1682. };
  1683. a.prototype.addDrawArea = function(e) {
  1684. this._drawAreaList.push(e)
  1685. };
  1686. a.prototype.clearDrawArea = function() {
  1687. this._drawAreaList = []
  1688. };
  1689. a.prototype.drawImage = function(e, l, m, c, d, f, h, n, p, q, r) {
  1690. void 0 === r && (r = void 0);
  1691. h = h || 0;
  1692. n = n || 0;
  1693. var t = l._texture_to_render;
  1694. if (null != t && 0 != f && 0 != d && 0 != p && 0 != q) {
  1695. var s = b.MainContext.instance.rendererContext._texture_scale_factor;
  1696. d /= s;
  1697. f /= s;
  1698. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1699. s = b.DisplayObject.getTransformBounds(l._getSize(a.identityRectangle), l._worldTransform);
  1700. l._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1701. s = this._originalData;
  1702. s.sourceX = m;
  1703. s.sourceY = c;
  1704. s.sourceWidth = d;
  1705. s.sourceHeight = f;
  1706. s.destX = h;
  1707. s.destY = n;
  1708. s.destWidth = p;
  1709. s.destHeight = q;
  1710. for (var u = this.getDrawAreaList(), v = 0; v < u.length; v++) if (!this.ignoreRender(l, u[v], s.destX, s.destY)) {
  1711. e.drawImage(t, m, c, d, f, h, n, p, q, r);
  1712. break
  1713. }
  1714. } else e.drawImage(t, m, c, d, f, h, n, p, q, r)
  1715. }
  1716. };
  1717. a.prototype.ignoreRender = function(e, a, b, c) {
  1718. var d = e._worldBounds;
  1719. b *= e._worldTransform.a;
  1720. c *= e._worldTransform.d;
  1721. return d.x + d.width + b <= a.x || d.x + b >= a.x + a.width || d.y + d.height + c <= a.y || d.y + c >= a.y + a.height ? !0 : !1
  1722. };
  1723. a.prototype.getDrawAreaList = function() {
  1724. var e;
  1725. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1726. return e
  1727. };
  1728. a.prototype.onResize = function() {
  1729. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1730. this._defaultDrawAreaList = null
  1731. };
  1732. a.identityRectangle = new b.Rectangle;
  1733. return a
  1734. } (b.HashObject);
  1735. b.RenderFilter = d;
  1736. d.prototype.__class__ = "egret.RenderFilter"
  1737. })(egret || (egret = {})); (function(b) {
  1738. var d = function() {
  1739. function c() {}
  1740. c.mapClass = function(a, e, b) {
  1741. void 0 === b && (b = "");
  1742. a = this.getKey(a) + "#" + b;
  1743. this.mapClassDic[a] = e
  1744. };
  1745. c.getKey = function(a) {
  1746. return "string" == typeof a ? a: b.getQualifiedClassName(a)
  1747. };
  1748. c.mapValue = function(a, e, b) {
  1749. void 0 === b && (b = "");
  1750. a = this.getKey(a) + "#" + b;
  1751. this.mapValueDic[a] = e
  1752. };
  1753. c.hasMapRule = function(a, e) {
  1754. void 0 === e && (e = "");
  1755. var b = this.getKey(a) + "#" + e;
  1756. return this.mapValueDic[b] || this.mapClassDic[b] ? !0 : !1
  1757. };
  1758. c.getInstance = function(a, e) {
  1759. void 0 === e && (e = "");
  1760. var l = this.getKey(a) + "#" + e;
  1761. if (this.mapValueDic[l]) return this.mapValueDic[l];
  1762. var m = this.mapClassDic[l];
  1763. if (m) return m = new m,
  1764. this.mapValueDic[l] = m,
  1765. delete this.mapClassDic[l],
  1766. m;
  1767. throw Error(b.getString(1028, l));
  1768. };
  1769. c.mapClassDic = {};
  1770. c.mapValueDic = {};
  1771. return c
  1772. } ();
  1773. b.Injector = d;
  1774. d.prototype.__class__ = "egret.Injector"
  1775. })(egret || (egret = {})); (function(b) {
  1776. var d = function() {
  1777. return function() {
  1778. this.type = null
  1779. }
  1780. } ();
  1781. b.Filter = d;
  1782. d.prototype.__class__ = "egret.Filter"
  1783. })(egret || (egret = {}));
  1784. __extends = this.__extends ||
  1785. function(b, d) {
  1786. function c() {
  1787. this.constructor = b
  1788. }
  1789. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1790. c.prototype = d.prototype;
  1791. b.prototype = new c
  1792. }; (function(b) {
  1793. var d = function(b) {
  1794. function a(e, a) {
  1795. b.call(this);
  1796. this.blurX = e;
  1797. this.blurY = a;
  1798. this.type = "blur"
  1799. }
  1800. __extends(a, b);
  1801. return a
  1802. } (b.Filter);
  1803. b.BlurFilter = d;
  1804. d.prototype.__class__ = "egret.BlurFilter"
  1805. })(egret || (egret = {})); (function(b) {
  1806. var d = function() {
  1807. function b() {}
  1808. b.NORMAL = "normal";
  1809. b.ADD = "add";
  1810. b.ERASE = "erase";
  1811. b.ERASE_REVERSE = "erase_reverse";
  1812. return b
  1813. } ();
  1814. b.BlendMode = d;
  1815. d.prototype.__class__ = "egret.BlendMode"
  1816. })(egret || (egret = {}));
  1817. __extends = this.__extends ||
  1818. function(b, d) {
  1819. function c() {
  1820. this.constructor = b
  1821. }
  1822. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  1823. c.prototype = d.prototype;
  1824. b.prototype = new c
  1825. }; (function(b) {
  1826. var d = function(c) {
  1827. function a() {
  1828. c.call(this);
  1829. this.__hack_local_matrix = null;
  1830. this._sizeDirty = this._normalDirty = !0;
  1831. this._parent = this._texture_to_render = this.name = this._sizeChangeCallTarget = this._sizeChangeCallBack = null;
  1832. this._y = this._x = 0;
  1833. this._scaleY = this._scaleX = 1;
  1834. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1835. this._visible = !0;
  1836. this._rotation = 0;
  1837. this._alpha = 1;
  1838. this._skewY = this._skewX = 0;
  1839. this._touchEnabled = !1;
  1840. this._scrollRect = this.blendMode = null;
  1841. this._explicitHeight = this._explicitWidth = NaN;
  1842. this._hasHeightSet = this._hasWidthSet = !1;
  1843. this._worldBounds = this.mask = null;
  1844. this.worldAlpha = 1;
  1845. this.needDraw = this._isContainer = !1;
  1846. this._hitTestPointTexture = null;
  1847. this._rectH = this._rectW = 0;
  1848. this._stage = null;
  1849. this._cacheAsBitmap = !1;
  1850. this.renderTexture = null;
  1851. this._cacheDirty = !1;
  1852. this._filter = this._colorTransform = null;
  1853. this._worldTransform = new b.Matrix;
  1854. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1855. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1856. }
  1857. __extends(a, c);
  1858. a.prototype._setDirty = function() {
  1859. this._normalDirty = !0
  1860. };
  1861. a.prototype.getDirty = function() {
  1862. return this._normalDirty || this._sizeDirty
  1863. };
  1864. a.prototype._setParentSizeDirty = function() {
  1865. var e = this._parent; ! e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
  1866. };
  1867. a.prototype._setSizeDirty = function() {
  1868. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == this._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
  1869. };
  1870. a.prototype._clearDirty = function() {
  1871. this._normalDirty = !1
  1872. };
  1873. a.prototype._clearSizeDirty = function() {
  1874. this._sizeDirty = !1
  1875. };
  1876. Object.defineProperty(a.prototype, "parent", {
  1877. get: function() {
  1878. return this._parent
  1879. },
  1880. enumerable: !0,
  1881. configurable: !0
  1882. });
  1883. a.prototype._parentChanged = function(e) {
  1884. this._parent = e
  1885. };
  1886. Object.defineProperty(a.prototype, "x", {
  1887. get: function() {
  1888. return this._x
  1889. },
  1890. set: function(e) {
  1891. this._setX(e)
  1892. },
  1893. enumerable: !0,
  1894. configurable: !0
  1895. });
  1896. a.prototype._setX = function(e) {
  1897. b.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1898. };
  1899. Object.defineProperty(a.prototype, "y", {
  1900. get: function() {
  1901. return this._y
  1902. },
  1903. set: function(e) {
  1904. this._setY(e)
  1905. },
  1906. enumerable: !0,
  1907. configurable: !0
  1908. });
  1909. a.prototype._setY = function(e) {
  1910. b.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1911. };
  1912. Object.defineProperty(a.prototype, "scaleX", {
  1913. get: function() {
  1914. return this._scaleX
  1915. },
  1916. set: function(e) {
  1917. b.NumberUtils.isNumber(e) && this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1918. },
  1919. enumerable: !0,
  1920. configurable: !0
  1921. });
  1922. Object.defineProperty(a.prototype, "scaleY", {
  1923. get: function() {
  1924. return this._scaleY
  1925. },
  1926. set: function(e) {
  1927. b.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1928. },
  1929. enumerable: !0,
  1930. configurable: !0
  1931. });
  1932. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1933. get: function() {
  1934. return this._anchorOffsetX
  1935. },
  1936. set: function(e) {
  1937. b.NumberUtils.isNumber(e) && this._anchorOffsetX != e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1938. },
  1939. enumerable: !0,
  1940. configurable: !0
  1941. });
  1942. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1943. get: function() {
  1944. return this._anchorOffsetY
  1945. },
  1946. set: function(e) {
  1947. b.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1948. },
  1949. enumerable: !0,
  1950. configurable: !0
  1951. });
  1952. Object.defineProperty(a.prototype, "anchorX", {
  1953. get: function() {
  1954. return this._anchorX
  1955. },
  1956. set: function(e) {
  1957. this._setAnchorX(e)
  1958. },
  1959. enumerable: !0,
  1960. configurable: !0
  1961. });
  1962. a.prototype._setAnchorX = function(e) {
  1963. b.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1964. };
  1965. Object.defineProperty(a.prototype, "anchorY", {
  1966. get: function() {
  1967. return this._anchorY
  1968. },
  1969. set: function(e) {
  1970. this._setAnchorY(e)
  1971. },
  1972. enumerable: !0,
  1973. configurable: !0
  1974. });
  1975. a.prototype._setAnchorY = function(e) {
  1976. b.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1977. };
  1978. Object.defineProperty(a.prototype, "visible", {
  1979. get: function() {
  1980. return this._visible
  1981. },
  1982. set: function(e) {
  1983. this._setVisible(e)
  1984. },
  1985. enumerable: !0,
  1986. configurable: !0
  1987. });
  1988. a.prototype._setVisible = function(e) {
  1989. this._visible != e && (this._visible = e, this._setSizeDirty())
  1990. };
  1991. Object.defineProperty(a.prototype, "rotation", {
  1992. get: function() {
  1993. return this._rotation
  1994. },
  1995. set: function(e) {
  1996. b.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setDirty(), this._setParentSizeDirty())
  1997. },
  1998. enumerable: !0,
  1999. configurable: !0
  2000. });
  2001. Object.defineProperty(a.prototype, "alpha", {
  2002. get: function() {
  2003. return this._alpha
  2004. },
  2005. set: function(e) {
  2006. b.NumberUtils.isNumber(e) && this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
  2007. },
  2008. enumerable: !0,
  2009. configurable: !0
  2010. });
  2011. Object.defineProperty(a.prototype, "skewX", {
  2012. get: function() {
  2013. return this._skewX
  2014. },
  2015. set: function(e) {
  2016. b.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setDirty(), this._setParentSizeDirty())
  2017. },
  2018. enumerable: !0,
  2019. configurable: !0
  2020. });
  2021. Object.defineProperty(a.prototype, "skewY", {
  2022. get: function() {
  2023. return this._skewY
  2024. },
  2025. set: function(e) {
  2026. b.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setDirty(), this._setParentSizeDirty())
  2027. },
  2028. enumerable: !0,
  2029. configurable: !0
  2030. });
  2031. Object.defineProperty(a.prototype, "touchEnabled", {
  2032. get: function() {
  2033. return this._touchEnabled
  2034. },
  2035. set: function(e) {
  2036. this._setTouchEnabled(e)
  2037. },
  2038. enumerable: !0,
  2039. configurable: !0
  2040. });
  2041. a.prototype._setTouchEnabled = function(e) {
  2042. this._touchEnabled = e
  2043. };
  2044. Object.defineProperty(a.prototype, "scrollRect", {
  2045. get: function() {
  2046. return this._scrollRect
  2047. },
  2048. set: function(e) {
  2049. this._setScrollRect(e)
  2050. },
  2051. enumerable: !0,
  2052. configurable: !0
  2053. });
  2054. a.prototype._setScrollRect = function(e) {
  2055. this._scrollRect = e;
  2056. this._setSizeDirty()
  2057. };
  2058. Object.defineProperty(a.prototype, "measuredWidth", {
  2059. get: function() {
  2060. return this._measureBounds().width
  2061. },
  2062. enumerable: !0,
  2063. configurable: !0
  2064. });
  2065. Object.defineProperty(a.prototype, "measuredHeight", {
  2066. get: function() {
  2067. return this._measureBounds().height
  2068. },
  2069. enumerable: !0,
  2070. configurable: !0
  2071. });
  2072. Object.defineProperty(a.prototype, "explicitWidth", {
  2073. get: function() {
  2074. return this._explicitWidth
  2075. },
  2076. enumerable: !0,
  2077. configurable: !0
  2078. });
  2079. Object.defineProperty(a.prototype, "explicitHeight", {
  2080. get: function() {
  2081. return this._explicitHeight
  2082. },
  2083. enumerable: !0,
  2084. configurable: !0
  2085. });
  2086. Object.defineProperty(a.prototype, "width", {
  2087. get: function() {
  2088. return this._getWidth()
  2089. },
  2090. set: function(e) {
  2091. this._setWidth(e)
  2092. },
  2093. enumerable: !0,
  2094. configurable: !0
  2095. });
  2096. a.prototype._getWidth = function() {
  2097. return this._getSize(b.Rectangle.identity).width
  2098. };
  2099. Object.defineProperty(a.prototype, "height", {
  2100. get: function() {
  2101. return this._getHeight()
  2102. },
  2103. set: function(e) {
  2104. this._setHeight(e)
  2105. },
  2106. enumerable: !0,
  2107. configurable: !0
  2108. });
  2109. a.prototype._getHeight = function() {
  2110. return this._getSize(b.Rectangle.identity).height
  2111. };
  2112. a.prototype._setWidth = function(e) {
  2113. this._setSizeDirty();
  2114. this._setCacheDirty();
  2115. this._explicitWidth = e;
  2116. this._hasWidthSet = b.NumberUtils.isNumber(e)
  2117. };
  2118. a.prototype._setHeight = function(e) {
  2119. this._setSizeDirty();
  2120. this._setCacheDirty();
  2121. this._explicitHeight = e;
  2122. this._hasHeightSet = b.NumberUtils.isNumber(e)
  2123. };
  2124. a.prototype._draw = function(e) {
  2125. if (this._visible && !this.drawCacheTexture(e)) {
  2126. var a = b.MainContext.__use_new_draw && this._isContainer;
  2127. this._filter && !a && e.setGlobalFilter(this._filter);
  2128. this._colorTransform && !a && e.setGlobalColorTransform(this._colorTransform.matrix);
  2129. e.setAlpha(this.worldAlpha, this.blendMode);
  2130. e.setTransform(this._worldTransform);
  2131. var m = this.mask || this._scrollRect;
  2132. m && !a && e.pushMask(m);
  2133. this._render(e);
  2134. m && !a && e.popMask();
  2135. this._colorTransform && !a && e.setGlobalColorTransform(null);
  2136. this._filter && !a && e.setGlobalFilter(null)
  2137. }
  2138. this.destroyCacheBounds()
  2139. };
  2140. a.prototype._setGlobalFilter = function(e) {
  2141. e.setGlobalFilter(this._filter)
  2142. };
  2143. a.prototype._removeGlobalFilter = function(e) {
  2144. e.setGlobalFilter(null)
  2145. };
  2146. a.prototype._setGlobalColorTransform = function(e) {
  2147. e.setGlobalColorTransform(this._colorTransform.matrix)
  2148. };
  2149. a.prototype._removeGlobalColorTransform = function(e) {
  2150. e.setGlobalColorTransform(null)
  2151. };
  2152. a.prototype._pushMask = function(e) {
  2153. e.setTransform(this._worldTransform);
  2154. var a = this.mask || this._scrollRect;
  2155. a && e.pushMask(a)
  2156. };
  2157. a.prototype._popMask = function(e) {
  2158. e.popMask()
  2159. };
  2160. a.prototype.drawCacheTexture = function(e) {
  2161. if (!1 == this._cacheAsBitmap) return ! 1;
  2162. var a = this.getBounds(b.Rectangle.identity),
  2163. m = b.MainContext.instance.rendererContext._texture_scale_factor;
  2164. if (this._cacheDirty || null == this._texture_to_render || Math.round(a.width) != Math.round(this._texture_to_render._sourceWidth * m) || Math.round(a.height) != Math.round(this._texture_to_render._sourceHeight * m)) this._cacheDirty = !this._makeBitmapCache();
  2165. if (null == this._texture_to_render) return ! 1;
  2166. var c = this._texture_to_render,
  2167. a = c._offsetX,
  2168. m = c._offsetY,
  2169. d = c._textureWidth,
  2170. c = c._textureHeight;
  2171. this._updateTransform();
  2172. e.setAlpha(this.worldAlpha, this.blendMode);
  2173. e.setTransform(this._worldTransform);
  2174. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, d, c, a, m, d, c);
  2175. return ! 0
  2176. };
  2177. a.prototype._updateTransform = function() {
  2178. this._visible && (this._calculateWorldTransform(), "updateTransform" == b.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || this._cacheAsBitmap) && b.RenderCommand.push(this._draw, this))
  2179. };
  2180. a.prototype._calculateWorldTransform = function() {
  2181. var e = this._worldTransform,
  2182. a = this._parent;
  2183. e.identityMatrix(a._worldTransform);
  2184. this._getMatrix(e);
  2185. var b = this._scrollRect;
  2186. b && e.append(1, 0, 0, 1, -b.x, -b.y);
  2187. this.worldAlpha = a.worldAlpha * this._alpha
  2188. };
  2189. a.prototype._render = function(e) {};
  2190. a.prototype.getBounds = function(e, a) {
  2191. void 0 === a && (a = !0);
  2192. var m = this._measureBounds(),
  2193. c = this._hasWidthSet ? this._explicitWidth: m.width,
  2194. d = this._hasHeightSet ? this._explicitHeight: m.height;
  2195. this._rectW = m.width;
  2196. this._rectH = m.height;
  2197. this._clearSizeDirty();
  2198. var f = m.x,
  2199. m = m.y,
  2200. h = 0,
  2201. n = 0;
  2202. a && (0 != this._anchorX || 0 != this._anchorY ? (h = c * this._anchorX, n = d * this._anchorY) : (h = this._anchorOffsetX, n = this._anchorOffsetY));
  2203. this._cacheBounds.initialize(f - h, m - n, c, d);
  2204. c = this._cacheBounds;
  2205. e || (e = new b.Rectangle);
  2206. return e.initialize(c.x, c.y, c.width, c.height)
  2207. };
  2208. a.prototype.destroyCacheBounds = function() {
  2209. this._cacheBounds.x = 0;
  2210. this._cacheBounds.y = 0;
  2211. this._cacheBounds.width = 0;
  2212. this._cacheBounds.height = 0
  2213. };
  2214. a.prototype._getConcatenatedMatrix = function() {
  2215. for (var e = a.identityMatrixForGetConcatenated.identity(), l = this; null != l;) {
  2216. if (0 != l._anchorX || 0 != l._anchorY) {
  2217. var c = l._getSize(b.Rectangle.identity);
  2218. e.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, c.width * l._anchorX, c.height * l._anchorY)
  2219. } else e.prependTransform(l._x, l._y, l._scaleX, l._scaleY, l._rotation, l._skewX, l._skewY, l._anchorOffsetX, l._anchorOffsetY);
  2220. l._scrollRect && e.prepend(1, 0, 0, 1, -l._scrollRect.x, -l._scrollRect.y);
  2221. l = l._parent
  2222. }
  2223. return e
  2224. };
  2225. a.prototype.localToGlobal = function(e, a, c) {
  2226. void 0 === e && (e = 0);
  2227. void 0 === a && (a = 0);
  2228. var d = this._getConcatenatedMatrix();
  2229. d.append(1, 0, 0, 1, e, a);
  2230. c || (c = new b.Point);
  2231. c.x = d.tx;
  2232. c.y = d.ty;
  2233. return c
  2234. };
  2235. a.prototype.globalToLocal = function(e, a, c) {
  2236. void 0 === e && (e = 0);
  2237. void 0 === a && (a = 0);
  2238. var d = this._getConcatenatedMatrix();
  2239. d.invert();
  2240. d.append(1, 0, 0, 1, e, a);
  2241. c || (c = new b.Point);
  2242. c.x = d.tx;
  2243. c.y = d.ty;
  2244. return c
  2245. };
  2246. a.prototype.hitTest = function(e, a, c) {
  2247. void 0 === c && (c = !1);
  2248. if (!this._visible || !c && !this._touchEnabled) return null;
  2249. c = this.getBounds(b.Rectangle.identity, !1);
  2250. e -= c.x;
  2251. a -= c.y;
  2252. return 0 <= e && e < c.width && 0 <= a && a < c.height ? this.mask || this._scrollRect ? this._scrollRect && e > this._scrollRect.x && a > this._scrollRect.y && e < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this: null: this: null
  2253. };
  2254. a.prototype.hitTestPoint = function(e, a, c) {
  2255. e = this.globalToLocal(e, a);
  2256. return c ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), c = this._hitTestPointTexture, c.drawToTexture(this), 0 != c.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  2257. };
  2258. a.prototype._getMatrix = function(e) {
  2259. e || (e = b.Matrix.identity.identity());
  2260. var a, c;
  2261. c = this._getOffsetPoint();
  2262. a = c.x;
  2263. c = c.y;
  2264. var d = this.__hack_local_matrix;
  2265. d ? (e.append(d.a, d.b, d.c, d.d, d.tx, d.ty), e.append(1, 0, 0, 1, -a, -c)) : e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, c);
  2266. return e
  2267. };
  2268. a.prototype._getSize = function(e) {
  2269. if (this._hasHeightSet && this._hasWidthSet) return this._clearSizeDirty(),
  2270. e.initialize(0, 0, this._explicitWidth, this._explicitHeight);
  2271. this._measureSize(e);
  2272. this._hasWidthSet && (e.width = this._explicitWidth);
  2273. this._hasHeightSet && (e.height = this._explicitHeight);
  2274. return e
  2275. };
  2276. a.prototype._measureSize = function(e) {
  2277. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  2278. e.x = 0;
  2279. e.y = 0;
  2280. return e
  2281. };
  2282. a.prototype._measureBounds = function() {
  2283. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2284. };
  2285. a.prototype._getOffsetPoint = function() {
  2286. var e = this._anchorOffsetX,
  2287. a = this._anchorOffsetY;
  2288. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity),
  2289. e = this._anchorX * a.width,
  2290. a = this._anchorY * a.height;
  2291. var c = b.Point.identity;
  2292. c.x = e;
  2293. c.y = a;
  2294. return c
  2295. };
  2296. a.prototype._onAddToStage = function() {
  2297. this._stage = b.MainContext.instance.stage;
  2298. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2299. };
  2300. a.prototype._onRemoveFromStage = function() {
  2301. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2302. };
  2303. Object.defineProperty(a.prototype, "stage", {
  2304. get: function() {
  2305. return this._stage
  2306. },
  2307. enumerable: !0,
  2308. configurable: !0
  2309. });
  2310. a.prototype.addEventListener = function(e, l, m, d, g) {
  2311. void 0 === d && (d = !1);
  2312. void 0 === g && (g = 0);
  2313. c.prototype.addEventListener.call(this, e, l, m, d, g); ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(d ? a._enterFrameCallBackList: a._renderCallBackList, l, m, g, this)
  2314. };
  2315. a.prototype.removeEventListener = function(e, l, m, d) {
  2316. void 0 === d && (d = !1);
  2317. c.prototype.removeEventListener.call(this, e, l, m, d); ((d = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(d ? a._enterFrameCallBackList: a._renderCallBackList, l, m, this)
  2318. };
  2319. a.prototype.dispatchEvent = function(e) {
  2320. if (!e._bubbles) return c.prototype.dispatchEvent.call(this, e);
  2321. for (var a = [], b = this; b;) a.push(b),
  2322. b = b._parent;
  2323. e._reset();
  2324. this._dispatchPropagationEvent(e, a);
  2325. return ! e._isDefaultPrevented
  2326. };
  2327. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2328. b = a.length;
  2329. for (var c = 1,
  2330. d = b - 1; 0 <= d; d--) {
  2331. var f = a[d];
  2332. e._currentTarget = f;
  2333. e._target = this;
  2334. e._eventPhase = c;
  2335. f._notifyListener(e);
  2336. if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
  2337. }
  2338. f = a[0];
  2339. e._currentTarget = f;
  2340. e._target = this;
  2341. e._eventPhase = 2;
  2342. f._notifyListener(e);
  2343. if (!e._isPropagationStopped && !e._isPropagationImmediateStopped) for (c = 3, d = 1; d < b && (f = a[d], e._currentTarget = f, e._target = this, e._eventPhase = c, f._notifyListener(e), !e._isPropagationStopped && !e._isPropagationImmediateStopped); d++);
  2344. };
  2345. a.prototype.willTrigger = function(e) {
  2346. for (var a = this; a;) {
  2347. if (a.hasEventListener(e)) return ! 0;
  2348. a = a._parent
  2349. }
  2350. return ! 1
  2351. };
  2352. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2353. get: function() {
  2354. return this._cacheAsBitmap
  2355. },
  2356. set: function(e) { (this._cacheAsBitmap = e) ? b.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2357. },
  2358. enumerable: !0,
  2359. configurable: !0
  2360. });
  2361. a.prototype._makeBitmapCache = function() {
  2362. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2363. var e = this.renderTexture.drawToTexture(this);
  2364. this._texture_to_render = e ? this.renderTexture: null;
  2365. return e
  2366. };
  2367. a.prototype._setCacheDirty = function(e) {
  2368. void 0 === e && (e = !0);
  2369. this._cacheDirty = e
  2370. };
  2371. a.getTransformBounds = function(e, a) {
  2372. var b = e.x,
  2373. c = e.y,
  2374. d = e.width,
  2375. f = e.height; (b || c) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -c);
  2376. var h = d * a.a,
  2377. d = d * a.b,
  2378. n = f * a.c,
  2379. f = f * a.d,
  2380. p = a.tx,
  2381. q = a.ty,
  2382. r = p,
  2383. t = p,
  2384. s = q,
  2385. u = q; (b = h + p) < r ? r = b: b > t && (t = b); (b = h + n + p) < r ? r = b: b > t && (t = b); (b = n + p) < r ? r = b: b > t && (t = b); (c = d + q) < s ? s = c: c > u && (u = c); (c = d + f + q) < s ? s = c: c > u && (u = c); (c = f + q) < s ? s = c: c > u && (u = c);
  2386. return e.initialize(r, s, t - r, u - s)
  2387. };
  2388. Object.defineProperty(a.prototype, "colorTransform", {
  2389. get: function() {
  2390. return this._colorTransform
  2391. },
  2392. set: function(e) {
  2393. this._colorTransform = e
  2394. },
  2395. enumerable: !0,
  2396. configurable: !0
  2397. });
  2398. Object.defineProperty(a.prototype, "filter", {
  2399. get: function() {
  2400. return this._filter
  2401. },
  2402. set: function(e) {
  2403. this._filter = e
  2404. },
  2405. enumerable: !0,
  2406. configurable: !0
  2407. });
  2408. a.identityMatrixForGetConcatenated = new b.Matrix;
  2409. a._enterFrameCallBackList = [];
  2410. a._renderCallBackList = [];
  2411. return a
  2412. } (b.EventDispatcher);
  2413. b.DisplayObject = d;
  2414. d.prototype.__class__ = "egret.DisplayObject";
  2415. d = function() {
  2416. function b() {
  2417. this.matrix = null
  2418. }
  2419. b.prototype.updateColor = function(a, e, b, c, d, g, f, h) {};
  2420. return b
  2421. } ();
  2422. b.ColorTransform = d;
  2423. d.prototype.__class__ = "egret.ColorTransform"
  2424. })(egret || (egret = {}));
  2425. __extends = this.__extends ||
  2426. function(b, d) {
  2427. function c() {
  2428. this.constructor = b
  2429. }
  2430. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2431. c.prototype = d.prototype;
  2432. b.prototype = new c
  2433. }; (function(b) {
  2434. var d = function(c) {
  2435. function a() {
  2436. c.call(this);
  2437. this._touchChildren = !0;
  2438. this._children = [];
  2439. this._isContainer = !0
  2440. }
  2441. __extends(a, c);
  2442. Object.defineProperty(a.prototype, "touchChildren", {
  2443. get: function() {
  2444. return this._touchChildren
  2445. },
  2446. set: function(e) {
  2447. this._touchChildren = e
  2448. },
  2449. enumerable: !0,
  2450. configurable: !0
  2451. });
  2452. Object.defineProperty(a.prototype, "numChildren", {
  2453. get: function() {
  2454. return this._children.length
  2455. },
  2456. enumerable: !0,
  2457. configurable: !0
  2458. });
  2459. a.prototype.setChildIndex = function(e, a) {
  2460. this.doSetChildIndex(e, a)
  2461. };
  2462. a.prototype.doSetChildIndex = function(e, a) {
  2463. var c = this._children.indexOf(e);
  2464. 0 > c && b.Logger.fatalWithErrorId(1006);
  2465. this._children.splice(c, 1);
  2466. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2467. };
  2468. a.prototype.addChild = function(e) {
  2469. var a = this._children.length;
  2470. e._parent == this && a--;
  2471. return this._doAddChild(e, a)
  2472. };
  2473. a.prototype.addChildAt = function(e, a) {
  2474. return this._doAddChild(e, a)
  2475. };
  2476. a.prototype._doAddChild = function(e, l, c) {
  2477. void 0 === c && (c = !0);
  2478. if (e == this) return e;
  2479. if (0 > l || l > this._children.length) return b.Logger.fatalWithErrorId(1007),
  2480. e;
  2481. var d = e._parent;
  2482. if (d == this) return this.doSetChildIndex(e, l),
  2483. e;
  2484. if (d) {
  2485. var g = d._children.indexOf(e);
  2486. 0 <= g && d._doRemoveChild(g)
  2487. }
  2488. this._children.splice(l, 0, e);
  2489. e._parentChanged(this);
  2490. c && e.dispatchEventWith(b.Event.ADDED, !0);
  2491. if (this._stage) for (e._onAddToStage(), l = a.__EVENT__ADD_TO_STAGE_LIST; 0 < l.length;) d = l.shift(),
  2492. c && d.dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2493. e._setDirty();
  2494. this._setSizeDirty();
  2495. return e
  2496. };
  2497. a.prototype.removeChild = function(e) {
  2498. e = this._children.indexOf(e);
  2499. if (0 <= e) return this._doRemoveChild(e);
  2500. b.Logger.fatalWithErrorId(1008);
  2501. return null
  2502. };
  2503. a.prototype.removeChildAt = function(e) {
  2504. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2505. b.Logger.fatalWithErrorId(1007);
  2506. return null
  2507. };
  2508. a.prototype._doRemoveChild = function(e, l) {
  2509. void 0 === l && (l = !0);
  2510. var c = this._children,
  2511. d = c[e];
  2512. l && d.dispatchEventWith(b.Event.REMOVED, !0);
  2513. if (this._stage) {
  2514. d._onRemoveFromStage();
  2515. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2516. var f = g.shift();
  2517. l && f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2518. f._stage = null
  2519. }
  2520. }
  2521. d._parentChanged(null);
  2522. c.splice(e, 1);
  2523. this._setSizeDirty();
  2524. return d
  2525. };
  2526. a.prototype.getChildAt = function(e) {
  2527. if (0 <= e && e < this._children.length) return this._children[e];
  2528. b.Logger.fatalWithErrorId(1007);
  2529. return null
  2530. };
  2531. a.prototype.contains = function(e) {
  2532. for (; e;) {
  2533. if (e == this) return ! 0;
  2534. e = e._parent
  2535. }
  2536. return ! 1
  2537. };
  2538. a.prototype.swapChildrenAt = function(e, a) {
  2539. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatalWithErrorId(1007)
  2540. };
  2541. a.prototype.swapChildren = function(e, a) {
  2542. var c = this._children.indexOf(e),
  2543. d = this._children.indexOf(a); - 1 == c || -1 == d ? b.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(c, d)
  2544. };
  2545. a.prototype._swapChildrenAt = function(e, a) {
  2546. if (e != a) {
  2547. var b = this._children,
  2548. c = b[e];
  2549. b[e] = b[a];
  2550. b[a] = c
  2551. }
  2552. };
  2553. a.prototype.getChildIndex = function(e) {
  2554. return this._children.indexOf(e)
  2555. };
  2556. a.prototype.removeChildren = function() {
  2557. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2558. };
  2559. a.prototype._updateTransform = function() {
  2560. if (this._visible) {
  2561. this._filter && b.RenderCommand.push(this._setGlobalFilter, this);
  2562. this._colorTransform && b.RenderCommand.push(this._setGlobalColorTransform, this);
  2563. var e = this.mask || this._scrollRect;
  2564. e && b.RenderCommand.push(this._pushMask, this);
  2565. c.prototype._updateTransform.call(this);
  2566. if (!this._cacheAsBitmap || !this._texture_to_render) for (var a = 0,
  2567. d = this._children,
  2568. k = d.length; a < k; a++) d[a]._updateTransform();
  2569. e && b.RenderCommand.push(this._popMask, this);
  2570. this._colorTransform && b.RenderCommand.push(this._removeGlobalColorTransform, this);
  2571. this._filter && b.RenderCommand.push(this._removeGlobalFilter, this)
  2572. }
  2573. };
  2574. a.prototype._render = function(e) {
  2575. if (!b.MainContext.__use_new_draw) for (var a = 0,
  2576. c = this._children,
  2577. d = c.length; a < d; a++) c[a]._draw(e)
  2578. };
  2579. a.prototype._measureBounds = function() {
  2580. for (var e = 0,
  2581. a = 0,
  2582. c = 0,
  2583. d = 0,
  2584. g = this._children,
  2585. f = g.length,
  2586. h = 0; h < f; h++) {
  2587. var n = g[h];
  2588. if (n._visible) {
  2589. var p = n.getBounds(b.Rectangle.identity, !1),
  2590. q = p.x,
  2591. r = p.y,
  2592. t = p.width,
  2593. p = p.height,
  2594. n = n._getMatrix(),
  2595. n = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(q, r, t, p), n),
  2596. q = n.x,
  2597. r = n.y,
  2598. t = n.width + n.x,
  2599. n = n.height + n.y;
  2600. if (q < e || 0 == h) e = q;
  2601. if (t > a || 0 == h) a = t;
  2602. if (r < c || 0 == h) c = r;
  2603. if (n > d || 0 == h) d = n
  2604. }
  2605. }
  2606. return b.Rectangle.identity.initialize(e, c, a - e, d - c)
  2607. };
  2608. a.prototype.hitTest = function(e, a, d) {
  2609. void 0 === d && (d = !1);
  2610. var k;
  2611. if (!this._visible) return null;
  2612. if (this._scrollRect) {
  2613. if (e < this._scrollRect.x || a < this._scrollRect.y || e > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2614. } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  2615. for (var g = this._children,
  2616. f = this._touchChildren,
  2617. h = g.length - 1; 0 <= h; h--) {
  2618. var n = g[h],
  2619. p = n._getMatrix(),
  2620. q = n._scrollRect;
  2621. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2622. p.invert();
  2623. p = b.Matrix.transformCoords(p, e, a);
  2624. if (n = n.hitTest(p.x, p.y, !0)) {
  2625. if (!f) return this;
  2626. if (n._touchEnabled && f) return n;
  2627. k = this
  2628. }
  2629. }
  2630. return k ? k: this._texture_to_render ? c.prototype.hitTest.call(this, e, a, d) : null
  2631. };
  2632. a.prototype._onAddToStage = function() {
  2633. c.prototype._onAddToStage.call(this);
  2634. for (var e = this._children.length,
  2635. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2636. };
  2637. a.prototype._onRemoveFromStage = function() {
  2638. c.prototype._onRemoveFromStage.call(this);
  2639. for (var e = this._children,
  2640. a = e.length,
  2641. b = 0; b < a; b++) e[b]._onRemoveFromStage()
  2642. };
  2643. a.prototype.getChildByName = function(e) {
  2644. for (var a = this._children,
  2645. b = a.length,
  2646. c, d = 0; d < b; d++) if (c = a[d], c.name == e) return c;
  2647. return null
  2648. };
  2649. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2650. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2651. return a
  2652. } (b.DisplayObject);
  2653. b.DisplayObjectContainer = d;
  2654. d.prototype.__class__ = "egret.DisplayObjectContainer"
  2655. })(egret || (egret = {})); (function(b) {
  2656. var d = function() {
  2657. function b() {}
  2658. b.NO_BORDER = "noBorder";
  2659. b.NO_SCALE = "noScale";
  2660. b.SHOW_ALL = "showAll";
  2661. b.EXACT_FIT = "exactFit";
  2662. return b
  2663. } ();
  2664. b.StageScaleMode = d;
  2665. d.prototype.__class__ = "egret.StageScaleMode"
  2666. })(egret || (egret = {}));
  2667. __extends = this.__extends ||
  2668. function(b, d) {
  2669. function c() {
  2670. this.constructor = b
  2671. }
  2672. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2673. c.prototype = d.prototype;
  2674. b.prototype = new c
  2675. }; (function(b) {
  2676. var d = function(c) {
  2677. function a(e, a) {
  2678. void 0 === e && (e = 480);
  2679. void 0 === a && (a = 800);
  2680. c.call(this);
  2681. this._changeSizeDispatchFlag = !0;
  2682. this._scaleMode = "";
  2683. this._stageHeight = this._stageWidth = NaN;
  2684. this.touchEnabled = !0;
  2685. this._stage = this;
  2686. this._stageWidth = e;
  2687. this._stageHeight = a
  2688. }
  2689. __extends(a, c);
  2690. a.prototype.invalidate = function() {
  2691. a._invalidateRenderFlag = !0
  2692. };
  2693. Object.defineProperty(a.prototype, "scaleMode", {
  2694. get: function() {
  2695. return this._scaleMode
  2696. },
  2697. set: function(e) {
  2698. this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
  2699. },
  2700. enumerable: !0,
  2701. configurable: !0
  2702. });
  2703. a.prototype.changeSize = function() {
  2704. this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(b.Event.RESIZE))
  2705. };
  2706. a.prototype.setResolutionPolicy = function() {
  2707. var e = a.SCALE_MODE_ENUM[this._scaleMode];
  2708. if (!e) throw Error(b.getString(1024));
  2709. var l = new b.EqualToFrame,
  2710. e = new b.ResolutionPolicy(l, e);
  2711. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  2712. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2713. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2714. };
  2715. Object.defineProperty(a.prototype, "stageWidth", {
  2716. get: function() {
  2717. return this._stageWidth
  2718. },
  2719. enumerable: !0,
  2720. configurable: !0
  2721. });
  2722. Object.defineProperty(a.prototype, "stageHeight", {
  2723. get: function() {
  2724. return this._stageHeight
  2725. },
  2726. enumerable: !0,
  2727. configurable: !0
  2728. });
  2729. a.prototype.hitTest = function(e, a, c) {
  2730. if (!this._touchEnabled) return null;
  2731. var d;
  2732. if (!this._touchChildren) return this;
  2733. c = this._children;
  2734. for (var g = c.length - 1; 0 <= g; g--) {
  2735. d = c[g];
  2736. var f = d._getMatrix(),
  2737. h = d._scrollRect;
  2738. h && f.append(1, 0, 0, 1, -h.x, -h.y);
  2739. f.invert();
  2740. f = b.Matrix.transformCoords(f, e, a);
  2741. if ((d = d.hitTest(f.x, f.y, !0)) && d._touchEnabled) return d
  2742. }
  2743. return this
  2744. };
  2745. a.prototype.getBounds = function(e) {
  2746. e || (e = new b.Rectangle);
  2747. return e.initialize(0, 0, this._stageWidth, this._stageHeight)
  2748. };
  2749. a.prototype._updateTransform = function() {
  2750. for (var e = 0,
  2751. a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2752. };
  2753. Object.defineProperty(a.prototype, "focus", {
  2754. get: function() {
  2755. return null
  2756. },
  2757. enumerable: !0,
  2758. configurable: !0
  2759. });
  2760. a.registerScaleMode = function(e, l, c) {
  2761. a.SCALE_MODE_ENUM[e] && !c ? b.Logger.warningWithErrorId(1009, e) : a.SCALE_MODE_ENUM[e] = l
  2762. };
  2763. a._invalidateRenderFlag = !1;
  2764. a.SCALE_MODE_ENUM = {};
  2765. return a
  2766. } (b.DisplayObjectContainer);
  2767. b.Stage = d;
  2768. d.prototype.__class__ = "egret.Stage"
  2769. })(egret || (egret = {}));
  2770. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
  2771. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
  2772. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
  2773. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen;
  2774. __extends = this.__extends ||
  2775. function(b, d) {
  2776. function c() {
  2777. this.constructor = b
  2778. }
  2779. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  2780. c.prototype = d.prototype;
  2781. b.prototype = new c
  2782. }; (function(b) {
  2783. var d = function(c) {
  2784. function a(e) {
  2785. void 0 === e && (e = null);
  2786. c.call(this);
  2787. this._lastTouchPosition = new b.Point(0, 0);
  2788. this._touchStartPosition = new b.Point(0, 0);
  2789. this._scrollStarted = !1;
  2790. this._lastTouchTime = 0;
  2791. this._lastTouchEvent = null;
  2792. this._velocitys = [];
  2793. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  2794. this._vScrollTween = this._hScrollTween = null;
  2795. this.scrollBeginThreshold = 10;
  2796. this.scrollSpeed = 1;
  2797. this._content = null;
  2798. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2799. this._scrollTop = this._scrollLeft = 0;
  2800. this._vCanScroll = this._hCanScroll = !1;
  2801. this.touchBeginTimer = this.delayTouchBeginEvent = null;
  2802. this.touchEnabled = !0;
  2803. e && this.setContent(e)
  2804. }
  2805. __extends(a, c);
  2806. a.prototype.setContent = function(e) {
  2807. this._content !== e && (this.removeContent(), e && (this._content = e, c.prototype.addChild.call(this, e), this._addEvents()))
  2808. };
  2809. a.prototype.removeContent = function() {
  2810. this._content && (this._removeEvents(), c.prototype.removeChildAt.call(this, 0));
  2811. this._content = null
  2812. };
  2813. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2814. get: function() {
  2815. return this._verticalScrollPolicy
  2816. },
  2817. set: function(e) {
  2818. e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
  2819. },
  2820. enumerable: !0,
  2821. configurable: !0
  2822. });
  2823. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2824. get: function() {
  2825. return this._horizontalScrollPolicy
  2826. },
  2827. set: function(e) {
  2828. e != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
  2829. },
  2830. enumerable: !0,
  2831. configurable: !0
  2832. });
  2833. Object.defineProperty(a.prototype, "scrollLeft", {
  2834. get: function() {
  2835. return this._scrollLeft
  2836. },
  2837. set: function(e) {
  2838. e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
  2839. },
  2840. enumerable: !0,
  2841. configurable: !0
  2842. });
  2843. Object.defineProperty(a.prototype, "scrollTop", {
  2844. get: function() {
  2845. return this._scrollTop
  2846. },
  2847. set: function(e) {
  2848. e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
  2849. },
  2850. enumerable: !0,
  2851. configurable: !0
  2852. });
  2853. a.prototype.setScrollPosition = function(e, a, b) {
  2854. void 0 === b && (b = !1);
  2855. if (!b || 0 != e || 0 != a) if (b || this._scrollTop != e || this._scrollLeft != a) {
  2856. if (b) {
  2857. b = this._isOnTheEdge(!0);
  2858. var c = this._isOnTheEdge(!1);
  2859. this._scrollTop += b ? e / 2 : e;
  2860. this._scrollLeft += c ? a / 2 : a
  2861. } else this._scrollTop = e,
  2862. this._scrollLeft = a;
  2863. this._validatePosition(!0, !0);
  2864. this._updateContentPosition()
  2865. }
  2866. };
  2867. a.prototype._isOnTheEdge = function(e) {
  2868. void 0 === e && (e = !0);
  2869. var a = this._scrollTop,
  2870. b = this._scrollLeft;
  2871. return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2872. };
  2873. a.prototype._validatePosition = function(e, a) {
  2874. void 0 === e && (e = !1);
  2875. void 0 === a && (a = !1);
  2876. if (e) {
  2877. var b = this.height,
  2878. c = this._getContentHeight();
  2879. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2880. this._scrollTop = Math.min(this._scrollTop, c > b ? c - b / 2 : b / 2)
  2881. }
  2882. a && (b = this.width, c = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, c > b ? c - b / 2 : b / 2))
  2883. };
  2884. a.prototype._setWidth = function(e) {
  2885. this._explicitWidth != e && (c.prototype._setWidth.call(this, e), this._updateContentPosition())
  2886. };
  2887. a.prototype._setHeight = function(e) {
  2888. this._explicitHeight != e && (c.prototype._setHeight.call(this, e), this._updateContentPosition())
  2889. };
  2890. a.prototype._updateContentPosition = function() {
  2891. var e = this.getBounds(b.Rectangle.identity);
  2892. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
  2893. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2894. };
  2895. a.prototype._checkScrollPolicy = function() {
  2896. var e = this.__checkScrollPolicy(this._horizontalScrollPolicy, this._getContentWidth(), this.width);
  2897. this._hCanScroll = e;
  2898. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2899. this._vCanScroll = a;
  2900. return e || a
  2901. };
  2902. a.prototype.__checkScrollPolicy = function(e, a, b) {
  2903. return "on" == e ? !0 : "off" == e ? !1 : a > b
  2904. };
  2905. a.prototype._addEvents = function() {
  2906. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2907. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2908. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2909. };
  2910. a.prototype._removeEvents = function() {
  2911. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2912. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2913. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2914. };
  2915. a.prototype._onTouchBegin = function(e) { ! e._isDefaultPrevented && this._checkScrollPolicy() && (this._touchStartPosition.x = e.stageX, this._touchStartPosition.y = e.stageY, (this._isHTweenPlaying || this._isVTweenPlaying) && this._onScrollFinished(), 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(e), e.preventDefault())
  2916. };
  2917. a.prototype._onTouchBeginCapture = function(e) {
  2918. var a = this._checkScrollPolicy();
  2919. if (a) {
  2920. for (var c = e.target; c != this;) {
  2921. if ("_checkScrollPolicy" in c && (a = c._checkScrollPolicy())) return;
  2922. c = c.parent
  2923. }
  2924. e.stopPropagation();
  2925. this.delayTouchBeginEvent = this.cloneTouchEvent(e);
  2926. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100, 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2927. this.touchBeginTimer.start();
  2928. this._onTouchBegin(e)
  2929. }
  2930. };
  2931. a.prototype._onTouchEndCapture = function(e) {
  2932. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2933. };
  2934. a.prototype._onTouchBeginTimer = function() {
  2935. this.touchBeginTimer.stop();
  2936. var e = this.delayTouchBeginEvent;
  2937. this.delayTouchBeginEvent = null;
  2938. this.stage && this.dispatchPropagationEvent(e)
  2939. };
  2940. a.prototype.dispatchPropagationEvent = function(e) {
  2941. for (var a = [], b = e._target, c = 0; b;) b == this && (c = a.length),
  2942. a.push(b),
  2943. b = b.parent;
  2944. b = a.slice(0, c);
  2945. b = b.reverse();
  2946. a = b.concat(a);
  2947. this._dispatchPropagationEvent(e, a, c)
  2948. };
  2949. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2950. for (var c = a.length,
  2951. d = 0; d < c; d++) {
  2952. var f = a[d];
  2953. e._currentTarget = f;
  2954. e._eventPhase = d < b ? 1 : d == b ? 2 : 3;
  2955. f._notifyListener(e);
  2956. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  2957. }
  2958. };
  2959. a.prototype._onTouchMove = function(e) {
  2960. if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
  2961. if (!this._scrollStarted) {
  2962. var a = e.stageX - this._touchStartPosition.x,
  2963. b = e.stageY - this._touchStartPosition.y;
  2964. if (Math.sqrt(a * a + b * b) < this.scrollBeginThreshold) {
  2965. this._logTouchEvent(e);
  2966. return
  2967. }
  2968. }
  2969. this._scrollStarted = !0;
  2970. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2971. this.touchChildren = !1;
  2972. a = this._getPointChange(e);
  2973. this.setScrollPosition(a.y, a.x, !0);
  2974. this._calcVelocitys(e);
  2975. this._logTouchEvent(e)
  2976. }
  2977. };
  2978. a.prototype._onTouchEnd = function(e) {
  2979. this.touchChildren = !0;
  2980. this._scrollStarted = !1;
  2981. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2982. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2983. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  2984. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2985. this._moveAfterTouchEnd()
  2986. };
  2987. a.prototype._onEnterFrame = function(e) {
  2988. e = b.getTimer();
  2989. 100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2990. };
  2991. a.prototype._logTouchEvent = function(e) {
  2992. this._lastTouchPosition.x = e.stageX;
  2993. this._lastTouchPosition.y = e.stageY;
  2994. this._lastTouchEvent = this.cloneTouchEvent(e);
  2995. this._lastTouchTime = b.getTimer()
  2996. };
  2997. a.prototype._getPointChange = function(e) {
  2998. return {
  2999. x: !1 === this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
  3000. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
  3001. }
  3002. };
  3003. a.prototype._calcVelocitys = function(e) {
  3004. var a = b.getTimer();
  3005. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  3006. else {
  3007. var c = this._getPointChange(e),
  3008. a = a - this._lastTouchTime;
  3009. c.x /= a;
  3010. c.y /= a;
  3011. this._velocitys.push(c);
  3012. 5 < this._velocitys.length && this._velocitys.shift();
  3013. this._lastTouchPosition.x = e.stageX;
  3014. this._lastTouchPosition.y = e.stageY
  3015. }
  3016. };
  3017. a.prototype._getContentWidth = function() {
  3018. return this._content.explicitWidth || this._content.width
  3019. };
  3020. a.prototype._getContentHeight = function() {
  3021. return this._content.explicitHeight || this._content.height
  3022. };
  3023. a.prototype.getMaxScrollLeft = function() {
  3024. var e = this._getContentWidth() - this.width;
  3025. return Math.max(0, e)
  3026. };
  3027. a.prototype.getMaxScrollTop = function() {
  3028. var e = this._getContentHeight() - this.height;
  3029. return Math.max(0, e)
  3030. };
  3031. a.prototype._moveAfterTouchEnd = function() {
  3032. if (0 != this._velocitys.length) {
  3033. for (var e = 0,
  3034. b = 0,
  3035. c = 0,
  3036. d = 0; d < this._velocitys.length; d++) var g = this._velocitys[d],
  3037. f = a.weight[d],
  3038. e = e + g.x * f,
  3039. b = b + g.y * f,
  3040. c = c + f;
  3041. this._velocitys.length = 0;
  3042. 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
  3043. e = e / c * this.scrollSpeed;
  3044. b = b / c * this.scrollSpeed;
  3045. g = Math.abs(e);
  3046. c = Math.abs(b);
  3047. f = this.getMaxScrollLeft();
  3048. d = this.getMaxScrollTop();
  3049. e = 0.02 < g ? this.getAnimationDatas(e, this._scrollLeft, f) : {
  3050. position: this._scrollLeft,
  3051. duration: 1
  3052. };
  3053. b = 0.02 < c ? this.getAnimationDatas(b, this._scrollTop, d) : {
  3054. position: this._scrollTop,
  3055. duration: 1
  3056. };
  3057. this.setScrollLeft(e.position, e.duration);
  3058. this.setScrollTop(b.position, b.duration)
  3059. }
  3060. };
  3061. a.prototype._onTweenFinished = function(e) {
  3062. e == this._vScrollTween && (this._isVTweenPlaying = !1);
  3063. e == this._hScrollTween && (this._isHTweenPlaying = !1); ! 1 == this._isHTweenPlaying && !1 == this._isVTweenPlaying && this._onScrollFinished()
  3064. };
  3065. a.prototype._onScrollStarted = function() {};
  3066. a.prototype._onScrollFinished = function() {
  3067. b.Tween.removeTweens(this);
  3068. this._vScrollTween = this._hScrollTween = null;
  3069. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  3070. this.dispatchEvent(new b.Event(b.Event.COMPLETE))
  3071. };
  3072. a.prototype.setScrollTop = function(e, a) {
  3073. void 0 === a && (a = 0);
  3074. var c = Math.min(this.getMaxScrollTop(), Math.max(e, 0));
  3075. if (0 == a) return this.scrollTop = c,
  3076. null;
  3077. var d = b.Tween.get(this).to({
  3078. scrollTop: e
  3079. },
  3080. a, b.Ease.quartOut);
  3081. c != e && d.to({
  3082. scrollTop: c
  3083. },
  3084. 300, b.Ease.quintOut);
  3085. this._isVTweenPlaying = !0;
  3086. this._vScrollTween = d;
  3087. d.call(this._onTweenFinished, this, [d]);
  3088. this._isHTweenPlaying || this._onScrollStarted();
  3089. return d
  3090. };
  3091. a.prototype.setScrollLeft = function(e, a) {
  3092. void 0 === a && (a = 0);
  3093. var c = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
  3094. if (0 == a) return this.scrollLeft = c,
  3095. null;
  3096. var d = b.Tween.get(this).to({
  3097. scrollLeft: e
  3098. },
  3099. a, b.Ease.quartOut);
  3100. c != e && d.to({
  3101. scrollLeft: c
  3102. },
  3103. 300, b.Ease.quintOut);
  3104. this._isHTweenPlaying = !0;
  3105. this._hScrollTween = d;
  3106. d.call(this._onTweenFinished, this, [d]);
  3107. this._isVTweenPlaying || this._onScrollStarted();
  3108. return d
  3109. };
  3110. a.prototype.getAnimationDatas = function(e, a, b) {
  3111. var c = Math.abs(e),
  3112. d = 0,
  3113. f = a + 500 * e;
  3114. if (0 > f || f > b) for (f = a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e,
  3115. e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e,
  3116. d++;
  3117. else d = 500 * -Math.log(0.02 / c);
  3118. return {
  3119. position: Math.min(b + 50, Math.max(f, -50)),
  3120. duration: d
  3121. }
  3122. };
  3123. a.prototype.cloneTouchEvent = function(e) {
  3124. var a = new b.TouchEvent(e._type, e._bubbles, e.cancelable);
  3125. a.touchPointID = e.touchPointID;
  3126. a._stageX = e._stageX;
  3127. a._stageY = e._stageY;
  3128. a.ctrlKey = e.ctrlKey;
  3129. a.altKey = e.altKey;
  3130. a.shiftKey = e.shiftKey;
  3131. a.touchDown = e.touchDown;
  3132. a._isDefaultPrevented = !1;
  3133. a._target = e._target;
  3134. return a
  3135. };
  3136. a.prototype.throwNotSupportedError = function() {
  3137. throw Error(b.getString(1023));
  3138. };
  3139. a.prototype.addChild = function(e) {
  3140. this.throwNotSupportedError();
  3141. return null
  3142. };
  3143. a.prototype.addChildAt = function(e, a) {
  3144. this.throwNotSupportedError();
  3145. return null
  3146. };
  3147. a.prototype.removeChild = function(e) {
  3148. this.throwNotSupportedError();
  3149. return null
  3150. };
  3151. a.prototype.removeChildAt = function(e) {
  3152. this.throwNotSupportedError();
  3153. return null
  3154. };
  3155. a.prototype.setChildIndex = function(e, a) {
  3156. this.throwNotSupportedError()
  3157. };
  3158. a.prototype.swapChildren = function(e, a) {
  3159. this.throwNotSupportedError()
  3160. };
  3161. a.prototype.swapChildrenAt = function(e, a) {
  3162. this.throwNotSupportedError()
  3163. };
  3164. a.prototype.hitTest = function(e, a, d) {
  3165. void 0 === d && (d = !1);
  3166. var k = c.prototype.hitTest.call(this, e, a, d);
  3167. return k ? k: b.DisplayObject.prototype.hitTest.call(this, e, a, d)
  3168. };
  3169. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3170. return a
  3171. } (b.DisplayObjectContainer);
  3172. b.ScrollView = d;
  3173. d.prototype.__class__ = "egret.ScrollView"
  3174. })(egret || (egret = {})); (function(b) {
  3175. var d = function() {
  3176. function b() {}
  3177. b.REPEAT = "repeat";
  3178. b.SCALE = "scale";
  3179. return b
  3180. } ();
  3181. b.BitmapFillMode = d;
  3182. d.prototype.__class__ = "egret.BitmapFillMode"
  3183. })(egret || (egret = {}));
  3184. __extends = this.__extends ||
  3185. function(b, d) {
  3186. function c() {
  3187. this.constructor = b
  3188. }
  3189. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3190. c.prototype = d.prototype;
  3191. b.prototype = new c
  3192. }; (function(b) {
  3193. var d = function(c) {
  3194. function a(e) {
  3195. c.call(this);
  3196. this.scale9Grid = this._texture = null;
  3197. this.fillMode = "scale";
  3198. e && (this._texture = e, this._setSizeDirty());
  3199. this.needDraw = !0
  3200. }
  3201. __extends(a, c);
  3202. Object.defineProperty(a.prototype, "texture", {
  3203. get: function() {
  3204. return this._texture
  3205. },
  3206. set: function(e) {
  3207. e != this._texture && (this._setSizeDirty(), this._texture = e)
  3208. },
  3209. enumerable: !0,
  3210. configurable: !0
  3211. });
  3212. a.prototype._render = function(e) {
  3213. var b = this._texture;
  3214. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth: b._textureWidth, this._hasHeightSet ? this._explicitHeight: b._textureHeight, this)) : this._texture_to_render = null
  3215. };
  3216. a._drawBitmap = function(e, b, c, d) {
  3217. var g = d._texture_to_render;
  3218. if (g) {
  3219. var f = g._textureWidth,
  3220. h = g._textureHeight;
  3221. if ("scale" == d.fillMode) {
  3222. var n = d.scale9Grid || g.scale9Grid;
  3223. if (n && f - n.width < b && h - n.height < c) a.drawScale9GridImage(e, d, n, b, c);
  3224. else {
  3225. var n = g._offsetX,
  3226. p = g._offsetY,
  3227. q = g._bitmapWidth || f,
  3228. r = g._bitmapHeight || h;
  3229. b /= f;
  3230. n = Math.round(n * b);
  3231. b = Math.round(q * b);
  3232. c /= h;
  3233. p = Math.round(p * c);
  3234. c = Math.round(r * c);
  3235. a.renderFilter.drawImage(e, d, g._bitmapX, g._bitmapY, q, r, n, p, b, c)
  3236. }
  3237. } else a.drawRepeatImage(e, d, b, c, d.fillMode)
  3238. }
  3239. };
  3240. a.drawRepeatImage = function(e, a, c, d, g) {
  3241. var f = a._texture_to_render;
  3242. if (f) {
  3243. var h = f._textureWidth,
  3244. n = f._textureHeight,
  3245. p = f._bitmapX,
  3246. q = f._bitmapY,
  3247. h = f._bitmapWidth || h,
  3248. n = f._bitmapHeight || n,
  3249. r = f._offsetX,
  3250. f = f._offsetY;
  3251. b.RenderFilter.getInstance().drawImage(e, a, p, q, h, n, r, f, c, d, g)
  3252. }
  3253. };
  3254. a.drawScale9GridImage = function(e, a, c, d, g) {
  3255. var f = b.MainContext.instance.rendererContext._texture_scale_factor,
  3256. h = a._texture_to_render;
  3257. if (h && c) {
  3258. var n = h._textureWidth,
  3259. p = h._textureHeight,
  3260. q = h._bitmapX,
  3261. r = h._bitmapY,
  3262. t = h._bitmapWidth || n,
  3263. s = h._bitmapHeight || p;
  3264. d -= n - t;
  3265. g -= p - s;
  3266. if (!e.drawImageScale9(h, q, r, t, s, h._offsetX, h._offsetY, d, g, c)) {
  3267. n = h._offsetX / f;
  3268. p = h._offsetY / f;
  3269. h = b.RenderFilter.getInstance();
  3270. c = b.Rectangle.identity.initialize(c.x - Math.round(n), c.y - Math.round(n), c.width, c.height);
  3271. n = Math.round(n);
  3272. p = Math.round(p);
  3273. c.y == c.bottom && (c.bottom < s ? c.bottom++:c.y--);
  3274. c.x == c.right && (c.right < t ? c.right++:c.x--);
  3275. var u = q + c.x / f,
  3276. v = q + c.right / f,
  3277. w = t - c.right,
  3278. A = r + c.y / f,
  3279. f = r + c.bottom / f,
  3280. x = s - c.bottom,
  3281. y = n + c.x,
  3282. z = p + c.y,
  3283. s = g - (s - c.bottom),
  3284. t = d - (t - c.right);
  3285. h.drawImage(e, a, q, r, c.x, c.y, n, p, c.x, c.y);
  3286. h.drawImage(e, a, u, r, c.width, c.y, y, p, t - c.x, c.y);
  3287. h.drawImage(e, a, v, r, w, c.y, n + t, p, d - t, c.y);
  3288. h.drawImage(e, a, q, A, c.x, c.height, n, z, c.x, s - c.y);
  3289. h.drawImage(e, a, u, A, c.width, c.height, y, z, t - c.x, s - c.y);
  3290. h.drawImage(e, a, v, A, w, c.height, n + t, z, d - t, s - c.y);
  3291. h.drawImage(e, a, q, f, c.x, x, n, p + s, c.x, g - s);
  3292. h.drawImage(e, a, u, f, c.width, x, y, p + s, t - c.x, g - s);
  3293. h.drawImage(e, a, v, f, w, x, n + t, p + s, d - t, g - s)
  3294. }
  3295. }
  3296. };
  3297. a.prototype._measureBounds = function() {
  3298. var e = this._texture;
  3299. return e ? b.Rectangle.identity.initialize(0, 0, e._textureWidth, e._textureHeight) : c.prototype._measureBounds.call(this)
  3300. };
  3301. a.renderFilter = b.RenderFilter.getInstance();
  3302. return a
  3303. } (b.DisplayObject);
  3304. b.Bitmap = d;
  3305. d.prototype.__class__ = "egret.Bitmap"
  3306. })(egret || (egret = {}));
  3307. __extends = this.__extends ||
  3308. function(b, d) {
  3309. function c() {
  3310. this.constructor = b
  3311. }
  3312. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3313. c.prototype = d.prototype;
  3314. b.prototype = new c
  3315. }; (function(b) {
  3316. var d = function(c) {
  3317. function a() {
  3318. c.call(this);
  3319. this._text = "";
  3320. this._textChanged = !1;
  3321. this._font = null;
  3322. this._fontChanged = !1;
  3323. this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = 0;
  3324. this.textLinesChange = !0;
  3325. this._lineHeights = [];
  3326. this.needDraw = this.cacheAsBitmap = !0
  3327. }
  3328. __extends(a, c);
  3329. Object.defineProperty(a.prototype, "text", {
  3330. get: function() {
  3331. return this._text
  3332. },
  3333. set: function(e) {
  3334. this._text != e && (this._textChanged = !0, this._text = e, this._setSizeDirty())
  3335. },
  3336. enumerable: !0,
  3337. configurable: !0
  3338. });
  3339. Object.defineProperty(a.prototype, "font", {
  3340. get: function() {
  3341. return this._font
  3342. },
  3343. set: function(e) {
  3344. this._font != e && (this._font = e, this._fontChanged = !0, this._setSizeDirty())
  3345. },
  3346. enumerable: !0,
  3347. configurable: !0
  3348. });
  3349. a.prototype._setSizeDirty = function() {
  3350. c.prototype._setSizeDirty.call(this);
  3351. this.textLinesChange = !0
  3352. };
  3353. a.prototype._render = function(e) {
  3354. var c = this._getTextLines(),
  3355. d = c.length;
  3356. if (0 != d) {
  3357. for (var k = this._font,
  3358. g = k._getFirstCharHeight(), g = Math.ceil(g * a.EMPTY_FACTOR), f = 0, h = this._hasHeightSet ? this._explicitHeight: Number.POSITIVE_INFINITY, n = this._lineHeights, p = 0; p < d; p++) {
  3359. var q = n[p];
  3360. if (0 < p && f + q > h) break;
  3361. for (var r = c[p], t = r.length, s = 0, u = 0; u < t; u++) {
  3362. var v = r.charAt(u),
  3363. w = k.getTexture(v);
  3364. if (w) {
  3365. var v = w._bitmapWidth || w._textureWidth,
  3366. A = w._bitmapHeight || w._textureHeight;
  3367. this._texture_to_render = w;
  3368. b.RenderFilter.getInstance().drawImage(e, this, w._bitmapX, w._bitmapY, v, A, s + w._offsetX, f + w._offsetY, v, A);
  3369. s += w._textureWidth
  3370. } else " " == v ? s += g: b.Logger.warningWithErrorId(1011, v)
  3371. }
  3372. f += q
  3373. }
  3374. this._texture_to_render = null
  3375. }
  3376. };
  3377. a.prototype._measureBounds = function() {
  3378. return 0 == this._getTextLines().length ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY)
  3379. };
  3380. a.prototype._getTextLines = function() {
  3381. if (!this.textLinesChange) return this._textLines;
  3382. var e = [];
  3383. this._textLines = e;
  3384. this.textLinesChange = !1;
  3385. var c = [];
  3386. this._lineHeights = c;
  3387. if (!this._text || !this._font) return e;
  3388. for (var d = 0,
  3389. k = 0,
  3390. g = 0,
  3391. f = 0,
  3392. h = this._hasWidthSet,
  3393. n = this._hasWidthSet ? this._explicitWidth: Number.POSITIVE_INFINITY, p = this._font, q = p._getFirstCharHeight(), r = Math.ceil(q * a.EMPTY_FACTOR), t = this._text.split(/(?:\r\n|\r|\n)/), s = t.length, u = !0, v = 0; v < s; v++) {
  3394. for (var w = t[v], A = w.length, x = 0, y = 0, z = !0, B = 0; B < A; B++) {
  3395. var C = w.charAt(B),
  3396. D,
  3397. F = 0,
  3398. G = 0,
  3399. E = p.getTexture(C);
  3400. if (E) C = E._textureWidth,
  3401. D = E._textureHeight,
  3402. F = E._offsetX,
  3403. G = E._offsetY;
  3404. else if (" " == C) C = r,
  3405. D = q;
  3406. else {
  3407. b.Logger.warningWithErrorId(1011, C);
  3408. z && (z = !1);
  3409. continue
  3410. }
  3411. z && (z = !1, g = Math.min(F, g));
  3412. u && (f = Math.min(G, f));
  3413. h && 0 < B && y + C > n ? (e.push(w.substring(0, B)), c.push(x), k += x, d = Math.max(y, d), w = w.substring(B), A = w.length, B = 0, y = C, x = D) : (y += C, x = Math.max(D, x))
  3414. }
  3415. u && (u = !1);
  3416. e.push(w);
  3417. c.push(x);
  3418. k += x;
  3419. d = Math.max(y, d)
  3420. }
  3421. this._textWidth = d;
  3422. this._textHeight = k;
  3423. this._textOffsetX = g;
  3424. this._textOffsetY = f;
  3425. return e
  3426. };
  3427. a.EMPTY_FACTOR = 0.33;
  3428. return a
  3429. } (b.DisplayObject);
  3430. b.BitmapText = d;
  3431. d.prototype.__class__ = "egret.BitmapText"
  3432. })(egret || (egret = {})); (function(b) {
  3433. var d = function() {
  3434. function c() {
  3435. this.fillStyleColor = this.strokeStyleColor = this.renderContext = this.commandQueue = this.canvasContext = null;
  3436. this._dirty = !1;
  3437. this.lineY = this.lineX = 0;
  3438. this._firstCheck = !0;
  3439. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3440. this.commandQueue = []
  3441. }
  3442. c.prototype.beginFill = function(a, e) {};
  3443. c.prototype._setStyle = function(a) {};
  3444. c.prototype.drawRect = function(a, e, b, c) {
  3445. this.checkRect(a, e, b, c)
  3446. };
  3447. c.prototype.drawCircle = function(a, e, b) {
  3448. this.checkRect(a - b, e - b, 2 * b, 2 * b)
  3449. };
  3450. c.prototype.drawRoundRect = function(a, e, b, c, d, g) {
  3451. this.checkRect(a, e, b, c)
  3452. };
  3453. c.prototype.drawEllipse = function(a, e, b, c) {
  3454. this.checkRect(a - b, e - c, 2 * b, 2 * c)
  3455. };
  3456. c.prototype.lineStyle = function(a, e, b, c, d, g, f, h) {};
  3457. c.prototype.lineTo = function(a, e) {
  3458. this.checkPoint(a, e)
  3459. };
  3460. c.prototype.curveTo = function(a, e, b, c) {
  3461. this.checkPoint(a, e);
  3462. this.checkPoint(b, c)
  3463. };
  3464. c.prototype.moveTo = function(a, e) {
  3465. this.checkPoint(a, e)
  3466. };
  3467. c.prototype.clear = function() {
  3468. this._maxY = this._maxX = this._minY = this._minX = 0;
  3469. this._firstCheck = !0
  3470. };
  3471. c.prototype.endFill = function() {};
  3472. c.prototype._draw = function(a) {};
  3473. c.prototype.checkRect = function(a, e, b, c) {
  3474. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = e, this._maxX = a + b, this._maxY = e + c) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, e), this._maxX = Math.max(this._maxX, a + b), this._maxY = Math.max(this._maxY, e + c))
  3475. };
  3476. c.prototype.checkPoint = function(a, e) {
  3477. this._firstCheck ? (this._firstCheck = !1, this._minX = a, this._minY = e, this._maxX = a, this._maxY = e) : (this._minX = Math.min(this._minX, a), this._minY = Math.min(this._minY, e), this._maxX = Math.max(this._maxX, a), this._maxY = Math.max(this._maxY, e));
  3478. this._lastX = a;
  3479. this._lastY = e
  3480. };
  3481. c.prototype._measureBounds = function() {
  3482. return b.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
  3483. };
  3484. return c
  3485. } ();
  3486. b.Graphics = d;
  3487. d.prototype.__class__ = "egret.Graphics"; (function() {
  3488. return function(b, a, e) {
  3489. this.method = b;
  3490. this.thisObject = a;
  3491. this.args = e
  3492. }
  3493. })().prototype.__class__ = "egret.Command"
  3494. })(egret || (egret = {}));
  3495. __extends = this.__extends ||
  3496. function(b, d) {
  3497. function c() {
  3498. this.constructor = b
  3499. }
  3500. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3501. c.prototype = d.prototype;
  3502. b.prototype = new c
  3503. }; (function(b) {
  3504. var d = function(c) {
  3505. function a() {
  3506. c.call(this);
  3507. this._graphics = null
  3508. }
  3509. __extends(a, c);
  3510. Object.defineProperty(a.prototype, "graphics", {
  3511. get: function() {
  3512. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3513. return this._graphics
  3514. },
  3515. enumerable: !0,
  3516. configurable: !0
  3517. });
  3518. a.prototype._render = function(e) {
  3519. this._graphics && this._graphics._draw(e)
  3520. };
  3521. a.prototype._measureBounds = function() {
  3522. var e = this._graphics;
  3523. return e ? e._measureBounds() : c.prototype._measureBounds.call(this)
  3524. };
  3525. return a
  3526. } (b.DisplayObject);
  3527. b.Shape = d;
  3528. d.prototype.__class__ = "egret.Shape"
  3529. })(egret || (egret = {}));
  3530. __extends = this.__extends ||
  3531. function(b, d) {
  3532. function c() {
  3533. this.constructor = b
  3534. }
  3535. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3536. c.prototype = d.prototype;
  3537. b.prototype = new c
  3538. }; (function(b) {
  3539. var d = function(c) {
  3540. function a() {
  3541. c.call(this);
  3542. this._graphics = null
  3543. }
  3544. __extends(a, c);
  3545. Object.defineProperty(a.prototype, "graphics", {
  3546. get: function() {
  3547. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3548. return this._graphics
  3549. },
  3550. enumerable: !0,
  3551. configurable: !0
  3552. });
  3553. a.prototype._render = function(e) {
  3554. this._graphics && this._graphics._draw(e);
  3555. c.prototype._render.call(this, e)
  3556. };
  3557. a.prototype._measureBounds = function() {
  3558. for (var e = 0,
  3559. a = 0,
  3560. c = 0,
  3561. d = 0,
  3562. g = this._children.length,
  3563. f = 0; f < g; f++) {
  3564. var h = this._children[f];
  3565. if (h._visible) {
  3566. var n = h.getBounds(b.Rectangle.identity, !1),
  3567. p = n.x,
  3568. q = n.y,
  3569. r = n.width,
  3570. n = n.height,
  3571. h = h._getMatrix(),
  3572. h = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p, q, r, n), h),
  3573. p = h.x,
  3574. q = h.y,
  3575. r = h.width + h.x,
  3576. h = h.height + h.y;
  3577. if (p < e || 0 == f) e = p;
  3578. if (r > a || 0 == f) a = r;
  3579. if (q < c || 0 == f) c = q;
  3580. if (h > d || 0 == f) d = h
  3581. }
  3582. }
  3583. if (this._graphics) {
  3584. g = this._graphics._measureBounds();
  3585. p = g.x;
  3586. q = g.y;
  3587. r = g.width + g.x;
  3588. h = g.height + g.y;
  3589. if (p < e || 0 == f) e = p;
  3590. if (r > a || 0 == f) a = r;
  3591. if (q < c || 0 == f) c = q;
  3592. if (h > d || 0 == f) d = h
  3593. }
  3594. return b.Rectangle.identity.initialize(e, c, a - e, d - c)
  3595. };
  3596. a.prototype.hitTest = function(e, a, d) {
  3597. void 0 === d && (d = !1);
  3598. var k = c.prototype.hitTest.call(this, e, a, d);
  3599. return k ? k: this._graphics ? b.DisplayObject.prototype.hitTest.call(this, e, a, d) : null
  3600. };
  3601. return a
  3602. } (b.DisplayObjectContainer);
  3603. b.Sprite = d;
  3604. d.prototype.__class__ = "egret.Sprite"
  3605. })(egret || (egret = {}));
  3606. __extends = this.__extends ||
  3607. function(b, d) {
  3608. function c() {
  3609. this.constructor = b
  3610. }
  3611. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  3612. c.prototype = d.prototype;
  3613. b.prototype = new c
  3614. }; (function(b) {
  3615. var d = function(c) {
  3616. function a() {
  3617. c.call(this);
  3618. this._inputEnabled = !1;
  3619. this._type = "";
  3620. this._inputUtils = null;
  3621. this._text = "";
  3622. this._displayAsPassword = !1;
  3623. this._fontFamily = a.default_fontFamily;
  3624. this._size = 30;
  3625. this._bold = this._italic = !1;
  3626. this._textColorString = "#FFFFFF";
  3627. this._textColor = 16777215;
  3628. this._strokeColorString = "#000000";
  3629. this._stroke = this._strokeColor = 0;
  3630. this._textAlign = "left";
  3631. this._verticalAlign = "top";
  3632. this._maxChars = 0;
  3633. this._scrollV = -1;
  3634. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3635. this._isFlow = this._multiline = !1;
  3636. this._textArr = [];
  3637. this._isArrayChanged = !1;
  3638. this._textMaxHeight = this._textMaxWidth = 0;
  3639. this._linesArr = [];
  3640. this.needDraw = !0
  3641. }
  3642. __extends(a, c);
  3643. a.prototype.isInput = function() {
  3644. return this._type == b.TextFieldType.INPUT
  3645. };
  3646. a.prototype._setTouchEnabled = function(e) {
  3647. c.prototype._setTouchEnabled.call(this, e);
  3648. this.isInput() && (this._inputEnabled = !0)
  3649. };
  3650. Object.defineProperty(a.prototype, "type", {
  3651. get: function() {
  3652. return this._type
  3653. },
  3654. set: function(e) {
  3655. this._setType(e)
  3656. },
  3657. enumerable: !0,
  3658. configurable: !0
  3659. });
  3660. a.prototype._setType = function(e) {
  3661. this._type != e && (this._type = e, this._type == b.TextFieldType.INPUT ? (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3662. };
  3663. Object.defineProperty(a.prototype, "text", {
  3664. get: function() {
  3665. return this._getText()
  3666. },
  3667. set: function(e) {
  3668. this._setText(e)
  3669. },
  3670. enumerable: !0,
  3671. configurable: !0
  3672. });
  3673. a.prototype._getText = function() {
  3674. return this._type == b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3675. };
  3676. a.prototype._setSizeDirty = function() {
  3677. c.prototype._setSizeDirty.call(this);
  3678. this._isArrayChanged = !0
  3679. };
  3680. a.prototype._setTextDirty = function() {
  3681. this._setSizeDirty()
  3682. };
  3683. a.prototype._setBaseText = function(e) {
  3684. null == e && (e = "");
  3685. this._isFlow = !1;
  3686. this._text != e && (this._setTextDirty(), this._text = e, e = "", e = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3687. text: e
  3688. }]))
  3689. };
  3690. a.prototype._setText = function(e) {
  3691. null == e && (e = "");
  3692. this._setBaseText(e);
  3693. this._inputUtils && this._inputUtils._setText(this._text)
  3694. };
  3695. Object.defineProperty(a.prototype, "displayAsPassword", {
  3696. get: function() {
  3697. return this._displayAsPassword
  3698. },
  3699. set: function(e) {
  3700. this._setDisplayAsPassword(e)
  3701. },
  3702. enumerable: !0,
  3703. configurable: !0
  3704. });
  3705. a.prototype._setDisplayAsPassword = function(e) {
  3706. this._displayAsPassword != e && (this._displayAsPassword = e, this._setTextDirty(), e = "", e = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3707. text: e
  3708. }]))
  3709. };
  3710. Object.defineProperty(a.prototype, "fontFamily", {
  3711. get: function() {
  3712. return this._fontFamily
  3713. },
  3714. set: function(e) {
  3715. this._setFontFamily(e)
  3716. },
  3717. enumerable: !0,
  3718. configurable: !0
  3719. });
  3720. a.prototype._setFontFamily = function(e) {
  3721. this._fontFamily != e && (this._setTextDirty(), this._fontFamily = e)
  3722. };
  3723. Object.defineProperty(a.prototype, "size", {
  3724. get: function() {
  3725. return this._size
  3726. },
  3727. set: function(e) {
  3728. this._setSize(e)
  3729. },
  3730. enumerable: !0,
  3731. configurable: !0
  3732. });
  3733. a.prototype._setSize = function(e) {
  3734. this._size != e && (this._setTextDirty(), this._size = e)
  3735. };
  3736. Object.defineProperty(a.prototype, "italic", {
  3737. get: function() {
  3738. return this._italic
  3739. },
  3740. set: function(e) {
  3741. this._setItalic(e)
  3742. },
  3743. enumerable: !0,
  3744. configurable: !0
  3745. });
  3746. a.prototype._setItalic = function(e) {
  3747. this._italic != e && (this._setTextDirty(), this._italic = e)
  3748. };
  3749. Object.defineProperty(a.prototype, "bold", {
  3750. get: function() {
  3751. return this._bold
  3752. },
  3753. set: function(e) {
  3754. this._setBold(e)
  3755. },
  3756. enumerable: !0,
  3757. configurable: !0
  3758. });
  3759. a.prototype._setBold = function(e) {
  3760. this._bold != e && (this._setTextDirty(), this._bold = e)
  3761. };
  3762. Object.defineProperty(a.prototype, "textColor", {
  3763. get: function() {
  3764. return this._textColor
  3765. },
  3766. set: function(e) {
  3767. this._setTextColor(e)
  3768. },
  3769. enumerable: !0,
  3770. configurable: !0
  3771. });
  3772. a.prototype._setTextColor = function(e) {
  3773. this._textColor != e && (this._setTextDirty(), this._textColor = e, this._textColorString = b.toColorString(e))
  3774. };
  3775. Object.defineProperty(a.prototype, "strokeColor", {
  3776. get: function() {
  3777. return this._strokeColor
  3778. },
  3779. set: function(e) {
  3780. this._setStrokeColor(e)
  3781. },
  3782. enumerable: !0,
  3783. configurable: !0
  3784. });
  3785. a.prototype._setStrokeColor = function(e) {
  3786. this._strokeColor != e && (this._setTextDirty(), this._strokeColor = e, this._strokeColorString = b.toColorString(e))
  3787. };
  3788. Object.defineProperty(a.prototype, "stroke", {
  3789. get: function() {
  3790. return this._stroke
  3791. },
  3792. set: function(e) {
  3793. this._setStroke(e)
  3794. },
  3795. enumerable: !0,
  3796. configurable: !0
  3797. });
  3798. a.prototype._setStroke = function(e) {
  3799. this._stroke != e && (this._setTextDirty(), this._stroke = e)
  3800. };
  3801. Object.defineProperty(a.prototype, "textAlign", {
  3802. get: function() {
  3803. return this._textAlign
  3804. },
  3805. set: function(e) {
  3806. this._setTextAlign(e)
  3807. },
  3808. enumerable: !0,
  3809. configurable: !0
  3810. });
  3811. a.prototype._setTextAlign = function(e) {
  3812. this._textAlign != e && (this._setTextDirty(), this._textAlign = e)
  3813. };
  3814. Object.defineProperty(a.prototype, "verticalAlign", {
  3815. get: function() {
  3816. return this._verticalAlign
  3817. },
  3818. set: function(e) {
  3819. this._setVerticalAlign(e)
  3820. },
  3821. enumerable: !0,
  3822. configurable: !0
  3823. });
  3824. a.prototype._setVerticalAlign = function(e) {
  3825. this._verticalAlign != e && (this._setTextDirty(), this._verticalAlign = e)
  3826. };
  3827. Object.defineProperty(a.prototype, "maxChars", {
  3828. get: function() {
  3829. return this._maxChars
  3830. },
  3831. set: function(e) {
  3832. this._setMaxChars(e)
  3833. },
  3834. enumerable: !0,
  3835. configurable: !0
  3836. });
  3837. a.prototype._setMaxChars = function(e) {
  3838. this._maxChars != e && (this._maxChars = e)
  3839. };
  3840. Object.defineProperty(a.prototype, "scrollV", {
  3841. set: function(e) {
  3842. this._scrollV = e;
  3843. this._setDirty()
  3844. },
  3845. enumerable: !0,
  3846. configurable: !0
  3847. });
  3848. Object.defineProperty(a.prototype, "maxScrollV", {
  3849. get: function() {
  3850. return this._maxScrollV
  3851. },
  3852. enumerable: !0,
  3853. configurable: !0
  3854. });
  3855. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3856. get: function() {
  3857. return 0
  3858. },
  3859. enumerable: !0,
  3860. configurable: !0
  3861. });
  3862. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3863. get: function() {
  3864. return 0
  3865. },
  3866. enumerable: !0,
  3867. configurable: !0
  3868. });
  3869. Object.defineProperty(a.prototype, "caretIndex", {
  3870. get: function() {
  3871. return 0
  3872. },
  3873. enumerable: !0,
  3874. configurable: !0
  3875. });
  3876. a.prototype._setSelection = function(e, a) {};
  3877. Object.defineProperty(a.prototype, "lineSpacing", {
  3878. get: function() {
  3879. return this._lineSpacing
  3880. },
  3881. set: function(e) {
  3882. this._setLineSpacing(e)
  3883. },
  3884. enumerable: !0,
  3885. configurable: !0
  3886. });
  3887. a.prototype._setLineSpacing = function(e) {
  3888. this._lineSpacing != e && (this._setTextDirty(), this._lineSpacing = e)
  3889. };
  3890. a.prototype._getLineHeight = function() {
  3891. return this._lineSpacing + this._size
  3892. };
  3893. Object.defineProperty(a.prototype, "numLines", {
  3894. get: function() {
  3895. return this._numLines
  3896. },
  3897. enumerable: !0,
  3898. configurable: !0
  3899. });
  3900. Object.defineProperty(a.prototype, "multiline", {
  3901. get: function() {
  3902. return this._multiline
  3903. },
  3904. set: function(e) {
  3905. this._setMultiline(e)
  3906. },
  3907. enumerable: !0,
  3908. configurable: !0
  3909. });
  3910. a.prototype._setMultiline = function(e) {
  3911. this._multiline = e;
  3912. this._setDirty()
  3913. };
  3914. a.prototype.setFocus = function() {
  3915. b.Logger.warningWithErrorId(1013)
  3916. };
  3917. a.prototype._onRemoveFromStage = function() {
  3918. c.prototype._onRemoveFromStage.call(this);
  3919. this._removeEvent();
  3920. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3921. };
  3922. a.prototype._onAddToStage = function() {
  3923. c.prototype._onAddToStage.call(this);
  3924. this._addEvent();
  3925. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3926. };
  3927. a.prototype._updateBaseTransform = function() {
  3928. this._getLinesArr();
  3929. 0 != this._textMaxWidth && c.prototype._updateTransform.call(this)
  3930. };
  3931. a.prototype._updateTransform = function() {
  3932. this._type == b.TextFieldType.INPUT ? this._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3933. };
  3934. a.prototype._draw = function(e) {
  3935. 0 != this._textMaxWidth && c.prototype._draw.call(this, e)
  3936. };
  3937. a.prototype._render = function(e) {
  3938. this.drawText(e);
  3939. this._clearDirty()
  3940. };
  3941. a.prototype._measureBounds = function() {
  3942. this._getLinesArr();
  3943. return 0 == this._textMaxWidth ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(0, 0, this._textMaxWidth, this._textMaxHeight + (this._numLines - 1) * this._lineSpacing)
  3944. };
  3945. Object.defineProperty(a.prototype, "textFlow", {
  3946. get: function() {
  3947. return this._textArr
  3948. },
  3949. set: function(e) {
  3950. this._isFlow = !0;
  3951. var a = "";
  3952. null == e && (e = []);
  3953. for (var b = 0; b < e.length; b++) a += e[b].text;
  3954. this._displayAsPassword ? this._setBaseText(a) : (this._text = a, this.setMiddleStyle(e))
  3955. },
  3956. enumerable: !0,
  3957. configurable: !0
  3958. });
  3959. a.prototype.changeToPassText = function(e) {
  3960. if (this._displayAsPassword) {
  3961. for (var a = "",
  3962. b = 0,
  3963. c = e.length; b < c; b++) switch (e.charAt(b)) {
  3964. case "\n":
  3965. a += "\n";
  3966. break;
  3967. case "\r":
  3968. break;
  3969. default:
  3970. a += "*"
  3971. }
  3972. return a
  3973. }
  3974. return e
  3975. };
  3976. a.prototype.setMiddleStyle = function(e) {
  3977. this._isArrayChanged = !0;
  3978. this._textArr = e;
  3979. this._setSizeDirty()
  3980. };
  3981. Object.defineProperty(a.prototype, "textWidth", {
  3982. get: function() {
  3983. return this._textMaxWidth
  3984. },
  3985. enumerable: !0,
  3986. configurable: !0
  3987. });
  3988. Object.defineProperty(a.prototype, "textHeight", {
  3989. get: function() {
  3990. return this._textMaxHeight
  3991. },
  3992. enumerable: !0,
  3993. configurable: !0
  3994. });
  3995. a.prototype.appendText = function(e) {
  3996. this.appendElement({
  3997. text: e
  3998. })
  3999. };
  4000. a.prototype.appendElement = function(e) {
  4001. this._textArr.push(e);
  4002. this.setMiddleStyle(this._textArr)
  4003. };
  4004. a.prototype._getLinesArr = function() {
  4005. if (!this._isArrayChanged) return this._linesArr;
  4006. this._isArrayChanged = !1;
  4007. var e = this._textArr,
  4008. a = b.MainContext.instance.rendererContext;
  4009. this._linesArr = [];
  4010. this._textMaxWidth = this._textMaxHeight = 0;
  4011. if (this._hasWidthSet && 0 == this._explicitWidth) return this._numLines = 0,
  4012. [{
  4013. width: 0,
  4014. height: 0,
  4015. elements: []
  4016. }];
  4017. var c = this._linesArr,
  4018. d = 0,
  4019. g = 0,
  4020. f = 0,
  4021. h;
  4022. this._isFlow || a.setupFont(this);
  4023. for (var n = 0,
  4024. p = e.length; n < p; n++) {
  4025. var q = e[n];
  4026. q.style = q.style || {};
  4027. for (var r = q.text.toString().split(/(?:\r\n|\r|\n)/), t = 0, s = r.length; t < s; t++) {
  4028. null == c[f] && (h = {
  4029. width: 0,
  4030. height: 0,
  4031. elements: []
  4032. },
  4033. c[f] = h, g = d = 0);
  4034. g = this._type == b.TextFieldType.INPUT ? this._size: Math.max(g, q.style.size || this._size);
  4035. if ("" != r[t]) {
  4036. this._isFlow && a.setupFont(this, q.style);
  4037. var u = a.measureText(r[t]);
  4038. if (this._hasWidthSet) if (d + u <= this._explicitWidth) h.elements.push({
  4039. width: u,
  4040. text: r[t],
  4041. style: q.style
  4042. }),
  4043. d += u;
  4044. else {
  4045. for (var v = 0,
  4046. w = 0,
  4047. A = r[t], x = A.length; v < x; v++) {
  4048. u = a.measureText(A.charAt(v));
  4049. if (d + u > this._explicitWidth && 0 != d + v) break;
  4050. w += u;
  4051. d += u
  4052. }
  4053. 0 < v && (h.elements.push({
  4054. width: w,
  4055. text: A.substring(0, v),
  4056. style: q.style
  4057. }), r[t] = A.substring(v));
  4058. t--
  4059. } else d += u,
  4060. h.elements.push({
  4061. width: u,
  4062. text: r[t],
  4063. style: q.style
  4064. })
  4065. }
  4066. if (t < r.length - 1) {
  4067. h.width = d;
  4068. h.height = g;
  4069. this._textMaxWidth = Math.max(this._textMaxWidth, d);
  4070. this._textMaxHeight += g;
  4071. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = c.length,
  4072. c;
  4073. f++
  4074. }
  4075. }
  4076. n == e.length - 1 && h && (h.width = d, h.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, d), this._textMaxHeight += g)
  4077. }
  4078. this._numLines = c.length;
  4079. return c
  4080. };
  4081. a.prototype.drawText = function(a) {
  4082. var c = this._getLinesArr();
  4083. if (0 != this._textMaxWidth) {
  4084. var d = this._hasWidthSet ? this._explicitWidth: this._textMaxWidth,
  4085. k = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  4086. g = 0,
  4087. f = 0;
  4088. if (this._hasHeightSet) if (k < this._explicitHeight) {
  4089. var h = 0;
  4090. this._verticalAlign == b.VerticalAlign.MIDDLE ? h = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (h = 1);
  4091. g += h * (this._explicitHeight - k)
  4092. } else k > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  4093. g = Math.round(g);
  4094. k = 0;
  4095. this._textAlign == b.HorizontalAlign.CENTER ? k = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (k = 1);
  4096. for (var h = 0,
  4097. n = this._numLines; f < n; f++) {
  4098. var p = c[f],
  4099. q = p.height,
  4100. g = g + q / 2;
  4101. if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
  4102. for (var h = Math.round((d - p.width) * k), r = 0, t = p.elements.length; r < t; r++) {
  4103. var s = p.elements[r],
  4104. u = s.style.size || this._size;
  4105. this._type == b.TextFieldType.INPUT ? a.drawText(this, s.text, h, g + (q - u) / 2, s.width) : a.drawText(this, s.text, h, g + (q - u) / 2, s.width, s.style);
  4106. h += s.width
  4107. }
  4108. g += q / 2 + this._lineSpacing
  4109. }
  4110. }
  4111. };
  4112. a.prototype._addEvent = function() {
  4113. this.addEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4114. };
  4115. a.prototype._removeEvent = function() {
  4116. this.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onTapHandler, this)
  4117. };
  4118. a.prototype.onTapHandler = function(a) {
  4119. if (this._type != b.TextFieldType.INPUT && (a = this._getTextElement(a.localX, a.localY), null != a && (a = a.style) && a.href && a.href.match(/^event:/))) {
  4120. var c = a.href.match(/^event:/)[0];
  4121. b.TextEvent.dispatchTextEvent(this, b.TextEvent.LINK, a.href.substring(c.length))
  4122. }
  4123. };
  4124. a.prototype._getTextElement = function(a, b) {
  4125. var c = this._getHit(a, b),
  4126. d = this._getLinesArr();
  4127. return c && d[c.lineIndex] && d[c.lineIndex].elements[c.textElementIndex] ? d[c.lineIndex].elements[c.textElementIndex] : null
  4128. };
  4129. a.prototype._getHit = function(a, b) {
  4130. var c = this._getLinesArr();
  4131. if (0 == this._textMaxWidth) return null;
  4132. for (var d = 0,
  4133. g = 0,
  4134. f = 0; f < c.length; f++) {
  4135. var h = c[f];
  4136. if (g + h.height >= b) {
  4137. d = f + 1;
  4138. break
  4139. } else g += h.height;
  4140. if (g + this._lineSpacing > b) return null;
  4141. g += this._lineSpacing
  4142. }
  4143. if (0 === d) return null;
  4144. c = c[d - 1];
  4145. for (f = g = 0; f < c.elements.length; f++) if (h = c.elements[f], g + h.width < a) g += h.width;
  4146. else return {
  4147. lineIndex: d - 1,
  4148. textElementIndex: f
  4149. };
  4150. return null
  4151. };
  4152. a.default_fontFamily = "Arial";
  4153. return a
  4154. } (b.DisplayObject);
  4155. b.TextField = d;
  4156. d.prototype.__class__ = "egret.TextField"
  4157. })(egret || (egret = {})); (function(b) {
  4158. var d = function() {
  4159. function b() {
  4160. this.resutlArr = []
  4161. }
  4162. b.prototype.parser = function(a) {
  4163. this.stackArray = [];
  4164. this.resutlArr = [];
  4165. for (var e = 0,
  4166. b = a.length; e < b;) {
  4167. var c = a.indexOf("<", e);
  4168. 0 > c ? (this.addToResultArr(a.substring(e)), e = b) : (this.addToResultArr(a.substring(e, c)), e = a.indexOf(">", c), "/" == a.charAt(c + 1) ? this.stackArray.pop() : this.addToArray(a.substring(c + 1, e)), e += 1)
  4169. }
  4170. return this.resutlArr
  4171. };
  4172. b.prototype.addToResultArr = function(a) {
  4173. if ("" != a) {
  4174. var e = [];
  4175. e.push(["&lt;", "<"]);
  4176. e.push(["&gt;", ">"]);
  4177. e.push(["&amp;", "&"]);
  4178. e.push(["&quot;", '"']);
  4179. e.push(["&apos;;", "'"]);
  4180. for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
  4181. 0 < this.stackArray.length ? this.resutlArr.push({
  4182. text: a,
  4183. style: this.stackArray[this.stackArray.length - 1]
  4184. }) : this.resutlArr.push({
  4185. text: a
  4186. })
  4187. }
  4188. };
  4189. b.prototype.changeStringToObject = function(a) {
  4190. var e = {};
  4191. a = a.replace(/( )+/g, " ").split(" ");
  4192. for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
  4193. return e
  4194. };
  4195. b.prototype.addProperty = function(a, e) {
  4196. var b = e.replace(/( )*=( )*/g, "=").split("=");
  4197. b[1] && (b[1] = b[1].replace(/(\"|\')/g, ""));
  4198. switch (b[0].toLowerCase()) {
  4199. case "color":
  4200. a.textColor = parseInt(b[1]);
  4201. break;
  4202. case "strokecolor":
  4203. a.strokeColor = parseInt(b[1]);
  4204. break;
  4205. case "stroke":
  4206. a.stroke = parseInt(b[1]);
  4207. break;
  4208. case "b":
  4209. a.bold = "true" == (b[1] || "true");
  4210. break;
  4211. case "i":
  4212. a.italic = "true" == (b[1] || "true");
  4213. break;
  4214. case "size":
  4215. a.size = parseInt(b[1]);
  4216. break;
  4217. case "fontFamily":
  4218. a.fontFamily = b[1];
  4219. break;
  4220. case "href":
  4221. a.href = b[1]
  4222. }
  4223. };
  4224. b.prototype.addToArray = function(a) {
  4225. a = this.changeStringToObject(a);
  4226. if (0 != this.stackArray.length) {
  4227. var e = this.stackArray[this.stackArray.length - 1],
  4228. b;
  4229. for (b in e) null == a[b] && (a[b] = e[b])
  4230. }
  4231. this.stackArray.push(a)
  4232. };
  4233. return b
  4234. } ();
  4235. b.HtmlTextParser = d;
  4236. d.prototype.__class__ = "egret.HtmlTextParser"
  4237. })(egret || (egret = {})); (function(b) {
  4238. var d = function() {
  4239. function b() {}
  4240. b.DYNAMIC = "dynamic";
  4241. b.INPUT = "input";
  4242. return b
  4243. } ();
  4244. b.TextFieldType = d;
  4245. d.prototype.__class__ = "egret.TextFieldType"
  4246. })(egret || (egret = {}));
  4247. __extends = this.__extends ||
  4248. function(b, d) {
  4249. function c() {
  4250. this.constructor = b
  4251. }
  4252. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4253. c.prototype = d.prototype;
  4254. b.prototype = new c
  4255. }; (function(b) {
  4256. var d = function(c) {
  4257. function a(a) {
  4258. c.call(this);
  4259. this.bitmapData = this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
  4260. this._textureMap = {};
  4261. var b = a.bitmapData;
  4262. this.bitmapData = b;
  4263. this._sourceWidth = b.width;
  4264. this._sourceHeight = b.height;
  4265. this._bitmapX = a._bitmapX - a._offsetX;
  4266. this._bitmapY = a._bitmapY - a._offsetY
  4267. }
  4268. __extends(a, c);
  4269. a.prototype.getTexture = function(a) {
  4270. return this._textureMap[a]
  4271. };
  4272. a.prototype.createTexture = function(a, c, d, k, g, f, h, n, p) {
  4273. void 0 === f && (f = 0);
  4274. void 0 === h && (h = 0);
  4275. "undefined" === typeof n && (n = f + k);
  4276. "undefined" === typeof p && (p = h + g);
  4277. var q = new b.Texture,
  4278. r = b.MainContext.instance.rendererContext._texture_scale_factor;
  4279. q._bitmapData = this.bitmapData;
  4280. q._bitmapX = this._bitmapX + c;
  4281. q._bitmapY = this._bitmapY + d;
  4282. q._bitmapWidth = k * r;
  4283. q._bitmapHeight = g * r;
  4284. q._offsetX = f;
  4285. q._offsetY = h;
  4286. q._textureWidth = n * r;
  4287. q._textureHeight = p * r;
  4288. q._sourceWidth = this._sourceWidth;
  4289. q._sourceHeight = this._sourceHeight;
  4290. return this._textureMap[a] = q
  4291. };
  4292. return a
  4293. } (b.HashObject);
  4294. b.SpriteSheet = d;
  4295. d.prototype.__class__ = "egret.SpriteSheet"
  4296. })(egret || (egret = {}));
  4297. __extends = this.__extends ||
  4298. function(b, d) {
  4299. function c() {
  4300. this.constructor = b
  4301. }
  4302. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4303. c.prototype = d.prototype;
  4304. b.prototype = new c
  4305. }; (function(b) {
  4306. var d = function(c) {
  4307. function a() {
  4308. c.call(this);
  4309. this._isFocus = !1;
  4310. this._text = null;
  4311. this._isFirst = this._isFirst = !0
  4312. }
  4313. __extends(a, c);
  4314. a.prototype.init = function(a) {
  4315. this._text = a;
  4316. this.stageText = b.StageText.create();
  4317. a = this._text.localToGlobal();
  4318. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  4319. };
  4320. a.prototype._addStageText = function() {
  4321. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4322. this.stageText._add();
  4323. this.stageText._addListeners();
  4324. this.stageText.addEventListener("blur", this.onBlurHandler, this);
  4325. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4326. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4327. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4328. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4329. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)
  4330. };
  4331. a.prototype._removeStageText = function() {
  4332. this.stageText._remove();
  4333. this.stageText._removeListeners();
  4334. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4335. this.stageText.removeEventListener("blur", this.onBlurHandler, this);
  4336. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4337. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4338. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4339. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4340. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this)
  4341. };
  4342. a.prototype.onResize = function() {
  4343. this._isFirst = !0
  4344. };
  4345. a.prototype._getText = function() {
  4346. return this.stageText._getText()
  4347. };
  4348. a.prototype._setText = function(a) {
  4349. this.stageText._setText(a)
  4350. };
  4351. a.prototype.onFocusHandler = function(a) {
  4352. this.hideText()
  4353. };
  4354. a.prototype.onBlurHandler = function(a) {
  4355. this.showText()
  4356. };
  4357. a.prototype.onMouseDownHandler = function(a) {
  4358. a.stopPropagation();
  4359. this._text._visible && (this._isFirst = !0, this._updateTransform(), this.stageText._show())
  4360. };
  4361. a.prototype.onStageDownHandler = function(a) {
  4362. this.stageText._hide();
  4363. this.showText()
  4364. };
  4365. a.prototype.showText = function() {
  4366. this._isFocus && (this._isFocus = !1, this.resetText())
  4367. };
  4368. a.prototype.hideText = function() {
  4369. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4370. };
  4371. a.prototype.updateTextHandler = function(a) {
  4372. this.resetText();
  4373. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4374. };
  4375. a.prototype.resetText = function() {
  4376. this._text._setBaseText(this.stageText._getText())
  4377. };
  4378. a.prototype._updateTransform = function() {
  4379. var a = this._text._worldTransform.a,
  4380. c = this._text._worldTransform.b,
  4381. d = this._text._worldTransform.c,
  4382. k = this._text._worldTransform.d,
  4383. g = this._text._worldTransform.tx,
  4384. f = this._text._worldTransform.ty;
  4385. this._text._updateBaseTransform();
  4386. var h = this._text._worldTransform;
  4387. if (this._isFirst || a != h.a || c != h.b || d != h.c || k != h.d || g != h.tx || f != h.ty) {
  4388. this._isFirst = !1;
  4389. a = this._text.localToGlobal();
  4390. this.stageText.changePosition(a.x, a.y);
  4391. var n = this;
  4392. b.callLater(function() {
  4393. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  4394. },
  4395. this)
  4396. }
  4397. };
  4398. a.prototype._updateProperties = function() {
  4399. var a = this._text._stage;
  4400. if (null == a) this.stageText._setVisible(!1);
  4401. else {
  4402. for (var c = this._text,
  4403. d = c._visible; d;) {
  4404. c = c.parent;
  4405. if (c == a) break;
  4406. d = c._visible
  4407. }
  4408. this.stageText._setVisible(d)
  4409. }
  4410. this.stageText._setMultiline(this._text._multiline);
  4411. this.stageText._setMaxChars(this._text._maxChars);
  4412. this.stageText._setSize(this._text._size);
  4413. this.stageText._setTextColor(this._text._textColorString);
  4414. this.stageText._setTextFontFamily(this._text._fontFamily);
  4415. this.stageText._setBold(this._text._bold);
  4416. this.stageText._setItalic(this._text._italic);
  4417. this.stageText._setTextAlign(this._text._textAlign);
  4418. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4419. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4420. this.stageText._setTextType(this._text._displayAsPassword ? "password": "text");
  4421. this.stageText._setText(this._text._text);
  4422. this.stageText._resetStageText();
  4423. this._updateTransform()
  4424. };
  4425. return a
  4426. } (b.HashObject);
  4427. b.InputController = d;
  4428. d.prototype.__class__ = "egret.InputController"
  4429. })(egret || (egret = {}));
  4430. __extends = this.__extends ||
  4431. function(b, d) {
  4432. function c() {
  4433. this.constructor = b
  4434. }
  4435. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4436. c.prototype = d.prototype;
  4437. b.prototype = new c
  4438. }; (function(b) {
  4439. var d = function(b) {
  4440. function a(a, d) {
  4441. b.call(this, a);
  4442. this.firstCharHeight = 0;
  4443. "string" == typeof d ? this.charList = this.parseConfig(d) : d && d.hasOwnProperty("frames") ? this.charList = d.frames: this.charList = {}
  4444. }
  4445. __extends(a, b);
  4446. a.prototype.getTexture = function(a) {
  4447. var b = this._textureMap[a];
  4448. if (!b) {
  4449. b = this.charList[a];
  4450. if (!b) return null;
  4451. b = this.createTexture(a, b.x, b.y, b.w, b.h, b.offX, b.offY, b.sourceW, b.sourceH);
  4452. this._textureMap[a] = b
  4453. }
  4454. return b
  4455. };
  4456. a.prototype._getFirstCharHeight = function() {
  4457. if (0 == this.firstCharHeight) for (var a in this.charList) {
  4458. var b = this.charList[a];
  4459. if (b) {
  4460. var c = b.sourceH;
  4461. void 0 === c && (c = b.h, void 0 === c && (c = 0), b = b.offY, void 0 === b && (b = 0), c += b);
  4462. if (! (0 >= c)) {
  4463. this.firstCharHeight = c;
  4464. break
  4465. }
  4466. }
  4467. }
  4468. return this.firstCharHeight
  4469. };
  4470. a.prototype.parseConfig = function(a) {
  4471. a = a.split("\r\n").join("\n");
  4472. a = a.split("\n");
  4473. for (var b = this.getConfigByKey(a[3], "count"), c = {},
  4474. d = 4; d < 4 + b; d++) {
  4475. var g = a[d],
  4476. f = String.fromCharCode(this.getConfigByKey(g, "id")),
  4477. h = {};
  4478. c[f] = h;
  4479. h.x = this.getConfigByKey(g, "x");
  4480. h.y = this.getConfigByKey(g, "y");
  4481. h.w = this.getConfigByKey(g, "width");
  4482. h.h = this.getConfigByKey(g, "height");
  4483. h.offX = this.getConfigByKey(g, "xoffset");
  4484. h.offY = this.getConfigByKey(g, "yoffset")
  4485. }
  4486. return c
  4487. };
  4488. a.prototype.getConfigByKey = function(a, b) {
  4489. for (var c = a.split(" "), d = 0, g = c.length; d < g; d++) {
  4490. var f = c[d];
  4491. if (b == f.substring(0, b.length)) return c = f.substring(b.length + 1),
  4492. parseInt(c)
  4493. }
  4494. return 0
  4495. };
  4496. return a
  4497. } (b.SpriteSheet);
  4498. b.BitmapFont = d;
  4499. d.prototype.__class__ = "egret.BitmapFont"
  4500. })(egret || (egret = {}));
  4501. __extends = this.__extends ||
  4502. function(b, d) {
  4503. function c() {
  4504. this.constructor = b
  4505. }
  4506. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4507. c.prototype = d.prototype;
  4508. b.prototype = new c
  4509. }; (function(b) {
  4510. var d = function(c) {
  4511. function a(a) {
  4512. c.call(this);
  4513. this._isAddedToStage = !1;
  4514. this._frames = this._movieClipData = this._textureToRender = null;
  4515. this._totalFrames = 0;
  4516. this._frameLabels = null;
  4517. this._frameIntervalTime = 0;
  4518. this._eventPool = null;
  4519. this._isPlaying = !1;
  4520. this._isStopped = !0;
  4521. this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
  4522. this._setMovieClipData(a);
  4523. this.needDraw = !0
  4524. }
  4525. __extends(a, c);
  4526. a.prototype._init = function() {
  4527. this._reset();
  4528. var a = this._movieClipData;
  4529. a && a._isDataValid() && (this._frames = a.frames, this._totalFrames = a.numFrames, this._frameLabels = a.labels, this._frameIntervalTime = 1E3 / a.frameRate, this._initFrame())
  4530. };
  4531. a.prototype._reset = function() {
  4532. this._frames = null;
  4533. this._playTimes = 0;
  4534. this._isPlaying = !1;
  4535. this.setIsStopped(!0);
  4536. this._currentFrameNum = 0;
  4537. this._nextFrameNum = 1;
  4538. this._passedTime = this._displayedKeyFrameNum = 0;
  4539. this._eventPool = []
  4540. };
  4541. a.prototype._initFrame = function() {
  4542. this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
  4543. };
  4544. a.prototype._render = function(e) {
  4545. var b = this._textureToRender;
  4546. if (this._texture_to_render = b) {
  4547. var c = Math.round(b._offsetX),
  4548. d = Math.round(b._offsetY),
  4549. g = b._bitmapWidth || b._textureWidth,
  4550. f = b._bitmapHeight || b._textureHeight,
  4551. h = Math.round(g),
  4552. n = Math.round(f);
  4553. a.renderFilter.drawImage(e, this, b._bitmapX, b._bitmapY, g, f, c, d, h, n)
  4554. }
  4555. };
  4556. a.prototype._measureBounds = function() {
  4557. var a = this._textureToRender;
  4558. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : c.prototype._measureBounds.call(this)
  4559. };
  4560. a.prototype._onAddToStage = function() {
  4561. c.prototype._onAddToStage.call(this);
  4562. this._isAddedToStage = !0;
  4563. this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
  4564. };
  4565. a.prototype._onRemoveFromStage = function() {
  4566. c.prototype._onRemoveFromStage.call(this);
  4567. this._isAddedToStage = !1;
  4568. this.setIsStopped(!0)
  4569. };
  4570. a.prototype._getFrameLabelByName = function(a, b) {
  4571. void 0 === b && (b = !1);
  4572. b && (a = a.toLowerCase());
  4573. var c = this._frameLabels;
  4574. if (c) for (var d = null,
  4575. g = 0; g < c.length; g++) if (d = c[g], b ? d.name.toLowerCase() === a: d.name === a) return d;
  4576. return null
  4577. };
  4578. a.prototype._getFrameLabelByFrame = function(a) {
  4579. var b = this._frameLabels;
  4580. if (b) for (var c = null,
  4581. d = 0; d < b.length; d++) if (c = b[d], c.frame === a) return c;
  4582. return null
  4583. };
  4584. a.prototype._getFrameLabelForFrame = function(a) {
  4585. var b = null,
  4586. c = null,
  4587. d = this._frameLabels;
  4588. if (d) for (var g = 0; g < d.length; g++) {
  4589. c = d[g];
  4590. if (c.frame > a) break;
  4591. b = c
  4592. }
  4593. return b
  4594. };
  4595. a.prototype.play = function(a) {
  4596. void 0 === a && (a = 0);
  4597. this._isPlaying = !0;
  4598. this.setPlayTimes(a);
  4599. 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
  4600. };
  4601. a.prototype.stop = function() {
  4602. this._isPlaying = !1;
  4603. this.setIsStopped(!0)
  4604. };
  4605. a.prototype.prevFrame = function() {
  4606. this.gotoAndStop(this._currentFrameNum - 1)
  4607. };
  4608. a.prototype.nextFrame = function() {
  4609. this.gotoAndStop(this._currentFrameNum + 1)
  4610. };
  4611. a.prototype.gotoAndPlay = function(a, c) {
  4612. void 0 === c && (c = 0);
  4613. if (0 === arguments.length || 2 < arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndPlay()"));
  4614. this.play(c);
  4615. this._gotoFrame(a)
  4616. };
  4617. a.prototype.gotoAndStop = function(a) {
  4618. if (1 != arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndStop()"));
  4619. this.stop();
  4620. this._gotoFrame(a)
  4621. };
  4622. a.prototype._gotoFrame = function(a) {
  4623. var c;
  4624. if ("string" === typeof a) c = this._getFrameLabelByName(a).frame;
  4625. else if (c = parseInt(a + "", 10), c != a) throw Error(b.getString(1022, "Frame Label Not Found"));
  4626. 1 > c ? c = 1 : c > this._totalFrames && (c = this._totalFrames);
  4627. c !== this._nextFrameNum && (this._nextFrameNum = c, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
  4628. };
  4629. a.prototype._advanceTime = function(a) {
  4630. var c = this._frameIntervalTime;
  4631. a = this._passedTime + a;
  4632. this._passedTime = a % c;
  4633. c = a / c;
  4634. if (! (1 > c)) {
  4635. for (; 1 <= c;) {
  4636. c--;
  4637. this._nextFrameNum++;
  4638. if (this._nextFrameNum > this._totalFrames) if ( - 1 == this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4639. this._nextFrameNum = 1;
  4640. else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4641. this._nextFrameNum = 1;
  4642. else {
  4643. this._nextFrameNum = this._totalFrames;
  4644. this._eventPool.push(b.Event.COMPLETE);
  4645. this.stop();
  4646. break
  4647. }
  4648. this._advanceFrame()
  4649. }
  4650. this._constructFrame();
  4651. this._handlePendingEvent()
  4652. }
  4653. };
  4654. a.prototype._advanceFrame = function() {
  4655. this._currentFrameNum = this._nextFrameNum
  4656. };
  4657. a.prototype._constructFrame = function() {
  4658. var a = this._currentFrameNum;
  4659. this._displayedKeyFrameNum != a && (this._textureToRender = this._movieClipData.getTextureByFrame(a), this._displayedKeyFrameNum = a)
  4660. };
  4661. a.prototype._handlePendingEvent = function() {
  4662. if (0 != this._eventPool.length) {
  4663. this._eventPool.reverse();
  4664. for (var a = this._eventPool,
  4665. c = a.length,
  4666. d = !1,
  4667. k = !1,
  4668. g = 0; g < c; g++) {
  4669. var f = a.pop();
  4670. f == b.Event.LOOP_COMPLETE ? k = !0 : f == b.Event.COMPLETE ? d = !0 : this.dispatchEventWith(f)
  4671. }
  4672. k && this.dispatchEventWith(b.Event.LOOP_COMPLETE);
  4673. d && this.dispatchEventWith(b.Event.COMPLETE)
  4674. }
  4675. };
  4676. Object.defineProperty(a.prototype, "totalFrames", {
  4677. get: function() {
  4678. return this._totalFrames
  4679. },
  4680. enumerable: !0,
  4681. configurable: !0
  4682. });
  4683. Object.defineProperty(a.prototype, "currentFrame", {
  4684. get: function() {
  4685. return this._currentFrameNum
  4686. },
  4687. enumerable: !0,
  4688. configurable: !0
  4689. });
  4690. Object.defineProperty(a.prototype, "currentFrameLabel", {
  4691. get: function() {
  4692. var a = this._getFrameLabelByFrame(this._currentFrameNum);
  4693. return a && a.name
  4694. },
  4695. enumerable: !0,
  4696. configurable: !0
  4697. });
  4698. Object.defineProperty(a.prototype, "currentLabel", {
  4699. get: function() {
  4700. var a = this._getFrameLabelForFrame(this._currentFrameNum);
  4701. return a ? a.name: null
  4702. },
  4703. enumerable: !0,
  4704. configurable: !0
  4705. });
  4706. Object.defineProperty(a.prototype, "frameRate", {
  4707. get: function() {
  4708. return this.movieClipData.frameRate
  4709. },
  4710. set: function(a) {
  4711. a != this._movieClipData.frameRate && (this._movieClipData.frameRate = a, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
  4712. },
  4713. enumerable: !0,
  4714. configurable: !0
  4715. });
  4716. Object.defineProperty(a.prototype, "isPlaying", {
  4717. get: function() {
  4718. return this._isPlaying
  4719. },
  4720. enumerable: !0,
  4721. configurable: !0
  4722. });
  4723. Object.defineProperty(a.prototype, "movieClipData", {
  4724. get: function() {
  4725. return this._movieClipData
  4726. },
  4727. set: function(a) {
  4728. this._setMovieClipData(a)
  4729. },
  4730. enumerable: !0,
  4731. configurable: !0
  4732. });
  4733. a.prototype._setMovieClipData = function(a) {
  4734. this._movieClipData != a && (this._movieClipData = a, this._init())
  4735. };
  4736. a.prototype.setPlayTimes = function(a) {
  4737. if (0 > a || 1 <= a) this._playTimes = 0 > a ? -1 : Math.floor(a)
  4738. };
  4739. a.prototype.setIsStopped = function(a) {
  4740. this._isStopped != a && ((this._isStopped = a) ? (this._playTimes = 0, b.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, b.Ticker.getInstance().register(this._advanceTime, this)))
  4741. };
  4742. a.renderFilter = b.RenderFilter.getInstance();
  4743. return a
  4744. } (b.DisplayObject);
  4745. b.MovieClip = d;
  4746. d.prototype.__class__ = "egret.MovieClip"
  4747. })(egret || (egret = {}));
  4748. __extends = this.__extends ||
  4749. function(b, d) {
  4750. function c() {
  4751. this.constructor = b
  4752. }
  4753. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4754. c.prototype = d.prototype;
  4755. b.prototype = new c
  4756. }; (function(b) {
  4757. var d = function(b) {
  4758. function a(a, d) {
  4759. b.call(this);
  4760. this._name = a;
  4761. this._frame = d | 0
  4762. }
  4763. __extends(a, b);
  4764. Object.defineProperty(a.prototype, "name", {
  4765. get: function() {
  4766. return this._name
  4767. },
  4768. enumerable: !0,
  4769. configurable: !0
  4770. });
  4771. Object.defineProperty(a.prototype, "frame", {
  4772. get: function() {
  4773. return this._frame
  4774. },
  4775. enumerable: !0,
  4776. configurable: !0
  4777. });
  4778. a.prototype.clone = function() {
  4779. return new a(this._name, this._frame)
  4780. };
  4781. return a
  4782. } (b.EventDispatcher);
  4783. b.FrameLabel = d;
  4784. d.prototype.__class__ = "egret.FrameLabel"
  4785. })(egret || (egret = {}));
  4786. __extends = this.__extends ||
  4787. function(b, d) {
  4788. function c() {
  4789. this.constructor = b
  4790. }
  4791. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4792. c.prototype = d.prototype;
  4793. b.prototype = new c
  4794. }; (function(b) {
  4795. var d = function(c) {
  4796. function a() {
  4797. c.call(this);
  4798. this._mcData = null;
  4799. this.numFrames = 1;
  4800. this.frames = [];
  4801. this.labels = null;
  4802. this.frameRate = 0;
  4803. this.spriteSheet = this.textureData = null
  4804. }
  4805. __extends(a, c);
  4806. a.prototype._init = function(a, b, c) {
  4807. this.textureData = b;
  4808. this.spriteSheet = c;
  4809. this._setMCData(a)
  4810. };
  4811. a.prototype.getKeyFrameData = function(a) {
  4812. a = this.frames[a - 1];
  4813. a.frame && (a = this.frames[a.frame - 1]);
  4814. return a
  4815. };
  4816. a.prototype.getTextureByFrame = function(a) {
  4817. a = this.getKeyFrameData(a);
  4818. if (a.res) {
  4819. var b = this.getTextureByResName(a.res);
  4820. b._offsetX = a.x | 0;
  4821. b._offsetY = a.y | 0;
  4822. return b
  4823. }
  4824. return null
  4825. };
  4826. a.prototype.getTextureByResName = function(a) {
  4827. var b = this.spriteSheet.getTexture(a);
  4828. b || (b = this.textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4829. return b
  4830. };
  4831. a.prototype._isDataValid = function() {
  4832. return 0 < this.frames.length
  4833. };
  4834. a.prototype._isTextureValid = function() {
  4835. return null != this.textureData && null != this.spriteSheet
  4836. };
  4837. a.prototype._fillMCData = function(a) {
  4838. this.frameRate = a.frameRate || 24;
  4839. this._fillFramesData(a.frames);
  4840. this._fillFrameLabelsData(a.labels)
  4841. };
  4842. a.prototype._fillFramesData = function(a) {
  4843. for (var b = this.frames,
  4844. c = a ? a.length: 0, d, g = 0; g < c; g++) if (d = a[g], b.push(d), d.duration) {
  4845. var f = parseInt(d.duration);
  4846. if (1 < f) {
  4847. d = b.length;
  4848. for (var h = 1; h < f; h++) b.push({
  4849. frame: d
  4850. })
  4851. }
  4852. }
  4853. this.numFrames = b.length
  4854. };
  4855. a.prototype._fillFrameLabelsData = function(a) {
  4856. if (a) {
  4857. var c = a.length;
  4858. if (0 < c) {
  4859. this.labels = [];
  4860. for (var d = 0; d < c; d++) {
  4861. var k = a[d];
  4862. this.labels.push(new b.FrameLabel(k.name, k.frame))
  4863. }
  4864. }
  4865. }
  4866. };
  4867. Object.defineProperty(a.prototype, "mcData", {
  4868. get: function() {
  4869. return this._mcData
  4870. },
  4871. set: function(a) {
  4872. this._setMCData(a)
  4873. },
  4874. enumerable: !0,
  4875. configurable: !0
  4876. });
  4877. a.prototype._setMCData = function(a) {
  4878. this._mcData != a && (this._mcData = a) && this._fillMCData(a)
  4879. };
  4880. return a
  4881. } (b.HashObject);
  4882. b.MovieClipData = d;
  4883. d.prototype.__class__ = "egret.MovieClipData"
  4884. })(egret || (egret = {}));
  4885. __extends = this.__extends ||
  4886. function(b, d) {
  4887. function c() {
  4888. this.constructor = b
  4889. }
  4890. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4891. c.prototype = d.prototype;
  4892. b.prototype = new c
  4893. }; (function(b) {
  4894. var d = function(c) {
  4895. function a(a, b) {
  4896. c.call(this);
  4897. this.enableCache = !0;
  4898. this._mcDataCache = {};
  4899. this._mcDataSet = a;
  4900. this.setTexture(b)
  4901. }
  4902. __extends(a, c);
  4903. a.prototype.clearCache = function() {
  4904. this._mcDataCache = {}
  4905. };
  4906. a.prototype.generateMovieClipData = function(a) {
  4907. void 0 === a && (a = "");
  4908. if ("" == a && this._mcDataSet) for (a in this._mcDataSet.mc) break;
  4909. if ("" == a) return null;
  4910. var c = this._findFromCache(a, this._mcDataCache);
  4911. c || (c = new b.MovieClipData, this._fillData(a, c, this._mcDataCache));
  4912. return c
  4913. };
  4914. a.prototype._findFromCache = function(a, b) {
  4915. return this.enableCache && b[a] ? b[a] : null
  4916. };
  4917. a.prototype._fillData = function(a, b, c) {
  4918. if (this._mcDataSet) {
  4919. var d = this._mcDataSet.mc[a];
  4920. d && (b._init(d, this._mcDataSet.res, this._spriteSheet), this.enableCache && (c[a] = b))
  4921. }
  4922. };
  4923. Object.defineProperty(a.prototype, "mcDataSet", {
  4924. get: function() {
  4925. return this._mcDataSet
  4926. },
  4927. set: function(a) {
  4928. this._mcDataSet = a
  4929. },
  4930. enumerable: !0,
  4931. configurable: !0
  4932. });
  4933. Object.defineProperty(a.prototype, "texture", {
  4934. set: function(a) {
  4935. this.setTexture(a)
  4936. },
  4937. enumerable: !0,
  4938. configurable: !0
  4939. });
  4940. Object.defineProperty(a.prototype, "spriteSheet", {
  4941. get: function() {
  4942. return this._spriteSheet
  4943. },
  4944. enumerable: !0,
  4945. configurable: !0
  4946. });
  4947. a.prototype.setTexture = function(a) {
  4948. this._spriteSheet = a ? new b.SpriteSheet(a) : null
  4949. };
  4950. return a
  4951. } (b.EventDispatcher);
  4952. b.MovieClipDataFactory = d;
  4953. d.prototype.__class__ = "egret.MovieClipDataFactory"
  4954. })(egret || (egret = {}));
  4955. __extends = this.__extends ||
  4956. function(b, d) {
  4957. function c() {
  4958. this.constructor = b
  4959. }
  4960. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  4961. c.prototype = d.prototype;
  4962. b.prototype = new c
  4963. }; (function(b) {
  4964. var d = function(b) {
  4965. function a() {
  4966. b.call(this);
  4967. this._scaleY = this._scaleX = 1;
  4968. this._size = 30;
  4969. this._color = "#FFFFFF";
  4970. this._fontFamily = "Arial";
  4971. this._italic = this._bold = !1;
  4972. this._textAlign = "left";
  4973. this._multiline = this._visible = !1;
  4974. this._maxChars = 0
  4975. }
  4976. __extends(a, b);
  4977. a.prototype._getText = function() {
  4978. return null
  4979. };
  4980. a.prototype._setText = function(a) {};
  4981. a.prototype._setTextType = function(a) {};
  4982. a.prototype._getTextType = function() {
  4983. return null
  4984. };
  4985. a.prototype._open = function(a, b, c, d) {};
  4986. a.prototype._show = function() {};
  4987. a.prototype._add = function() {};
  4988. a.prototype._remove = function() {};
  4989. a.prototype._hide = function() {};
  4990. a.prototype._addListeners = function() {};
  4991. a.prototype._removeListeners = function() {};
  4992. a.prototype._setScale = function(a, b) {
  4993. this._scaleX = a;
  4994. this._scaleY = b
  4995. };
  4996. a.prototype.changePosition = function(a, b) {};
  4997. a.prototype._setSize = function(a) {
  4998. this._size = a
  4999. };
  5000. a.prototype._setTextColor = function(a) {
  5001. this._color = a
  5002. };
  5003. a.prototype._setTextFontFamily = function(a) {
  5004. this._fontFamily = a
  5005. };
  5006. a.prototype._setBold = function(a) {
  5007. this._bold = a
  5008. };
  5009. a.prototype._setItalic = function(a) {
  5010. this._italic = a
  5011. };
  5012. a.prototype._setTextAlign = function(a) {
  5013. this._textAlign = a
  5014. };
  5015. a.prototype._setVisible = function(a) {
  5016. this._visible = a
  5017. };
  5018. a.prototype._setWidth = function(a) {};
  5019. a.prototype._setHeight = function(a) {};
  5020. a.prototype._setMultiline = function(a) {
  5021. this._multiline = a
  5022. };
  5023. a.prototype._setMaxChars = function(a) {
  5024. this._maxChars = a
  5025. };
  5026. a.prototype._resetStageText = function() {};
  5027. a.create = function() {
  5028. return null
  5029. };
  5030. return a
  5031. } (b.EventDispatcher);
  5032. b.StageText = d;
  5033. d.prototype.__class__ = "egret.StageText"
  5034. })(egret || (egret = {})); (function(b) {
  5035. var d = function() {
  5036. function b() {}
  5037. b.GET = "get";
  5038. b.POST = "post";
  5039. return b
  5040. } ();
  5041. b.URLRequestMethod = d;
  5042. d.prototype.__class__ = "egret.URLRequestMethod"
  5043. })(egret || (egret = {})); (function(b) {
  5044. var d = function() {
  5045. function b() {}
  5046. b.BINARY = "binary";
  5047. b.TEXT = "text";
  5048. b.VARIABLES = "variables";
  5049. b.TEXTURE = "texture";
  5050. b.SOUND = "sound";
  5051. return b
  5052. } ();
  5053. b.URLLoaderDataFormat = d;
  5054. d.prototype.__class__ = "egret.URLLoaderDataFormat"
  5055. })(egret || (egret = {}));
  5056. __extends = this.__extends ||
  5057. function(b, d) {
  5058. function c() {
  5059. this.constructor = b
  5060. }
  5061. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5062. c.prototype = d.prototype;
  5063. b.prototype = new c
  5064. }; (function(b) {
  5065. var d = function(b) {
  5066. function a(a) {
  5067. void 0 === a && (a = null);
  5068. b.call(this);
  5069. this.variables = null;
  5070. null !== a && this.decode(a)
  5071. }
  5072. __extends(a, b);
  5073. a.prototype.decode = function(a) {
  5074. this.variables || (this.variables = {});
  5075. a = a.split("+").join(" ");
  5076. for (var b, c = /[?&]?([^=]+)=([^&]*)/g; b = c.exec(a);) {
  5077. var d = decodeURIComponent(b[1]);
  5078. b = decodeURIComponent(b[2]);
  5079. if (!1 == d in this.variables) this.variables[d] = b;
  5080. else {
  5081. var g = this.variables[d];
  5082. g instanceof Array ? g.push(b) : this.variables[d] = [g, b]
  5083. }
  5084. }
  5085. };
  5086. a.prototype.toString = function() {
  5087. if (!this.variables) return "";
  5088. var a = this.variables,
  5089. b = [],
  5090. c;
  5091. for (c in a) b.push(this.encodeValue(c, a[c]));
  5092. return b.join("&")
  5093. };
  5094. a.prototype.encodeValue = function(a, b) {
  5095. return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5096. };
  5097. a.prototype.encodeArray = function(a, b) {
  5098. return a ? 0 == b.length ? encodeURIComponent(a) + "=": b.map(function(b) {
  5099. return encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5100. }).join("&") : ""
  5101. };
  5102. return a
  5103. } (b.HashObject);
  5104. b.URLVariables = d;
  5105. d.prototype.__class__ = "egret.URLVariables"
  5106. })(egret || (egret = {})); (function(b) {
  5107. var d = function() {
  5108. return function(b, a) {
  5109. this.value = this.name = "";
  5110. this.name = b;
  5111. this.value = a
  5112. }
  5113. } ();
  5114. b.URLRequestHeader = d;
  5115. d.prototype.__class__ = "egret.URLRequestHeader"
  5116. })(egret || (egret = {}));
  5117. __extends = this.__extends ||
  5118. function(b, d) {
  5119. function c() {
  5120. this.constructor = b
  5121. }
  5122. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5123. c.prototype = d.prototype;
  5124. b.prototype = new c
  5125. }; (function(b) {
  5126. var d = function(c) {
  5127. function a(a) {
  5128. void 0 === a && (a = null);
  5129. c.call(this);
  5130. this.data = null;
  5131. this.method = b.URLRequestMethod.GET;
  5132. this.url = "";
  5133. this.url = a
  5134. }
  5135. __extends(a, c);
  5136. return a
  5137. } (b.HashObject);
  5138. b.URLRequest = d;
  5139. d.prototype.__class__ = "egret.URLRequest"
  5140. })(egret || (egret = {}));
  5141. __extends = this.__extends ||
  5142. function(b, d) {
  5143. function c() {
  5144. this.constructor = b
  5145. }
  5146. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5147. c.prototype = d.prototype;
  5148. b.prototype = new c
  5149. }; (function(b) {
  5150. var d = function(c) {
  5151. function a(a) {
  5152. void 0 === a && (a = null);
  5153. c.call(this);
  5154. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  5155. this._request = this.data = null;
  5156. this._status = -1;
  5157. a && this.load(a)
  5158. }
  5159. __extends(a, c);
  5160. a.prototype.load = function(a) {
  5161. this._request = a;
  5162. this.data = null;
  5163. b.MainContext.instance.netContext.proceed(this)
  5164. };
  5165. a.prototype.__recycle = function() {
  5166. this.data = this._request = null
  5167. };
  5168. return a
  5169. } (b.EventDispatcher);
  5170. b.URLLoader = d;
  5171. d.prototype.__class__ = "egret.URLLoader"
  5172. })(egret || (egret = {}));
  5173. __extends = this.__extends ||
  5174. function(b, d) {
  5175. function c() {
  5176. this.constructor = b
  5177. }
  5178. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5179. c.prototype = d.prototype;
  5180. b.prototype = new c
  5181. }; (function(b) {
  5182. var d = function(c) {
  5183. function a() {
  5184. c.call(this);
  5185. this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
  5186. this._bitmapData = null
  5187. }
  5188. __extends(a, c);
  5189. Object.defineProperty(a.prototype, "textureWidth", {
  5190. get: function() {
  5191. return this._textureWidth
  5192. },
  5193. enumerable: !0,
  5194. configurable: !0
  5195. });
  5196. Object.defineProperty(a.prototype, "textureHeight", {
  5197. get: function() {
  5198. return this._textureHeight
  5199. },
  5200. enumerable: !0,
  5201. configurable: !0
  5202. });
  5203. Object.defineProperty(a.prototype, "bitmapData", {
  5204. get: function() {
  5205. return this._bitmapData
  5206. },
  5207. enumerable: !0,
  5208. configurable: !0
  5209. });
  5210. a.prototype._setBitmapData = function(a) {
  5211. var c = b.MainContext.instance.rendererContext._texture_scale_factor;
  5212. this._bitmapData = a;
  5213. this._sourceWidth = a.width;
  5214. this._sourceHeight = a.height;
  5215. this._textureWidth = this._sourceWidth * c;
  5216. this._textureHeight = this._sourceHeight * c;
  5217. this._bitmapWidth = this._textureWidth;
  5218. this._bitmapHeight = this._textureHeight;
  5219. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  5220. };
  5221. a.prototype.getPixel32 = function(a, b) {
  5222. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  5223. };
  5224. return a
  5225. } (b.HashObject);
  5226. b.Texture = d;
  5227. d.prototype.__class__ = "egret.Texture"
  5228. })(egret || (egret = {}));
  5229. __extends = this.__extends ||
  5230. function(b, d) {
  5231. function c() {
  5232. this.constructor = b
  5233. }
  5234. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5235. c.prototype = d.prototype;
  5236. b.prototype = new c
  5237. }; (function(b) {
  5238. var d = function(c) {
  5239. function a() {
  5240. c.call(this)
  5241. }
  5242. __extends(a, c);
  5243. a.prototype.init = function() {
  5244. this._bitmapData = document.createElement("canvas");
  5245. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  5246. };
  5247. a.prototype.drawToTexture = function(e, c, d) {
  5248. var k = c || e.getBounds(b.Rectangle.identity);
  5249. if (0 == k.width || 0 == k.height) return ! 1;
  5250. this._bitmapData || this.init();
  5251. var g = k.x,
  5252. f = k.y;
  5253. c = k.width;
  5254. var k = k.height,
  5255. h = b.MainContext.instance.rendererContext._texture_scale_factor,
  5256. k = k / h;
  5257. c = Math.round(c / h);
  5258. k = Math.round(k);
  5259. this.setSize(c, k);
  5260. this.begin();
  5261. e._worldTransform.identity();
  5262. e._worldTransform.a = 1 / h;
  5263. e._worldTransform.d = 1 / h;
  5264. d && (e._worldTransform.a *= d, e._worldTransform.d *= d);
  5265. d = e._anchorOffsetX;
  5266. var n = e._anchorOffsetY;
  5267. if (0 != e._anchorX || 0 != e._anchorY) d = e._anchorX * c,
  5268. n = e._anchorY * k;
  5269. this._offsetX = g + d;
  5270. this._offsetY = f + n;
  5271. e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  5272. e.worldAlpha = 1;
  5273. if (e instanceof b.DisplayObjectContainer) for (g = e._children, f = 0, d = g.length; f < d; f++) g[f]._updateTransform();
  5274. this.renderContext.setTransform(e._worldTransform);
  5275. g = b.RenderFilter.getInstance();
  5276. f = g._drawAreaList.concat();
  5277. g._drawAreaList.length = 0;
  5278. this.renderContext.clearScreen();
  5279. this.renderContext.onRenderStart();
  5280. b.RendererContext.deleteTexture(this);
  5281. e._filter && this.renderContext.setGlobalFilter(e._filter);
  5282. e._colorTransform && this.renderContext.setGlobalColorTransform(e._colorTransform.matrix); (d = e.mask || e._scrollRect) && this.renderContext.pushMask(d);
  5283. n = b.MainContext.__use_new_draw;
  5284. b.MainContext.__use_new_draw = !1;
  5285. e._render(this.renderContext);
  5286. b.MainContext.__use_new_draw = n;
  5287. d && this.renderContext.popMask();
  5288. e._colorTransform && this.renderContext.setGlobalColorTransform(null);
  5289. e._filter && this.renderContext.setGlobalFilter(null);
  5290. a.identityRectangle.width = c;
  5291. a.identityRectangle.height = k;
  5292. g.addDrawArea(a.identityRectangle);
  5293. this.renderContext.onRenderFinish();
  5294. g._drawAreaList = f;
  5295. this._sourceWidth = c;
  5296. this._sourceHeight = k;
  5297. this._textureWidth = this._sourceWidth * h;
  5298. this._textureHeight = this._sourceHeight * h;
  5299. this.end();
  5300. return ! 0
  5301. };
  5302. a.prototype.setSize = function(a, b) {
  5303. var c = this._bitmapData;
  5304. c.width = a;
  5305. c.height = b;
  5306. c.style.width = a + "px";
  5307. c.style.height = b + "px";
  5308. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
  5309. };
  5310. a.prototype.begin = function() {};
  5311. a.prototype.end = function() {};
  5312. a.prototype.dispose = function() {
  5313. this._bitmapData && (this.renderContext = this._bitmapData = null)
  5314. };
  5315. a.identityRectangle = new b.Rectangle;
  5316. return a
  5317. } (b.Texture);
  5318. b.RenderTexture = d;
  5319. d.prototype.__class__ = "egret.RenderTexture"
  5320. })(egret || (egret = {}));
  5321. __extends = this.__extends ||
  5322. function(b, d) {
  5323. function c() {
  5324. this.constructor = b
  5325. }
  5326. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5327. c.prototype = d.prototype;
  5328. b.prototype = new c
  5329. }; (function(b) {
  5330. var d = function(c) {
  5331. function a() {
  5332. c.call(this);
  5333. this.renderCost = 0;
  5334. this._texture_scale_factor = 1;
  5335. this.profiler = b.Profiler.getInstance();
  5336. a.blendModesForGL || a.initBlendMode()
  5337. }
  5338. __extends(a, c);
  5339. Object.defineProperty(a.prototype, "texture_scale_factor", {
  5340. get: function() {
  5341. return this._texture_scale_factor
  5342. },
  5343. set: function(a) {
  5344. this._setTextureScaleFactor(a)
  5345. },
  5346. enumerable: !0,
  5347. configurable: !0
  5348. });
  5349. a.prototype._setTextureScaleFactor = function(a) {
  5350. this._texture_scale_factor = a
  5351. };
  5352. a.prototype.clearScreen = function() {};
  5353. a.prototype.clearRect = function(a, b, c, d) {};
  5354. a.prototype.drawImage = function(a, b, c, d, g, f, h, n, p, q) {
  5355. this.profiler.onDrawImage()
  5356. };
  5357. a.prototype.drawImageScale9 = function(a, b, c, d, g, f, h, n, p, q) {
  5358. return ! 1
  5359. };
  5360. a.prototype._addOneDraw = function() {
  5361. this.profiler.onDrawImage()
  5362. };
  5363. a.prototype.setTransform = function(a) {};
  5364. a.prototype.setAlpha = function(a, b) {};
  5365. a.prototype.setupFont = function(a, b) {};
  5366. a.prototype.measureText = function(a) {
  5367. return 0
  5368. };
  5369. a.prototype.drawText = function(a, b, c, d, g, f) {
  5370. this.profiler.onDrawImage()
  5371. };
  5372. a.prototype.strokeRect = function(a, b, c, d, g) {};
  5373. a.prototype.pushMask = function(a) {};
  5374. a.prototype.popMask = function() {};
  5375. a.prototype.onRenderStart = function() {};
  5376. a.prototype.onRenderFinish = function() {};
  5377. a.prototype.setGlobalColorTransform = function(a) {};
  5378. a.prototype.setGlobalFilter = function(a) {};
  5379. a.createRendererContext = function(a) {
  5380. return null
  5381. };
  5382. a.deleteTexture = function(a) {
  5383. var c = b.MainContext.instance.rendererContext.gl;
  5384. if (a = a._bitmapData) {
  5385. var d = a.webGLTexture;
  5386. if (d && c) for (var k in d) c.deleteTexture(d[k]);
  5387. a.webGLTexture = null
  5388. }
  5389. };
  5390. a.initBlendMode = function() {
  5391. a.blendModesForGL = {};
  5392. a.blendModesForGL[b.BlendMode.NORMAL] = [1, 771];
  5393. a.blendModesForGL[b.BlendMode.ADD] = [770, 1];
  5394. a.blendModesForGL[b.BlendMode.ERASE] = [0, 771];
  5395. a.blendModesForGL[b.BlendMode.ERASE_REVERSE] = [0, 770]
  5396. };
  5397. a.registerBlendModeForGL = function(e, c, d, k) {
  5398. a.blendModesForGL[e] && !k ? b.Logger.warningWithErrorId(1005, e) : a.blendModesForGL[e] = [c, d]
  5399. };
  5400. a.imageSmoothingEnabled = !0;
  5401. a.blendModesForGL = null;
  5402. return a
  5403. } (b.HashObject);
  5404. b.RendererContext = d;
  5405. d.prototype.__class__ = "egret.RendererContext"
  5406. })(egret || (egret = {})); (function(b) {
  5407. var d = function() {
  5408. function b() {}
  5409. b.MOUSE = "mouse";
  5410. b.TOUCH = "touch";
  5411. b.mode = "touch";
  5412. return b
  5413. } ();
  5414. b.InteractionMode = d;
  5415. d.prototype.__class__ = "egret.InteractionMode"
  5416. })(egret || (egret = {}));
  5417. __extends = this.__extends ||
  5418. function(b, d) {
  5419. function c() {
  5420. this.constructor = b
  5421. }
  5422. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5423. c.prototype = d.prototype;
  5424. b.prototype = new c
  5425. }; (function(b) {
  5426. var d = function(c) {
  5427. function a() {
  5428. c.call(this);
  5429. this._currentTouchTarget = {};
  5430. this.maxTouches = 2;
  5431. this.touchDownTarget = {};
  5432. this.touchingIdentifiers = [];
  5433. this.lastTouchY = this.lastTouchX = -1
  5434. }
  5435. __extends(a, c);
  5436. a.prototype.run = function() {};
  5437. a.prototype.getTouchData = function(a, b, c) {
  5438. var d = this._currentTouchTarget[a];
  5439. null == d && (d = {},
  5440. this._currentTouchTarget[a] = d);
  5441. d.stageX = b;
  5442. d.stageY = c;
  5443. d.identifier = a;
  5444. return d
  5445. };
  5446. a.prototype.dispatchEvent = function(a, c) {
  5447. b.TouchEvent.dispatchTouchEvent(c.target, a, c.identifier, c.stageX, c.stageY, !1, !1, !1, !0 == this.touchDownTarget[c.identifier])
  5448. };
  5449. a.prototype.onTouchBegan = function(a, c, d) {
  5450. if (this.touchingIdentifiers.length != this.maxTouches) {
  5451. var k = b.MainContext.instance.stage.hitTest(a, c);
  5452. k && (a = this.getTouchData(d, a, c), this.touchDownTarget[d] = !0, a.target = k, a.beginTarget = k, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  5453. this.touchingIdentifiers.push(d)
  5454. }
  5455. };
  5456. a.prototype.onTouchMove = function(a, c, d) {
  5457. if ( - 1 != this.touchingIdentifiers.indexOf(d) && (a != this.lastTouchX || c != this.lastTouchY)) {
  5458. this.lastTouchX = a;
  5459. this.lastTouchY = c;
  5460. var k = b.MainContext.instance.stage.hitTest(a, c);
  5461. k && (a = this.getTouchData(d, a, c), a.target = k, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  5462. }
  5463. };
  5464. a.prototype.onTouchEnd = function(a, c, d) {
  5465. var k = this.touchingIdentifiers.indexOf(d); - 1 != k && (this.touchingIdentifiers.splice(k, 1), k = b.MainContext.instance.stage.hitTest(a, c)) && (a = this.getTouchData(d, a, c), delete this.touchDownTarget[d], d = a.beginTarget, a.target = k, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), d == k ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  5466. };
  5467. return a
  5468. } (b.HashObject);
  5469. b.TouchContext = d;
  5470. d.prototype.__class__ = "egret.TouchContext"
  5471. })(egret || (egret = {}));
  5472. __extends = this.__extends ||
  5473. function(b, d) {
  5474. function c() {
  5475. this.constructor = b
  5476. }
  5477. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5478. c.prototype = d.prototype;
  5479. b.prototype = new c
  5480. }; (function(b) {
  5481. var d = function(c) {
  5482. function a() {
  5483. c.call(this)
  5484. }
  5485. __extends(a, c);
  5486. a.prototype.proceed = function(a) {};
  5487. a._getUrl = function(a) {
  5488. var c = a.url; - 1 == c.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (c = c + "?" + a.data.toString());
  5489. return c
  5490. };
  5491. a.prototype.getChangeList = function() {
  5492. return []
  5493. };
  5494. return a
  5495. } (b.HashObject);
  5496. b.NetContext = d;
  5497. d.prototype.__class__ = "egret.NetContext"
  5498. })(egret || (egret = {}));
  5499. __extends = this.__extends ||
  5500. function(b, d) {
  5501. function c() {
  5502. this.constructor = b
  5503. }
  5504. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5505. c.prototype = d.prototype;
  5506. b.prototype = new c
  5507. }; (function(b) {
  5508. var d = function(b) {
  5509. function a() {
  5510. b.call(this);
  5511. this.frameRate = 60
  5512. }
  5513. __extends(a, b);
  5514. a.prototype.executeMainLoop = function(a, b) {};
  5515. return a
  5516. } (b.HashObject);
  5517. b.DeviceContext = d;
  5518. d.prototype.__class__ = "egret.DeviceContext"
  5519. })(egret || (egret = {})); (function(b) {
  5520. var d = function() {
  5521. function b() {}
  5522. b.call = function(a, e) {};
  5523. b.addCallback = function(a, e) {};
  5524. return b
  5525. } ();
  5526. b.ExternalInterface = d;
  5527. d.prototype.__class__ = "egret.ExternalInterface"
  5528. })(egret || (egret = {}));
  5529. __extends = this.__extends ||
  5530. function(b, d) {
  5531. function c() {
  5532. this.constructor = b
  5533. }
  5534. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  5535. c.prototype = d.prototype;
  5536. b.prototype = new c
  5537. }; (function(b) {
  5538. var d = function(c) {
  5539. function a() {
  5540. c.call(this);
  5541. this.trans = null;
  5542. this.ua = navigator.userAgent.toLowerCase();
  5543. this.trans = this._getTrans()
  5544. }
  5545. __extends(a, c);
  5546. a.getInstance = function() {
  5547. null == a.instance && (a.instance = new a);
  5548. return a.instance
  5549. };
  5550. Object.defineProperty(a.prototype, "isMobile", {
  5551. get: function() {
  5552. b.Logger.warningWithErrorId(1E3);
  5553. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  5554. },
  5555. enumerable: !0,
  5556. configurable: !0
  5557. });
  5558. a.prototype._getHeader = function(a) {
  5559. if ("transform" in a) return "";
  5560. for (var b = ["webkit", "ms", "Moz", "O"], c = 0; c < b.length; c++) if (b[c] + "Transform" in a) return b[c];
  5561. return ""
  5562. };
  5563. a.prototype._getTrans = function() {
  5564. var a = document.createElement("div").style,
  5565. a = this._getHeader(a);
  5566. return "" == a ? "transform": a + "Transform"
  5567. };
  5568. a.prototype.$new = function(a) {
  5569. return this.$(document.createElement(a))
  5570. };
  5571. a.prototype.$ = function(e) {
  5572. var c = document;
  5573. if (e = e instanceof HTMLElement ? e: c.querySelector(e)) e.find = e.find || this.$,
  5574. e.hasClass = e.hasClass ||
  5575. function(a) {
  5576. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  5577. },
  5578. e.addClass = e.addClass ||
  5579. function(a) {
  5580. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  5581. return this
  5582. },
  5583. e.removeClass = e.removeClass ||
  5584. function(a) {
  5585. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  5586. return this
  5587. },
  5588. e.remove = e.remove ||
  5589. function() {},
  5590. e.appendTo = e.appendTo ||
  5591. function(a) {
  5592. a.appendChild(this);
  5593. return this
  5594. },
  5595. e.prependTo = e.prependTo ||
  5596. function(a) {
  5597. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  5598. return this
  5599. },
  5600. e.transforms = e.transforms ||
  5601. function() {
  5602. 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);
  5603. return this
  5604. },
  5605. e.position = e.position || {
  5606. x: 0,
  5607. y: 0
  5608. },
  5609. e.rotation = e.rotation || 0,
  5610. e.scale = e.scale || {
  5611. x: 1,
  5612. y: 1
  5613. },
  5614. e.skew = e.skew || {
  5615. x: 0,
  5616. y: 0
  5617. },
  5618. e.translates = function(a, e) {
  5619. this.position.x = a;
  5620. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  5621. this.transforms();
  5622. return this
  5623. },
  5624. e.rotate = function(a) {
  5625. this.rotation = a;
  5626. this.transforms();
  5627. return this
  5628. },
  5629. e.resize = function(a, e) {
  5630. this.scale.x = a;
  5631. this.scale.y = e;
  5632. this.transforms();
  5633. return this
  5634. },
  5635. e.setSkew = function(a, e) {
  5636. this.skew.x = a;
  5637. this.skew.y = e;
  5638. this.transforms();
  5639. return this
  5640. };
  5641. return e
  5642. };
  5643. a.prototype.translate = function(a) {
  5644. return "translate(" + a.x + "px, " + a.y + "px) "
  5645. };
  5646. a.prototype.rotate = function(a) {
  5647. return "rotate(" + a + "deg) "
  5648. };
  5649. a.prototype.scale = function(a) {
  5650. return "scale(" + a.x + ", " + a.y + ") "
  5651. };
  5652. a.prototype.skew = function(a) {
  5653. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5654. };
  5655. return a
  5656. } (b.HashObject);
  5657. b.Browser = d;
  5658. d.prototype.__class__ = "egret.Browser"
  5659. })(egret || (egret = {})); (function(b) { (function(b) {
  5660. b.getItem = function(b) {
  5661. return null
  5662. };
  5663. b.setItem = function(b, a) {
  5664. return ! 1
  5665. };
  5666. b.removeItem = function(b) {};
  5667. b.clear = function() {}
  5668. })(b.localStorage || (b.localStorage = {}))
  5669. })(egret || (egret = {})); (function(b) {
  5670. var d = function() {
  5671. function c() {}
  5672. c.parse = function(a) {
  5673. a = b.SAXParser.getInstance().parserXML(a);
  5674. if (!a || !a.childNodes) return null;
  5675. for (var e = a.childNodes.length,
  5676. d = !1,
  5677. m = 0; m < e; m++) {
  5678. var k = a.childNodes[m];
  5679. if (1 == k.nodeType) {
  5680. d = !0;
  5681. break
  5682. }
  5683. }
  5684. return d ? c.parseNode(k) : null
  5685. };
  5686. c.parseNode = function(a) {
  5687. if (!a || 1 != a.nodeType) return null;
  5688. var e = {};
  5689. e.localName = a.localName;
  5690. e.name = a.nodeName;
  5691. a.namespaceURI && (e.namespace = a.namespaceURI);
  5692. a.prefix && (e.prefix = a.prefix);
  5693. for (var b = a.attributes,
  5694. d = b.length,
  5695. k = 0; k < d; k++) {
  5696. var g = b[k],
  5697. f = g.name;
  5698. 0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
  5699. }
  5700. b = a.childNodes;
  5701. d = b.length;
  5702. for (k = 0; k < d; k++) if (g = c.parseNode(b[k])) e.children || (e.children = []),
  5703. g.parent = e,
  5704. e.children.push(g); ! e.children && (a = a.textContent.trim()) && (e.text = a);
  5705. return e
  5706. };
  5707. c.findChildren = function(a, e, b) {
  5708. b ? b.length = 0 : b = [];
  5709. c.findByPath(a, e, b);
  5710. return b
  5711. };
  5712. c.findByPath = function(a, e, b) {
  5713. var d = e.indexOf("."),
  5714. k; - 1 == d ? (k = e, d = !0) : (k = e.substring(0, d), e = e.substring(d + 1), d = !1);
  5715. if (a = a.children) for (var g = a.length,
  5716. f = 0; f < g; f++) {
  5717. var h = a[f];
  5718. h.localName == k && (d ? b.push(h) : c.findByPath(h, e, b))
  5719. }
  5720. };
  5721. c.getAttributes = function(a, e) {
  5722. e ? e.length = 0 : e = [];
  5723. for (var b in a)"$" == b.charAt(0) && e.push(b.substring(1));
  5724. return e
  5725. };
  5726. return c
  5727. } ();
  5728. b.XML = d;
  5729. d.prototype.__class__ = "egret.XML"
  5730. })(egret || (egret = {})); (function(b) {
  5731. var d = function() {
  5732. function a() {}
  5733. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5734. a.BIG_ENDIAN = "BIG_ENDIAN";
  5735. return a
  5736. } ();
  5737. b.Endian = d;
  5738. d.prototype.__class__ = "egret.Endian";
  5739. var c = function() {
  5740. function a(a) {
  5741. this.BUFFER_EXT_SIZE = 0;
  5742. this.EOF_code_point = this.EOF_byte = -1;
  5743. this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
  5744. this.endian = d.BIG_ENDIAN
  5745. }
  5746. a.prototype._setArrayBuffer = function(a) {
  5747. this.write_position = a.byteLength;
  5748. this.data = new DataView(a);
  5749. this._position = 0
  5750. };
  5751. a.prototype.setArrayBuffer = function(a) {};
  5752. Object.defineProperty(a.prototype, "buffer", {
  5753. get: function() {
  5754. return this.data.buffer
  5755. },
  5756. set: function(a) {
  5757. this.data = new DataView(a)
  5758. },
  5759. enumerable: !0,
  5760. configurable: !0
  5761. });
  5762. Object.defineProperty(a.prototype, "dataView", {
  5763. get: function() {
  5764. return this.data
  5765. },
  5766. set: function(a) {
  5767. this.data = a;
  5768. this.write_position = a.byteLength
  5769. },
  5770. enumerable: !0,
  5771. configurable: !0
  5772. });
  5773. Object.defineProperty(a.prototype, "bufferOffset", {
  5774. get: function() {
  5775. return this.data.byteOffset
  5776. },
  5777. enumerable: !0,
  5778. configurable: !0
  5779. });
  5780. Object.defineProperty(a.prototype, "position", {
  5781. get: function() {
  5782. return this._position
  5783. },
  5784. set: function(a) {
  5785. this._position < a && !this.validate(a - this._position) || (this._position = a, this.write_position = a > this.write_position ? a: this.write_position)
  5786. },
  5787. enumerable: !0,
  5788. configurable: !0
  5789. });
  5790. Object.defineProperty(a.prototype, "length", {
  5791. get: function() {
  5792. return this.write_position
  5793. },
  5794. set: function(a) {
  5795. this.validateBuffer(a)
  5796. },
  5797. enumerable: !0,
  5798. configurable: !0
  5799. });
  5800. Object.defineProperty(a.prototype, "bytesAvailable", {
  5801. get: function() {
  5802. return this.data.byteLength - this._position
  5803. },
  5804. enumerable: !0,
  5805. configurable: !0
  5806. });
  5807. a.prototype.clear = function() {
  5808. this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
  5809. };
  5810. a.prototype.readBoolean = function() {
  5811. return this.validate(a.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
  5812. };
  5813. a.prototype.readByte = function() {
  5814. return this.validate(a.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
  5815. };
  5816. a.prototype.readBytes = function(e, b, c) {
  5817. void 0 === b && (b = 0);
  5818. void 0 === c && (c = 0);
  5819. if (0 == c) c = this.bytesAvailable;
  5820. else if (!this.validate(c)) return null;
  5821. e ? e.validateBuffer(c) : e = new a(new ArrayBuffer(c));
  5822. for (var d = 0; d < c; d++) e.data.setUint8(d + b, this.data.getUint8(this.position++))
  5823. };
  5824. a.prototype.readDouble = function() {
  5825. if (!this.validate(a.SIZE_OF_FLOAT64)) return null;
  5826. var e = this.data.getFloat64(this.position, this.endian == d.LITTLE_ENDIAN);
  5827. this.position += a.SIZE_OF_FLOAT64;
  5828. return e
  5829. };
  5830. a.prototype.readFloat = function() {
  5831. if (!this.validate(a.SIZE_OF_FLOAT32)) return null;
  5832. var e = this.data.getFloat32(this.position, this.endian == d.LITTLE_ENDIAN);
  5833. this.position += a.SIZE_OF_FLOAT32;
  5834. return e
  5835. };
  5836. a.prototype.readInt = function() {
  5837. if (!this.validate(a.SIZE_OF_INT32)) return null;
  5838. var e = this.data.getInt32(this.position, this.endian == d.LITTLE_ENDIAN);
  5839. this.position += a.SIZE_OF_INT32;
  5840. return e
  5841. };
  5842. a.prototype.readMultiByte = function(a, b) {
  5843. return this.validate(a) ? "": null
  5844. };
  5845. a.prototype.readShort = function() {
  5846. if (!this.validate(a.SIZE_OF_INT16)) return null;
  5847. var e = this.data.getInt16(this.position, this.endian == d.LITTLE_ENDIAN);
  5848. this.position += a.SIZE_OF_INT16;
  5849. return e
  5850. };
  5851. a.prototype.readUnsignedByte = function() {
  5852. return this.validate(a.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
  5853. };
  5854. a.prototype.readUnsignedInt = function() {
  5855. if (!this.validate(a.SIZE_OF_UINT32)) return null;
  5856. var e = this.data.getUint32(this.position, this.endian == d.LITTLE_ENDIAN);
  5857. this.position += a.SIZE_OF_UINT32;
  5858. return e
  5859. };
  5860. a.prototype.readUnsignedShort = function() {
  5861. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5862. var e = this.data.getUint16(this.position, this.endian == d.LITTLE_ENDIAN);
  5863. this.position += a.SIZE_OF_UINT16;
  5864. return e
  5865. };
  5866. a.prototype.readUTF = function() {
  5867. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5868. var e = this.data.getUint16(this.position, this.endian == d.LITTLE_ENDIAN);
  5869. this.position += a.SIZE_OF_UINT16;
  5870. return 0 < e ? this.readUTFBytes(e) : ""
  5871. };
  5872. a.prototype.readUTFBytes = function(a) {
  5873. if (!this.validate(a)) return null;
  5874. var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
  5875. this.position += a;
  5876. return this.decodeUTF8(b)
  5877. };
  5878. a.prototype.writeBoolean = function(e) {
  5879. this.validateBuffer(a.SIZE_OF_BOOLEAN);
  5880. this.data.setUint8(this.position++, e ? 1 : 0)
  5881. };
  5882. a.prototype.writeByte = function(e) {
  5883. this.validateBuffer(a.SIZE_OF_INT8);
  5884. this.data.setInt8(this.position++, e)
  5885. };
  5886. a.prototype.writeBytes = function(a, b, c) {
  5887. void 0 === b && (b = 0);
  5888. void 0 === c && (c = 0);
  5889. if (! (0 > b || 0 > c) && (c = 0 == c ? a.length - b: Math.min(a.length - b, c), 0 < c)) {
  5890. this.validateBuffer(c);
  5891. a = new DataView(a.buffer);
  5892. for (var d = b; d < c + b; d++) this.data.setUint8(this.position++, a.getUint8(d))
  5893. }
  5894. };
  5895. a.prototype.writeDouble = function(e) {
  5896. this.validateBuffer(a.SIZE_OF_FLOAT64);
  5897. this.data.setFloat64(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5898. this.position += a.SIZE_OF_FLOAT64
  5899. };
  5900. a.prototype.writeFloat = function(e) {
  5901. this.validateBuffer(a.SIZE_OF_FLOAT32);
  5902. this.data.setFloat32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5903. this.position += a.SIZE_OF_FLOAT32
  5904. };
  5905. a.prototype.writeInt = function(e) {
  5906. this.validateBuffer(a.SIZE_OF_INT32);
  5907. this.data.setInt32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5908. this.position += a.SIZE_OF_INT32
  5909. };
  5910. a.prototype.writeShort = function(e) {
  5911. this.validateBuffer(a.SIZE_OF_INT16);
  5912. this.data.setInt16(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5913. this.position += a.SIZE_OF_INT16
  5914. };
  5915. a.prototype.writeUnsignedInt = function(e) {
  5916. this.validateBuffer(a.SIZE_OF_UINT32);
  5917. this.data.setUint32(this.position, e, this.endian == d.LITTLE_ENDIAN);
  5918. this.position += a.SIZE_OF_UINT32
  5919. };
  5920. a.prototype.writeUTF = function(e) {
  5921. e = this.encodeUTF8(e);
  5922. var b = e.length;
  5923. this.validateBuffer(a.SIZE_OF_UINT16 + b);
  5924. this.data.setUint16(this.position, b, this.endian === d.LITTLE_ENDIAN);
  5925. this.position += a.SIZE_OF_UINT16;
  5926. this._writeUint8Array(e, !1)
  5927. };
  5928. a.prototype.writeUTFBytes = function(a) {
  5929. this._writeUint8Array(this.encodeUTF8(a))
  5930. };
  5931. a.prototype.toString = function() {
  5932. return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
  5933. };
  5934. a.prototype._writeUint8Array = function(a, b) {
  5935. void 0 === b && (b = !0);
  5936. b && this.validateBuffer(this.position + a.length);
  5937. for (var c = 0; c < a.length; c++) this.data.setUint8(this.position++, a[c])
  5938. };
  5939. a.prototype.validate = function(a) {
  5940. if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return ! 0;
  5941. throw b.getString(1025);
  5942. };
  5943. a.prototype.validateBuffer = function(a) {
  5944. this.write_position = a > this.write_position ? a: this.write_position;
  5945. a += this._position;
  5946. this.data.byteLength < a && (a = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)), a.set(new Uint8Array(this.data.buffer)), this.buffer = a.buffer)
  5947. };
  5948. a.prototype.encodeUTF8 = function(a) {
  5949. var b = 0;
  5950. a = this.stringToCodePoints(a);
  5951. for (var c = []; a.length > b;) {
  5952. var d = a[b++];
  5953. if (this.inRange(d, 55296, 57343)) this.encoderError(d);
  5954. else if (this.inRange(d, 0, 127)) c.push(d);
  5955. else {
  5956. var g, f;
  5957. this.inRange(d, 128, 2047) ? (g = 1, f = 192) : this.inRange(d, 2048, 65535) ? (g = 2, f = 224) : this.inRange(d, 65536, 1114111) && (g = 3, f = 240);
  5958. for (c.push(this.div(d, Math.pow(64, g)) + f); 0 < g;) {
  5959. var h = this.div(d, Math.pow(64, g - 1));
  5960. c.push(128 + h % 64);
  5961. g -= 1
  5962. }
  5963. }
  5964. }
  5965. return new Uint8Array(c)
  5966. };
  5967. a.prototype.decodeUTF8 = function(a) {
  5968. for (var b = 0,
  5969. c = "",
  5970. d, g = 0,
  5971. f = 0,
  5972. h = 0,
  5973. n = 0; a.length > b;) {
  5974. d = a[b++];
  5975. if (d === this.EOF_byte) d = 0 !== f ? this.decoderError(!1) : this.EOF_code_point;
  5976. else if (0 === f) this.inRange(d, 0, 127) || (this.inRange(d, 194, 223) ? (f = 1, n = 128, g = d - 192) : this.inRange(d, 224, 239) ? (f = 2, n = 2048, g = d - 224) : this.inRange(d, 240, 244) ? (f = 3, n = 65536, g = d - 240) : this.decoderError(!1), g *= Math.pow(64, f), d = null);
  5977. else if (this.inRange(d, 128, 191)) if (h += 1, g += (d - 128) * Math.pow(64, f - h), h !== f) d = null;
  5978. else {
  5979. var p = g,
  5980. q = n,
  5981. n = h = f = g = 0;
  5982. d = this.inRange(p, q, 1114111) && !this.inRange(p, 55296, 57343) ? p: this.decoderError(!1, d)
  5983. } else n = h = f = g = 0,
  5984. b--,
  5985. d = this.decoderError(!1, d);
  5986. null !== d && d !== this.EOF_code_point && (65535 >= d ? 0 < d && (c += String.fromCharCode(d)) : (d -= 65536, c += String.fromCharCode(55296 + (d >> 10 & 1023)), c += String.fromCharCode(56320 + (d & 1023))))
  5987. }
  5988. return c
  5989. };
  5990. a.prototype.encoderError = function(a) {
  5991. throw b.getString(1026, a);
  5992. };
  5993. a.prototype.decoderError = function(a, c) {
  5994. if (a) throw b.getString(1027);
  5995. return c || 65533
  5996. };
  5997. a.prototype.inRange = function(a, b, c) {
  5998. return b <= a && a <= c
  5999. };
  6000. a.prototype.div = function(a, b) {
  6001. return Math.floor(a / b)
  6002. };
  6003. a.prototype.stringToCodePoints = function(a) {
  6004. for (var b = [], c = 0, d = a.length; c < a.length;) {
  6005. var g = a.charCodeAt(c);
  6006. if (this.inRange(g, 55296, 57343)) if (this.inRange(g, 56320, 57343)) b.push(65533);
  6007. else if (c === d - 1) b.push(65533);
  6008. else {
  6009. var f = a.charCodeAt(c + 1);
  6010. this.inRange(f, 56320, 57343) ? (g &= 1023, f &= 1023, c += 1, b.push(65536 + (g << 10) + f)) : b.push(65533)
  6011. } else b.push(g);
  6012. c += 1
  6013. }
  6014. return b
  6015. };
  6016. a.SIZE_OF_BOOLEAN = 1;
  6017. a.SIZE_OF_INT8 = 1;
  6018. a.SIZE_OF_INT16 = 2;
  6019. a.SIZE_OF_INT32 = 4;
  6020. a.SIZE_OF_UINT8 = 1;
  6021. a.SIZE_OF_UINT16 = 2;
  6022. a.SIZE_OF_UINT32 = 4;
  6023. a.SIZE_OF_FLOAT32 = 4;
  6024. a.SIZE_OF_FLOAT64 = 8;
  6025. return a
  6026. } ();
  6027. b.ByteArray = c;
  6028. c.prototype.__class__ = "egret.ByteArray"
  6029. })(egret || (egret = {}));
  6030. __extends = this.__extends ||
  6031. function(b, d) {
  6032. function c() {
  6033. this.constructor = b
  6034. }
  6035. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6036. c.prototype = d.prototype;
  6037. b.prototype = new c
  6038. }; (function(b) {
  6039. var d = function(c) {
  6040. function a(a, b, d) {
  6041. c.call(this);
  6042. this._target = null;
  6043. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  6044. this._actions = this._steps = this.pluginData = null;
  6045. this.paused = !1;
  6046. this.duration = 0;
  6047. this._prevPos = -1;
  6048. this.position = null;
  6049. this._stepPosition = this._prevPosition = 0;
  6050. this.passive = !1;
  6051. this.initialize(a, b, d)
  6052. }
  6053. __extends(a, c);
  6054. a.get = function(e, b, c, d) {
  6055. void 0 === b && (b = null);
  6056. void 0 === c && (c = null);
  6057. void 0 === d && (d = !1);
  6058. d && a.removeTweens(e);
  6059. return new a(e, b, c)
  6060. };
  6061. a.removeTweens = function(e) {
  6062. if (e.tween_count) {
  6063. for (var b = a._tweens,
  6064. c = b.length - 1; 0 <= c; c--) b[c]._target == e && (b[c].paused = !0, b.splice(c, 1));
  6065. e.tween_count = 0
  6066. }
  6067. };
  6068. a.pauseTweens = function(a) {
  6069. if (a.tween_count) for (var c = b.Tween._tweens,
  6070. d = c.length - 1; 0 <= d; d--) c[d]._target == a && (c[d].paused = !0)
  6071. };
  6072. a.resumeTweens = function(a) {
  6073. if (a.tween_count) for (var c = b.Tween._tweens,
  6074. d = c.length - 1; 0 <= d; d--) c[d]._target == a && (c[d].paused = !1)
  6075. };
  6076. a.tick = function(e, b) {
  6077. void 0 === b && (b = !1);
  6078. for (var c = a._tweens.concat(), d = c.length - 1; 0 <= d; d--) {
  6079. var g = c[d];
  6080. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : e)
  6081. }
  6082. };
  6083. a._register = function(e, c) {
  6084. var d = e._target,
  6085. k = a._tweens;
  6086. if (c) d && (d.tween_count = 0 < d.tween_count ? d.tween_count + 1 : 1),
  6087. k.push(e),
  6088. a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  6089. else for (d && d.tween_count--, d = k.length; d--;) if (k[d] == e) {
  6090. k.splice(d, 1);
  6091. break
  6092. }
  6093. };
  6094. a.removeAllTweens = function() {
  6095. for (var e = a._tweens,
  6096. b = 0,
  6097. c = e.length; b < c; b++) {
  6098. var d = e[b];
  6099. d.paused = !0;
  6100. d._target.tweenjs_count = 0
  6101. }
  6102. e.length = 0
  6103. };
  6104. a.prototype.initialize = function(e, b, c) {
  6105. this._target = e;
  6106. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
  6107. this.pluginData = c || {};
  6108. this._curQueueProps = {};
  6109. this._initQueueProps = {};
  6110. this._steps = [];
  6111. this._actions = [];
  6112. b && b.paused ? this.paused = !0 : a._register(this, !0);
  6113. b && null != b.position && this.setPosition(b.position, a.NONE)
  6114. };
  6115. a.prototype.setPosition = function(a, b) {
  6116. void 0 === b && (b = 1);
  6117. 0 > a && (a = 0);
  6118. var c = a,
  6119. d = !1;
  6120. c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
  6121. if (c == this._prevPos) return d;
  6122. var g = this._prevPos;
  6123. this.position = this._prevPos = c;
  6124. this._prevPosition = a;
  6125. if (this._target) if (d) this._updateTargetProps(null, 1);
  6126. else if (0 < this._steps.length) {
  6127. for (var f = 0,
  6128. h = this._steps.length; f < h && !(this._steps[f].t > c); f++);
  6129. f = this._steps[f - 1];
  6130. this._updateTargetProps(f, (this._stepPosition = c - f.t) / f.d)
  6131. }
  6132. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == b && c < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, c, !0)) : this._runActions(g, c));
  6133. d && this.setPaused(!0);
  6134. this.dispatchEventWith("change");
  6135. return d
  6136. };
  6137. a.prototype._runActions = function(a, b, c) {
  6138. void 0 === c && (c = !1);
  6139. var d = a,
  6140. g = b,
  6141. f = -1,
  6142. h = this._actions.length,
  6143. n = 1;
  6144. a > b && (d = b, g = a, f = h, h = n = -1);
  6145. for (; (f += n) != h;) {
  6146. b = this._actions[f];
  6147. var p = b.t; (p == g || p > d && p < g || c && p == a) && b.f.apply(b.o, b.p)
  6148. }
  6149. };
  6150. a.prototype._updateTargetProps = function(e, b) {
  6151. var c, d, g, f;
  6152. if (e || 1 != b) {
  6153. if (this.passive = !!e.v) return;
  6154. e.e && (b = e.e(b, 0, 1, 1));
  6155. c = e.p0;
  6156. d = e.p1
  6157. } else this.passive = !1,
  6158. c = d = this._curQueueProps;
  6159. for (var h in this._initQueueProps) {
  6160. null == (g = c[h]) && (c[h] = g = this._initQueueProps[h]);
  6161. null == (f = d[h]) && (d[h] = f = g);
  6162. g = g == f || 0 == b || 1 == b || "number" != typeof g ? 1 == b ? f: g: g + (f - g) * b;
  6163. var n = !1;
  6164. if (f = a._plugins[h]) for (var p = 0,
  6165. q = f.length; p < q; p++) {
  6166. var r = f[p].tween(this, h, g, c, d, b, !!e && c == d, !e);
  6167. r == a.IGNORE ? n = !0 : g = r
  6168. }
  6169. n || (this._target[h] = g)
  6170. }
  6171. };
  6172. a.prototype.setPaused = function(e) {
  6173. this.paused = e;
  6174. a._register(this, !e);
  6175. return this
  6176. };
  6177. a.prototype._cloneProps = function(a) {
  6178. var b = {},
  6179. c;
  6180. for (c in a) b[c] = a[c];
  6181. return b
  6182. };
  6183. a.prototype._addStep = function(a) {
  6184. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  6185. return this
  6186. };
  6187. a.prototype._appendQueueProps = function(e) {
  6188. var b, c, d, g, f, h;
  6189. for (h in e) if (void 0 === this._initQueueProps[h]) {
  6190. c = this._target[h];
  6191. if (b = a._plugins[h]) for (d = 0, g = b.length; d < g; d++) c = b[d].init(this, h, c);
  6192. this._initQueueProps[h] = this._curQueueProps[h] = void 0 === c ? null: c
  6193. }
  6194. for (h in e) {
  6195. c = this._curQueueProps[h];
  6196. if (b = a._plugins[h]) for (f = f || {},
  6197. d = 0, g = b.length; d < g; d++) b[d].step && b[d].step(this, h, c, e[h], f);
  6198. this._curQueueProps[h] = e[h]
  6199. }
  6200. f && this._appendQueueProps(f);
  6201. return this._curQueueProps
  6202. };
  6203. a.prototype._addAction = function(a) {
  6204. a.t = this.duration;
  6205. this._actions.push(a);
  6206. return this
  6207. };
  6208. a.prototype._set = function(a, b) {
  6209. for (var c in a) b[c] = a[c]
  6210. };
  6211. a.prototype.wait = function(a, b) {
  6212. if (null == a || 0 >= a) return this;
  6213. var c = this._cloneProps(this._curQueueProps);
  6214. return this._addStep({
  6215. d: a,
  6216. p0: c,
  6217. p1: c,
  6218. v: b
  6219. })
  6220. };
  6221. a.prototype.to = function(a, b, c) {
  6222. void 0 === c && (c = void 0);
  6223. if (isNaN(b) || 0 > b) b = 0;
  6224. return this._addStep({
  6225. d: b || 0,
  6226. p0: this._cloneProps(this._curQueueProps),
  6227. e: c,
  6228. p1: this._cloneProps(this._appendQueueProps(a))
  6229. })
  6230. };
  6231. a.prototype.call = function(a, b, c) {
  6232. void 0 === b && (b = void 0);
  6233. void 0 === c && (c = void 0);
  6234. return this._addAction({
  6235. f: a,
  6236. p: c ? c: [],
  6237. o: b ? b: this._target
  6238. })
  6239. };
  6240. a.prototype.set = function(a, b) {
  6241. void 0 === b && (b = null);
  6242. return this._addAction({
  6243. f: this._set,
  6244. o: this,
  6245. p: [a, b ? b: this._target]
  6246. })
  6247. };
  6248. a.prototype.play = function(a) {
  6249. a || (a = this);
  6250. return this.call(a.setPaused, a, [!1])
  6251. };
  6252. a.prototype.pause = function(a) {
  6253. a || (a = this);
  6254. return this.call(a.setPaused, a, [!0])
  6255. };
  6256. a.prototype.tick = function(a) {
  6257. this.paused || this.setPosition(this._prevPosition + a)
  6258. };
  6259. a.NONE = 0;
  6260. a.LOOP = 1;
  6261. a.REVERSE = 2;
  6262. a._tweens = [];
  6263. a.IGNORE = {};
  6264. a._plugins = {};
  6265. a._inited = !1;
  6266. return a
  6267. } (b.EventDispatcher);
  6268. b.Tween = d;
  6269. d.prototype.__class__ = "egret.Tween"
  6270. })(egret || (egret = {})); (function(b) {
  6271. var d = function() {
  6272. function c() {
  6273. b.Logger.fatalWithErrorId(1014)
  6274. }
  6275. c.get = function(a) { - 1 > a && (a = -1);
  6276. 1 < a && (a = 1);
  6277. return function(e) {
  6278. return 0 == a ? e: 0 > a ? e * (e * -a + 1 + a) : e * ((2 - e) * a + (1 - a))
  6279. }
  6280. };
  6281. c.getPowIn = function(a) {
  6282. return function(e) {
  6283. return Math.pow(e, a)
  6284. }
  6285. };
  6286. c.getPowOut = function(a) {
  6287. return function(e) {
  6288. return 1 - Math.pow(1 - e, a)
  6289. }
  6290. };
  6291. c.getPowInOut = function(a) {
  6292. return function(e) {
  6293. return 1 > (e *= 2) ? 0.5 * Math.pow(e, a) : 1 - 0.5 * Math.abs(Math.pow(2 - e, a))
  6294. }
  6295. };
  6296. c.sineIn = function(a) {
  6297. return 1 - Math.cos(a * Math.PI / 2)
  6298. };
  6299. c.sineOut = function(a) {
  6300. return Math.sin(a * Math.PI / 2)
  6301. };
  6302. c.sineInOut = function(a) {
  6303. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  6304. };
  6305. c.getBackIn = function(a) {
  6306. return function(e) {
  6307. return e * e * ((a + 1) * e - a)
  6308. }
  6309. };
  6310. c.getBackOut = function(a) {
  6311. return function(e) {
  6312. return--e * e * ((a + 1) * e + a) + 1
  6313. }
  6314. };
  6315. c.getBackInOut = function(a) {
  6316. a *= 1.525;
  6317. return function(e) {
  6318. return 1 > (e *= 2) ? 0.5 * e * e * ((a + 1) * e - a) : 0.5 * ((e -= 2) * e * ((a + 1) * e + a) + 2)
  6319. }
  6320. };
  6321. c.circIn = function(a) {
  6322. return - (Math.sqrt(1 - a * a) - 1)
  6323. };
  6324. c.circOut = function(a) {
  6325. return Math.sqrt(1 - --a * a)
  6326. };
  6327. c.circInOut = function(a) {
  6328. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  6329. };
  6330. c.bounceIn = function(a) {
  6331. return 1 - c.bounceOut(1 - a)
  6332. };
  6333. c.bounceOut = function(a) {
  6334. 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
  6335. };
  6336. c.bounceInOut = function(a) {
  6337. return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
  6338. };
  6339. c.getElasticIn = function(a, e) {
  6340. var b = 2 * Math.PI;
  6341. return function(c) {
  6342. if (0 == c || 1 == c) return c;
  6343. var d = e / b * Math.asin(1 / a);
  6344. return - (a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - d) * b / e))
  6345. }
  6346. };
  6347. c.getElasticOut = function(a, e) {
  6348. var b = 2 * Math.PI;
  6349. return function(c) {
  6350. if (0 == c || 1 == c) return c;
  6351. var d = e / b * Math.asin(1 / a);
  6352. return a * Math.pow(2, -10 * c) * Math.sin((c - d) * b / e) + 1
  6353. }
  6354. };
  6355. c.getElasticInOut = function(a, e) {
  6356. var b = 2 * Math.PI;
  6357. return function(c) {
  6358. var d = e / b * Math.asin(1 / a);
  6359. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - d) * b / e) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - d) * b / e) * 0.5 + 1
  6360. }
  6361. };
  6362. c.quadIn = c.getPowIn(2);
  6363. c.quadOut = c.getPowOut(2);
  6364. c.quadInOut = c.getPowInOut(2);
  6365. c.cubicIn = c.getPowIn(3);
  6366. c.cubicOut = c.getPowOut(3);
  6367. c.cubicInOut = c.getPowInOut(3);
  6368. c.quartIn = c.getPowIn(4);
  6369. c.quartOut = c.getPowOut(4);
  6370. c.quartInOut = c.getPowInOut(4);
  6371. c.quintIn = c.getPowIn(5);
  6372. c.quintOut = c.getPowOut(5);
  6373. c.quintInOut = c.getPowInOut(5);
  6374. c.backIn = c.getBackIn(1.7);
  6375. c.backOut = c.getBackOut(1.7);
  6376. c.backInOut = c.getBackInOut(1.7);
  6377. c.elasticIn = c.getElasticIn(1, 0.3);
  6378. c.elasticOut = c.getElasticOut(1, 0.3);
  6379. c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
  6380. return c
  6381. } ();
  6382. b.Ease = d;
  6383. d.prototype.__class__ = "egret.Ease"
  6384. })(egret || (egret = {})); (function(b) {
  6385. var d = function() {
  6386. function b() {
  6387. this.path = "";
  6388. this.audio = null;
  6389. this.type = b.EFFECT
  6390. }
  6391. b.prototype.play = function(a) {
  6392. void 0 === a && (a = !1);
  6393. var e = this.audio;
  6394. e && (isNaN(e.duration) || (e.currentTime = 0), e.loop = a, e.play())
  6395. };
  6396. b.prototype.pause = function() {
  6397. var a = this.audio;
  6398. a && a.pause()
  6399. };
  6400. b.prototype.load = function() {
  6401. var a = this.audio;
  6402. a && a.load()
  6403. };
  6404. b.prototype.addEventListener = function(a, e) {
  6405. this.audio && this.audio.addEventListener(a, e, !1)
  6406. };
  6407. b.prototype.removeEventListener = function(a, e) {
  6408. this.audio && this.audio.removeEventListener(a, e, !1)
  6409. };
  6410. b.prototype.setVolume = function(a) {
  6411. var e = this.audio;
  6412. e && (e.volume = a)
  6413. };
  6414. b.prototype.getVolume = function() {
  6415. return this.audio ? this.audio.volume: 0
  6416. };
  6417. b.prototype.preload = function(a) {
  6418. this.type = a
  6419. };
  6420. b.prototype._setAudio = function(a) {
  6421. this.audio = a
  6422. };
  6423. b.MUSIC = "music";
  6424. b.EFFECT = "effect";
  6425. return b
  6426. } ();
  6427. b.Sound = d;
  6428. d.prototype.__class__ = "egret.Sound"
  6429. })(egret || (egret = {})); (function(b) {
  6430. var d = function() {
  6431. function b() {}
  6432. b.isNumber = function(a) {
  6433. return "number" === typeof a && !isNaN(a)
  6434. };
  6435. b.sin = function(a) {
  6436. a = Math.round(a);
  6437. a %= 360;
  6438. 0 > a && (a += 360);
  6439. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  6440. };
  6441. b.cos = function(a) {
  6442. a = Math.round(a);
  6443. a %= 360;
  6444. 0 > a && (a += 360);
  6445. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  6446. };
  6447. return b
  6448. } ();
  6449. b.NumberUtils = d;
  6450. d.prototype.__class__ = "egret.NumberUtils"
  6451. })(egret || (egret = {}));
  6452. for (var egret_sin_map = {},
  6453. egret_cos_map = {},
  6454. i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD),
  6455. egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  6456. Function.prototype.bind || (Function.prototype.bind = function(b) {
  6457. if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
  6458. var d = Array.prototype.slice.call(arguments, 1),
  6459. c = this,
  6460. a = function() {},
  6461. e = function() {
  6462. return c.apply(this instanceof a && b ? this: b, d.concat(Array.prototype.slice.call(arguments)))
  6463. };
  6464. a.prototype = this.prototype;
  6465. e.prototype = new a;
  6466. return e
  6467. });
  6468. __extends = this.__extends ||
  6469. function(b, d) {
  6470. function c() {
  6471. this.constructor = b
  6472. }
  6473. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6474. c.prototype = d.prototype;
  6475. b.prototype = new c
  6476. }; (function(b) {
  6477. var d = function(c) {
  6478. function a(b) {
  6479. void 0 === b && (b = 60);
  6480. c.call(this);
  6481. this.frameRate = b;
  6482. this._time = 0;
  6483. this._requestAnimationId = NaN;
  6484. this._isActivate = !0;
  6485. 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 || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  6486. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  6487. return window.setTimeout(a, 1E3 / b)
  6488. });
  6489. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  6490. return window.clearTimeout(a)
  6491. });
  6492. a.instance = this;
  6493. this.registerListener()
  6494. }
  6495. __extends(a, c);
  6496. a.prototype.enterFrame = function() {
  6497. var e = a.instance,
  6498. c = a._thisObject,
  6499. d = a._callback,
  6500. k = b.getTimer(),
  6501. g = k - e._time;
  6502. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  6503. d.call(c, g);
  6504. e._time = k
  6505. };
  6506. a.prototype.executeMainLoop = function(b, c) {
  6507. a._callback = b;
  6508. a._thisObject = c;
  6509. this.enterFrame()
  6510. };
  6511. a.prototype.reset = function() {
  6512. var e = a.instance;
  6513. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  6514. };
  6515. a.prototype.registerListener = function() {
  6516. var e = this,
  6517. c = function() {
  6518. e._isActivate && (e._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  6519. },
  6520. d = function() {
  6521. e._isActivate || (e._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  6522. },
  6523. k = function() {
  6524. document[g] ? c() : d()
  6525. };
  6526. window.addEventListener("focus", d, !1);
  6527. window.addEventListener("blur", c, !1);
  6528. var g, f;
  6529. "undefined" !== typeof document.hidden ? (g = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (g = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (g = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  6530. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", d, !1), window.addEventListener("pagehide", c, !1));
  6531. g && f && document.addEventListener(f, k, !1)
  6532. };
  6533. a.instance = null;
  6534. a.requestAnimationFrame = null;
  6535. a.cancelAnimationFrame = null;
  6536. a._thisObject = null;
  6537. a._callback = null;
  6538. return a
  6539. } (b.DeviceContext);
  6540. b.HTML5DeviceContext = d;
  6541. d.prototype.__class__ = "egret.HTML5DeviceContext"
  6542. })(egret || (egret = {}));
  6543. var egret_html5_localStorage; (function(b) {
  6544. b.getItem = function(b) {
  6545. return window.localStorage.getItem(b)
  6546. };
  6547. b.setItem = function(b, c) {
  6548. try {
  6549. return window.localStorage.setItem(b, c),
  6550. !0
  6551. } catch(a) {
  6552. return egret.Logger.infoWithErrorId(1018, b, c),
  6553. !1
  6554. }
  6555. };
  6556. b.removeItem = function(b) {
  6557. window.localStorage.removeItem(b)
  6558. };
  6559. b.clear = function() {
  6560. window.localStorage.clear()
  6561. };
  6562. b.init = function() {
  6563. for (var d in b) egret.localStorage[d] = b[d]
  6564. }
  6565. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  6566. egret_html5_localStorage.init();
  6567. __extends = this.__extends ||
  6568. function(b, d) {
  6569. function c() {
  6570. this.constructor = b
  6571. }
  6572. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6573. c.prototype = d.prototype;
  6574. b.prototype = new c
  6575. }; (function(b) {
  6576. var d = function(c) {
  6577. function a(a, b) {
  6578. void 0 === b && (b = !0);
  6579. c.call(this);
  6580. this.useCacheCanvas = b;
  6581. this.canvas = a || this.createCanvas();
  6582. this.canvasContext = this.canvas.getContext("2d");
  6583. b ? (this._cacheCanvas = document.createElement("canvas"), this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height, this.drawCanvasContext = this._cacheCanvasContext = this._cacheCanvas.getContext("2d")) : this.drawCanvasContext = this.canvasContext;
  6584. this.onResize();
  6585. var d = this.drawCanvasContext.setTransform,
  6586. k = this;
  6587. this.drawCanvasContext.setTransform = function(a, b, e, c, l, q) {
  6588. k._matrixA = a;
  6589. k._matrixB = b;
  6590. k._matrixC = e;
  6591. k._matrixD = c;
  6592. k._matrixTx = l;
  6593. k._matrixTy = q;
  6594. d.call(k.drawCanvasContext, a, b, e, c, l, q)
  6595. };
  6596. this._matrixA = 1;
  6597. this._matrixC = this._matrixB = 0;
  6598. this._matrixD = 1;
  6599. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  6600. this.initBlendMode()
  6601. }
  6602. __extends(a, c);
  6603. a.prototype.createCanvas = function() {
  6604. var a = b.Browser.getInstance().$("#egretCanvas");
  6605. if (!a) {
  6606. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  6607. a = b.Browser.getInstance().$new("canvas");
  6608. a.id = "egretCanvas";
  6609. c.appendChild(a)
  6610. }
  6611. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  6612. return a
  6613. };
  6614. a.prototype.onResize = function() {
  6615. if (this.canvas) {
  6616. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  6617. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  6618. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  6619. this.canvas.style.width = a.style.width;
  6620. this.canvas.style.height = a.style.height;
  6621. this.useCacheCanvas && (this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height);
  6622. this.drawCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6623. this.drawCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6624. this.drawCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  6625. this.drawCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  6626. }
  6627. };
  6628. a.prototype.clearScreen = function() {
  6629. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, d = a.length; c < d; c++) {
  6630. var k = a[c];
  6631. this.clearRect(k.x, k.y, k.width, k.height)
  6632. }
  6633. a = b.MainContext.instance.stage;
  6634. this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  6635. this.renderCost = 0
  6636. };
  6637. a.prototype.clearRect = function(a, b, c, d) {
  6638. this.canvasContext.clearRect(a, b, c, d)
  6639. };
  6640. a.prototype.drawImage = function(a, d, m, k, g, f, h, n, p, q) {
  6641. void 0 === q && (q = void 0);
  6642. var r = a._bitmapData;
  6643. f += this._transformTx;
  6644. h += this._transformTy;
  6645. var t = b.getTimer();
  6646. void 0 === q ? this.drawCanvasContext.drawImage(r, d, m, k, g, f, h, n, p) : this.drawRepeatImage(a, d, m, k, g, f, h, n, p, q);
  6647. c.prototype.drawImage.call(this, a, d, m, k, g, f, h, n, p, q);
  6648. this.renderCost += b.getTimer() - t
  6649. };
  6650. a.prototype.drawRepeatImage = function(a, c, d, k, g, f, h, n, p, q) {
  6651. if (void 0 === a.pattern) {
  6652. var r = b.MainContext.instance.rendererContext._texture_scale_factor,
  6653. t = a._bitmapData,
  6654. s = t;
  6655. if (t.width != k || t.height != g || 1 != r) s = document.createElement("canvas"),
  6656. s.width = k * r,
  6657. s.height = g * r,
  6658. s.getContext("2d").drawImage(t, c, d, k, g, 0, 0, k * r, g * r);
  6659. c = this.drawCanvasContext.createPattern(s, q);
  6660. a.pattern = c
  6661. }
  6662. this.drawCanvasContext.fillStyle = a.pattern;
  6663. this.drawCanvasContext.translate(f, h);
  6664. this.drawCanvasContext.fillRect(0, 0, n, p);
  6665. this.drawCanvasContext.translate( - f, -h)
  6666. };
  6667. a.prototype.setTransform = function(a) {
  6668. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  6669. };
  6670. a.prototype.setAlpha = function(a, c) {
  6671. this.drawCanvasContext.globalAlpha = a;
  6672. c ? (this.blendValue = this.blendModes[c], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
  6673. };
  6674. a.prototype.initBlendMode = function() {
  6675. this.blendModes = {};
  6676. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  6677. this.blendModes[b.BlendMode.ADD] = "lighter";
  6678. this.blendModes[b.BlendMode.ERASE] = "destination-out";
  6679. this.blendModes[b.BlendMode.ERASE_REVERSE] = "destination-in"
  6680. };
  6681. a.prototype.setupFont = function(a, b) {
  6682. void 0 === b && (b = null);
  6683. b = b || {};
  6684. var c = null == b.size ? a._size: b.size,
  6685. d = null == b.fontFamily ? a._fontFamily: b.fontFamily,
  6686. g = this.drawCanvasContext,
  6687. f = (null == b.italic ? a._italic: b.italic) ? "italic ": "normal ",
  6688. f = f + ((null == b.bold ? a._bold: b.bold) ? "bold ": "normal ");
  6689. g.font = f + (c + "px " + d);
  6690. g.textAlign = "left";
  6691. g.textBaseline = "middle"
  6692. };
  6693. a.prototype.measureText = function(a) {
  6694. return this.drawCanvasContext.measureText(a).width
  6695. };
  6696. a.prototype.drawText = function(a, d, m, k, g, f) {
  6697. void 0 === f && (f = null);
  6698. this.setupFont(a, f);
  6699. f = f || {};
  6700. var h;
  6701. h = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  6702. var n;
  6703. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  6704. var p;
  6705. p = null != f.stroke ? f.stroke: a._stroke;
  6706. var q = this.drawCanvasContext;
  6707. q.fillStyle = h;
  6708. q.strokeStyle = n;
  6709. p && (q.lineWidth = 2 * p, q.strokeText(d, m + this._transformTx, k + this._transformTy, g || 65535));
  6710. q.fillText(d, m + this._transformTx, k + this._transformTy, g || 65535);
  6711. c.prototype.drawText.call(this, a, d, m, k, g, f)
  6712. };
  6713. a.prototype.strokeRect = function(a, b, c, d, g) {
  6714. this.drawCanvasContext.strokeStyle = g;
  6715. this.drawCanvasContext.strokeRect(a, b, c, d)
  6716. };
  6717. a.prototype.pushMask = function(a) {
  6718. this.drawCanvasContext.save();
  6719. this.drawCanvasContext.beginPath();
  6720. this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  6721. this.drawCanvasContext.clip();
  6722. this.drawCanvasContext.closePath()
  6723. };
  6724. a.prototype.popMask = function() {
  6725. this.drawCanvasContext.restore();
  6726. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  6727. };
  6728. a.prototype.onRenderStart = function() {
  6729. this.drawCanvasContext.save()
  6730. };
  6731. a.prototype.onRenderFinish = function() {
  6732. this.drawCanvasContext.restore();
  6733. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  6734. if (this.useCacheCanvas) for (var a = this._cacheCanvas.width,
  6735. c = this._cacheCanvas.height,
  6736. d = b.RenderFilter.getInstance().getDrawAreaList(), k = 0, g = d.length; k < g; k++) {
  6737. var f = d[k],
  6738. h = f.x,
  6739. n = f.y,
  6740. p = f.width,
  6741. f = f.height;
  6742. h + p > a && (p = a - h);
  6743. n + f > c && (f = c - n);
  6744. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, h, n, p, f, h, n, p, f)
  6745. }
  6746. };
  6747. return a
  6748. } (b.RendererContext);
  6749. b.HTML5CanvasRenderer = d;
  6750. d.prototype.__class__ = "egret.HTML5CanvasRenderer"
  6751. })(egret || (egret = {}));
  6752. var egret_h5_graphics; (function(b) {
  6753. b.beginFill = function(b, a) {
  6754. void 0 === a && (a = 1);
  6755. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  6756. this.fillStyleColor = e;
  6757. this._pushCommand(new d(this._setStyle, this, [e]))
  6758. };
  6759. b.drawRect = function(b, a, e, l) {
  6760. this._pushCommand(new d(function(a, b, e, c) {
  6761. var d = this.renderContext;
  6762. this.canvasContext.beginPath();
  6763. this.canvasContext.rect(d._transformTx + a, d._transformTy + b, e, c);
  6764. this.canvasContext.closePath()
  6765. },
  6766. this, [b, a, e, l]));
  6767. this._fill();
  6768. this.checkRect(b, a, e, l)
  6769. };
  6770. b.drawCircle = function(b, a, e) {
  6771. this._pushCommand(new d(function(a, b, e) {
  6772. var c = this.renderContext;
  6773. this.canvasContext.beginPath();
  6774. this.canvasContext.arc(c._transformTx + a, c._transformTy + b, e, 0, 2 * Math.PI);
  6775. this.canvasContext.closePath()
  6776. },
  6777. this, [b, a, e]));
  6778. this._fill();
  6779. this.checkRect(b - e, a - e, 2 * e, 2 * e)
  6780. };
  6781. b.drawRoundRect = function(b, a, e, l, m, k) {
  6782. this._pushCommand(new d(function(a, b, e, c, d, l) {
  6783. var m = this.renderContext;
  6784. a = m._transformTx + a;
  6785. b = m._transformTy + b;
  6786. d /= 2;
  6787. l = l ? l / 2 : d;
  6788. e = a + e;
  6789. c = b + c;
  6790. m = c - l;
  6791. this.canvasContext.beginPath();
  6792. this.canvasContext.moveTo(e, m);
  6793. this.canvasContext.quadraticCurveTo(e, c, e - d, c);
  6794. this.canvasContext.lineTo(a + d, c);
  6795. this.canvasContext.quadraticCurveTo(a, c, a, c - l);
  6796. this.canvasContext.lineTo(a, b + l);
  6797. this.canvasContext.quadraticCurveTo(a, b, a + d, b);
  6798. this.canvasContext.lineTo(e - d, b);
  6799. this.canvasContext.quadraticCurveTo(e, b, e, b + l);
  6800. this.canvasContext.lineTo(e, m);
  6801. this.canvasContext.closePath()
  6802. },
  6803. this, [b, a, e, l, m, k]));
  6804. this._fill();
  6805. this.checkRect(b, a, e, l)
  6806. };
  6807. b.drawEllipse = function(b, a, e, l) {
  6808. this._pushCommand(new d(function(a, b, e, c) {
  6809. var d = this.renderContext;
  6810. this.canvasContext.save();
  6811. a = d._transformTx + a;
  6812. b = d._transformTy + b;
  6813. var d = e > c ? e: c,
  6814. l = e / d;
  6815. c /= d;
  6816. this.canvasContext.scale(l, c);
  6817. this.canvasContext.beginPath();
  6818. this.canvasContext.moveTo((a + e) / l, b / c);
  6819. this.canvasContext.arc(a / l, b / c, d, 0, 2 * Math.PI);
  6820. this.canvasContext.closePath();
  6821. this.canvasContext.restore();
  6822. this.canvasContext.stroke()
  6823. },
  6824. this, [b, a, e, l]));
  6825. this._fill();
  6826. this.checkRect(b - e, a - l, 2 * e, 2 * l)
  6827. };
  6828. b.lineStyle = function(b, a, e, l, m, k, g, f) {
  6829. void 0 === b && (b = NaN);
  6830. void 0 === a && (a = 0);
  6831. void 0 === e && (e = 1);
  6832. void 0 === l && (l = !1);
  6833. void 0 === m && (m = "normal");
  6834. void 0 === k && (k = null);
  6835. void 0 === g && (g = null);
  6836. void 0 === f && (f = 3);
  6837. this.strokeStyleColor && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand));
  6838. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  6839. this._pushCommand(new d(function(a, b) {
  6840. this.canvasContext.lineWidth = a;
  6841. this.canvasContext.strokeStyle = b;
  6842. this.canvasContext.beginPath()
  6843. },
  6844. this, [b, a]));
  6845. this.moveTo(this.lineX, this.lineY)
  6846. };
  6847. b.lineTo = function(b, a) {
  6848. this._pushCommand(new d(function(a, b) {
  6849. var c = this.renderContext;
  6850. this.canvasContext.lineTo(c._transformTx + a, c._transformTy + b)
  6851. },
  6852. this, [b, a]));
  6853. this.checkPoint(this.lineX, this.lineY);
  6854. this.lineX = b;
  6855. this.lineY = a;
  6856. this.checkPoint(b, a)
  6857. };
  6858. b.curveTo = function(b, a, e, l) {
  6859. this._pushCommand(new d(function(a, b, e, c) {
  6860. var d = this.renderContext;
  6861. this.canvasContext.quadraticCurveTo(d._transformTx + a, d._transformTy + b, d._transformTx + e, d._transformTy + c)
  6862. },
  6863. this, [b, a, e, l]));
  6864. this.checkPoint(this.lineX, this.lineY);
  6865. this.lineX = e;
  6866. this.lineY = l;
  6867. this.checkPoint(b, a);
  6868. this.checkPoint(e, l)
  6869. };
  6870. b.moveTo = function(b, a) {
  6871. this._pushCommand(new d(function(a, b) {
  6872. var c = this.renderContext;
  6873. this.canvasContext.moveTo(c._transformTx + a, c._transformTy + b)
  6874. },
  6875. this, [b, a]))
  6876. };
  6877. b.clear = function() {
  6878. this.lineY = this.lineX = this.commandQueue.length = 0;
  6879. this.fillStyleColor = this.strokeStyleColor = null;
  6880. this._dirty = !1;
  6881. this._maxY = this._maxX = this._minY = this._minX = 0;
  6882. this._firstCheck = !0
  6883. };
  6884. b.createEndFillCommand = function() {
  6885. this.endFillCommand || (this.endFillCommand = new d(function() {
  6886. this.canvasContext.fill();
  6887. this.canvasContext.closePath()
  6888. },
  6889. this, null))
  6890. };
  6891. b.endFill = function() {
  6892. null != this.fillStyleColor && this._fill()
  6893. };
  6894. b._fill = function() {
  6895. this.fillStyleColor && (this.createEndFillCommand(), this._pushCommand(this.endFillCommand), this.fillStyleColor = null)
  6896. };
  6897. b.createEndLineCommand = function() {
  6898. this.endLineCommand || (this.endLineCommand = new d(function() {
  6899. this.canvasContext.stroke();
  6900. this.canvasContext.closePath()
  6901. },
  6902. this, null))
  6903. };
  6904. b._pushCommand = function(b) {
  6905. this.commandQueue.push(b);
  6906. this._dirty = !0
  6907. };
  6908. b._draw = function(b) {
  6909. var a = this.commandQueue.length;
  6910. if (0 != a) {
  6911. this.renderContext = b;
  6912. b = this.canvasContext = this.renderContext.drawCanvasContext;
  6913. b.save();
  6914. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand), a = this.commandQueue.length);
  6915. for (var e = 0; e < a; e++) {
  6916. var d = this.commandQueue[e];
  6917. d.method.apply(d.thisObject, d.args)
  6918. }
  6919. b.restore();
  6920. this._dirty = !1
  6921. }
  6922. };
  6923. var d = function() {
  6924. return function(b, a, e) {
  6925. this.method = b;
  6926. this.thisObject = a;
  6927. this.args = e
  6928. }
  6929. } ();
  6930. d.prototype.__class__ = "egret_h5_graphics.Command";
  6931. b._setStyle = function(b) {
  6932. this.canvasContext.fillStyle = b;
  6933. this.canvasContext.beginPath()
  6934. };
  6935. b.init = function() {
  6936. for (var c in b) egret.Graphics.prototype[c] = b[c];
  6937. egret.RendererContext.createRendererContext = function(a) {
  6938. return new egret.HTML5CanvasRenderer(a, !1)
  6939. }
  6940. }
  6941. })(egret_h5_graphics || (egret_h5_graphics = {}));
  6942. egret_h5_graphics.init();
  6943. __extends = this.__extends ||
  6944. function(b, d) {
  6945. function c() {
  6946. this.constructor = b
  6947. }
  6948. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  6949. c.prototype = d.prototype;
  6950. b.prototype = new c
  6951. }; (function(b) {
  6952. var d = function(c) {
  6953. function a(a) {
  6954. c.call(this);
  6955. this.glID = this.gl = this.canvas = null;
  6956. this.size = 2E3;
  6957. this.vertices = null;
  6958. this.vertSize = 5;
  6959. this.indices = null;
  6960. this.projectionY = this.projectionX = NaN;
  6961. this.shaderManager = null;
  6962. this.contextLost = !1;
  6963. this.glContextId = 0;
  6964. this.currentBlendMode = "";
  6965. this.currentBaseTexture = null;
  6966. this.currentBatchSize = 0;
  6967. this.worldTransform = null;
  6968. this.worldAlpha = 1;
  6969. this.maskList = [];
  6970. this.maskDataFreeList = [];
  6971. this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints = this.filterType = this.colorTransformMatrix = null;
  6972. this.graphicsStyle = {};
  6973. this.canvas = a || this.createCanvas();
  6974. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  6975. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  6976. this.html5Canvas = document.createElement("canvas");
  6977. this.canvasContext = new b.HTML5CanvasRenderer(this.html5Canvas);
  6978. this.onResize();
  6979. this.projectionX = this.canvas.width / 2;
  6980. this.projectionY = -this.canvas.height / 2;
  6981. a = 6 * this.size;
  6982. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  6983. this.indices = new Uint16Array(a);
  6984. for (var d = 0,
  6985. m = 0; d < a; d += 6, m += 4) this.indices[d + 0] = m + 0,
  6986. this.indices[d + 1] = m + 1,
  6987. this.indices[d + 2] = m + 2,
  6988. this.indices[d + 3] = m + 0,
  6989. this.indices[d + 4] = m + 2,
  6990. this.indices[d + 5] = m + 3;
  6991. this.initWebGL();
  6992. this.shaderManager = new b.WebGLShaderManager(this.gl);
  6993. this.worldTransform = new b.Matrix;
  6994. this.initAll()
  6995. }
  6996. __extends(a, c);
  6997. a.prototype.onRenderFinish = function() {
  6998. this._draw()
  6999. };
  7000. a.prototype.initAll = function() {
  7001. a.isInit || (a.isInit = !0, egret_webgl_graphics.init(), b.TextField.prototype._makeBitmapCache = function() {
  7002. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  7003. var a = this.getBounds(b.Rectangle.identity);
  7004. if (0 == a.width || 0 == a.height) return this._texture_to_render = null,
  7005. !1;
  7006. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.renderContext = b.RendererContext.createRendererContext(this._bitmapData));
  7007. var c = a.width,
  7008. a = a.height,
  7009. d = b.MainContext.instance.rendererContext._texture_scale_factor,
  7010. a = a / d,
  7011. c = Math.round(c / d),
  7012. a = Math.round(a),
  7013. k = this._bitmapData;
  7014. k.width = c;
  7015. k.height = a;
  7016. k.style.width = c + "px";
  7017. k.style.height = a + "px";
  7018. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = c, this.renderContext._cacheCanvas.height = a);
  7019. this._worldTransform.identity();
  7020. this._worldTransform.a = 1 / d;
  7021. this._worldTransform.d = 1 / d;
  7022. this.renderContext.setTransform(this._worldTransform);
  7023. this.worldAlpha = 1;
  7024. var k = b.RenderFilter.getInstance(),
  7025. g = k._drawAreaList.concat();
  7026. k._drawAreaList.length = 0;
  7027. this.renderContext.clearScreen();
  7028. this.renderContext.onRenderStart();
  7029. b.RendererContext.deleteTexture(this.renderTexture);
  7030. this._colorTransform && this.renderContext.setGlobalColorTransform(this._colorTransform.matrix);
  7031. var f = this.mask || this._scrollRect;
  7032. f && this.renderContext.pushMask(f);
  7033. this._render(this.renderContext);
  7034. f && this.renderContext.popMask();
  7035. this._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7036. b.RenderTexture.identityRectangle.width = c;
  7037. b.RenderTexture.identityRectangle.height = a;
  7038. k.addDrawArea(b.RenderTexture.identityRectangle);
  7039. this.renderContext.onRenderFinish();
  7040. k._drawAreaList = g;
  7041. this.renderTexture._bitmapData = this._bitmapData;
  7042. this.renderTexture._sourceWidth = c;
  7043. this.renderTexture._sourceHeight = a;
  7044. this.renderTexture._textureWidth = this.renderTexture._sourceWidth * d;
  7045. this.renderTexture._textureHeight = this.renderTexture._sourceHeight * d;
  7046. this._texture_to_render = this.renderTexture;
  7047. return ! 0
  7048. },
  7049. b.TextField.prototype._draw = function(a) {
  7050. this.getDirty() && (this._texture_to_render = this.renderTexture, this._cacheAsBitmap = !0);
  7051. b.DisplayObject.prototype._draw.call(this, a)
  7052. },
  7053. b.RenderTexture.prototype.init = function() {
  7054. this._bitmapData = document.createElement("canvas");
  7055. this.canvasContext = this._bitmapData.getContext("2d");
  7056. this._webglBitmapData = document.createElement("canvas");
  7057. this.renderContext = new b.WebGLRenderer(this._webglBitmapData)
  7058. },
  7059. b.RenderTexture.prototype.setSize = function(a, c) {
  7060. if (this._webglBitmapData) {
  7061. var d = this._webglBitmapData;
  7062. d.width = a;
  7063. d.height = c;
  7064. d.style.width = a + "px";
  7065. d.style.height = c + "px";
  7066. this.renderContext.projectionX = a / 2;
  7067. this.renderContext.projectionY = -c / 2;
  7068. this.renderContext.viewportScale = b.MainContext.instance.rendererContext._texture_scale_factor
  7069. }
  7070. },
  7071. b.RenderTexture.prototype.end = function() {},
  7072. b.RenderTexture.prototype.drawToTexture = function(a, c, d) {
  7073. var k = c || a.getBounds(b.Rectangle.identity);
  7074. if (0 == k.width || 0 == k.height || c && (0 == c.width || 0 == c.height)) return ! 1;
  7075. "undefined" == typeof d && (d = 1);
  7076. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.canvasContext = this._bitmapData.getContext("2d"), b.RenderTexture.WebGLCanvas || (b.RenderTexture.WebGLCanvas = document.createElement("canvas"), b.RenderTexture.WebGLRenderer = new b.WebGLRenderer(b.RenderTexture.WebGLCanvas)), this._webglBitmapData = b.RenderTexture.WebGLCanvas, this.renderContext = b.RenderTexture.WebGLRenderer);
  7077. var g = k.x,
  7078. f = k.y;
  7079. c = k.width;
  7080. var k = k.height,
  7081. k = k / d,
  7082. h = b.MainContext.instance.rendererContext._texture_scale_factor;
  7083. c = Math.round(c / d);
  7084. k = Math.round(k);
  7085. this.setSize(c, k);
  7086. var n = this._bitmapData,
  7087. p = c / h * d,
  7088. q = k / h * d;
  7089. n.width = p;
  7090. n.height = q;
  7091. n.style.width = p + "px";
  7092. n.style.height = q + "px";
  7093. this.begin();
  7094. a._worldTransform.identity();
  7095. n = a._anchorOffsetX;
  7096. p = a._anchorOffsetY;
  7097. if (0 != a._anchorX || 0 != a._anchorY) n = a._anchorX * c,
  7098. p = a._anchorY * k;
  7099. this._offsetX = g + n;
  7100. this._offsetY = f + p;
  7101. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  7102. a.worldAlpha = 1;
  7103. g = b.MainContext.__use_new_draw;
  7104. b.MainContext.__use_new_draw = !1;
  7105. if (a instanceof b.DisplayObjectContainer) for (f = a._children, n = 0, p = f.length; n < p; n++) f[n]._updateTransform();
  7106. this.renderContext.setTransform(a._worldTransform);
  7107. f = b.RenderFilter.getInstance();
  7108. n = f._drawAreaList.concat();
  7109. f._drawAreaList.length = 0;
  7110. p = this.renderContext.gl;
  7111. p.viewport(0, 0, c, k);
  7112. p.bindFramebuffer(p.FRAMEBUFFER, null);
  7113. p.clearColor(0, 0, 0, 0);
  7114. p.clear(p.COLOR_BUFFER_BIT);
  7115. this.renderContext.onRenderStart();
  7116. b.RendererContext.deleteTexture(this);
  7117. a._filter && this.renderContext.setGlobalFilter(a._filter);
  7118. a._colorTransform && this.renderContext.setGlobalColorTransform(a._colorTransform.matrix); (p = a.mask || a._scrollRect) && this.renderContext.pushMask(p);
  7119. a._render(this.renderContext);
  7120. this.renderContext._draw();
  7121. b.MainContext.__use_new_draw = g;
  7122. p && this.renderContext.popMask();
  7123. a._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7124. a._filter && this.renderContext.setGlobalFilter(null);
  7125. b.RenderTexture.identityRectangle.width = c;
  7126. b.RenderTexture.identityRectangle.height = k;
  7127. f.addDrawArea(b.RenderTexture.identityRectangle);
  7128. this.renderContext.onRenderFinish();
  7129. f._drawAreaList = n;
  7130. this._sourceWidth = c / h * d;
  7131. this._sourceHeight = k / h * d;
  7132. this._textureWidth = c * d;
  7133. this._textureHeight = k * d;
  7134. this.canvasContext.drawImage(this._webglBitmapData, 0, 0, c, k, 0, 0, this._sourceWidth, this._sourceHeight);
  7135. return ! 0
  7136. })
  7137. };
  7138. a.prototype.createCanvas = function() {
  7139. var a = b.Browser.getInstance().$("#egretCanvas");
  7140. if (!a) {
  7141. var c = document.getElementById(b.StageDelegate.canvas_div_name),
  7142. a = b.Browser.getInstance().$new("canvas");
  7143. a.id = "egretCanvas";
  7144. c.appendChild(a)
  7145. }
  7146. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  7147. return a
  7148. };
  7149. a.prototype.onResize = function() {
  7150. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7151. this.canvas && (this.canvas.width = b.MainContext.instance.stage.stageWidth, this.canvas.height = b.MainContext.instance.stage.stageHeight, this.canvas.style.width = a.style.width, this.canvas.style.height = a.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
  7152. this.html5Canvas && (this.html5Canvas.width = b.MainContext.instance.stage.stageWidth, this.html5Canvas.height = b.MainContext.instance.stage.stageHeight, this.html5Canvas.style.width = a.style.width, this.html5Canvas.style.height = a.style.height)
  7153. };
  7154. a.prototype.handleContextLost = function() {
  7155. this.contextLost = !0
  7156. };
  7157. a.prototype.handleContextRestored = function() {
  7158. this.initWebGL();
  7159. this.shaderManager.setContext(this.gl);
  7160. this.contextLost = !1
  7161. };
  7162. a.prototype.initWebGL = function() {
  7163. for (var e = {},
  7164. c, d = ["experimental-webgl", "webgl"], k = 0; k < d.length; k++) {
  7165. try {
  7166. c = this.canvas.getContext(d[k], e)
  7167. } catch(g) {}
  7168. if (c) break
  7169. }
  7170. if (!c) throw Error(b.getString(1021));
  7171. a.glID++;
  7172. this.glID = a.glID;
  7173. this.setContext(c)
  7174. };
  7175. a.prototype.setContext = function(a) {
  7176. this.gl = a;
  7177. a.id = this.glContextId++;
  7178. this.vertexBuffer = a.createBuffer();
  7179. this.indexBuffer = a.createBuffer();
  7180. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7181. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  7182. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7183. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  7184. a.disable(a.DEPTH_TEST);
  7185. a.disable(a.CULL_FACE);
  7186. a.enable(a.BLEND);
  7187. a.colorMask(!0, !0, !0, !0)
  7188. };
  7189. a.prototype.start = function() {
  7190. if (!this.contextLost) {
  7191. var a = this.gl;
  7192. a.activeTexture(a.TEXTURE0);
  7193. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  7194. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  7195. var b;
  7196. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader: "blur" == this.filterType ? this.shaderManager.blurShader: this.shaderManager.defaultShader;
  7197. this.shaderManager.activateShader(b);
  7198. b.syncUniforms();
  7199. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  7200. var c = 4 * this.vertSize;
  7201. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, c, 0);
  7202. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, c, 8);
  7203. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, c, 16)
  7204. }
  7205. };
  7206. a.prototype.clearScreen = function() {
  7207. var a = this.gl;
  7208. a.colorMask(!0, !0, !0, !0);
  7209. for (var c = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, k = c.length; d < k; d++) {
  7210. var g = c[d];
  7211. a.viewport(g.x, g.y, g.width, g.height);
  7212. a.bindFramebuffer(a.FRAMEBUFFER, null);
  7213. a.clearColor(0, 0, 0, 0);
  7214. a.clear(a.COLOR_BUFFER_BIT)
  7215. }
  7216. c = b.MainContext.instance.stage;
  7217. a.viewport(0, 0, c.stageWidth, c.stageHeight);
  7218. this.renderCost = 0
  7219. };
  7220. a.prototype.setBlendMode = function(a) {
  7221. a || (a = b.BlendMode.NORMAL);
  7222. if (this.currentBlendMode != a) {
  7223. var c = b.RendererContext.blendModesForGL[a];
  7224. c && (this._draw(), this.gl.blendFunc(c[0], c[1]), this.currentBlendMode = a)
  7225. }
  7226. };
  7227. a.prototype.drawRepeatImage = function(a, c, d, k, g, f, h, n, p, q) {
  7228. q = b.MainContext.instance.rendererContext._texture_scale_factor;
  7229. k *= q;
  7230. for (g *= q; f < n; f += k) for (var r = h; r < p; r += g) {
  7231. var t = Math.min(k, n - f),
  7232. s = Math.min(g, p - r);
  7233. this.drawImage(a, c, d, t / q, s / q, f, r, t, s)
  7234. }
  7235. };
  7236. a.prototype.drawImage = function(a, b, c, d, g, f, h, n, p, q) {
  7237. void 0 === q && (q = void 0);
  7238. if (!this.contextLost) if (void 0 !== q) this.drawRepeatImage(a, b, c, d, g, f, h, n, p, q);
  7239. else {
  7240. this.createWebGLTexture(a);
  7241. q = a._bitmapData.webGLTexture[this.glID];
  7242. if (q !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(),
  7243. this.currentBaseTexture = q;
  7244. var r = this.worldTransform,
  7245. t = r.a,
  7246. s = r.b,
  7247. u = r.c,
  7248. v = r.d,
  7249. w = r.tx,
  7250. A = r.ty;
  7251. 0 == f && 0 == h || r.append(1, 0, 0, 1, f, h);
  7252. 1 == d / n && 1 == g / p || r.append(n / d, 0, 0, p / g, 0, 0);
  7253. f = r.a;
  7254. h = r.b;
  7255. n = r.c;
  7256. p = r.d;
  7257. q = r.tx;
  7258. var x = r.ty;
  7259. r.a = t;
  7260. r.b = s;
  7261. r.c = u;
  7262. r.d = v;
  7263. r.tx = w;
  7264. r.ty = A;
  7265. t = a._sourceWidth;
  7266. s = a._sourceHeight;
  7267. a = d;
  7268. r = g;
  7269. b /= t;
  7270. c /= s;
  7271. d /= t;
  7272. g /= s;
  7273. t = this.vertices;
  7274. s = 4 * this.currentBatchSize * this.vertSize;
  7275. u = this.worldAlpha;
  7276. t[s++] = q;
  7277. t[s++] = x;
  7278. t[s++] = b;
  7279. t[s++] = c;
  7280. t[s++] = u;
  7281. t[s++] = f * a + q;
  7282. t[s++] = h * a + x;
  7283. t[s++] = d + b;
  7284. t[s++] = c;
  7285. t[s++] = u;
  7286. t[s++] = f * a + n * r + q;
  7287. t[s++] = p * r + h * a + x;
  7288. t[s++] = d + b;
  7289. t[s++] = g + c;
  7290. t[s++] = u;
  7291. t[s++] = n * r + q;
  7292. t[s++] = p * r + x;
  7293. t[s++] = b;
  7294. t[s++] = g + c;
  7295. t[s++] = u;
  7296. this.currentBatchSize++
  7297. }
  7298. };
  7299. a.prototype._draw = function() {
  7300. if (0 != this.currentBatchSize && !this.contextLost) {
  7301. var a = b.getTimer();
  7302. this.start();
  7303. var c = this.gl;
  7304. c.bindTexture(c.TEXTURE_2D, this.currentBaseTexture);
  7305. var d = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  7306. c.bufferSubData(c.ARRAY_BUFFER, 0, d);
  7307. c.drawElements(c.TRIANGLES, 6 * this.currentBatchSize, c.UNSIGNED_SHORT, 0);
  7308. this.currentBatchSize = 0;
  7309. this.renderCost += b.getTimer() - a;
  7310. b.Profiler.getInstance().onDrawImage()
  7311. }
  7312. };
  7313. a.prototype.setTransform = function(a) {
  7314. var b = this.worldTransform;
  7315. b.a = a.a;
  7316. b.b = a.b;
  7317. b.c = a.c;
  7318. b.d = a.d;
  7319. b.tx = a.tx;
  7320. b.ty = a.ty
  7321. };
  7322. a.prototype.setAlpha = function(a, b) {
  7323. this.worldAlpha = a;
  7324. this.setBlendMode(b)
  7325. };
  7326. a.prototype.createWebGLTexture = function(a) {
  7327. a = a._bitmapData;
  7328. a.webGLTexture || (a.webGLTexture = {});
  7329. if (!a.webGLTexture[this.glID]) {
  7330. var b = this.gl;
  7331. a.webGLTexture[this.glID] = b.createTexture();
  7332. b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
  7333. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  7334. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
  7335. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  7336. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  7337. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  7338. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  7339. b.bindTexture(b.TEXTURE_2D, null)
  7340. }
  7341. };
  7342. a.prototype.pushMask = function(a) {
  7343. this._draw();
  7344. var b = this.gl;
  7345. 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
  7346. a = this.getScissorRect(a);
  7347. this.maskList.push(a);
  7348. this.scissor(a.x, a.y, a.width, a.height)
  7349. };
  7350. a.prototype.getScissorRect = function(a) {
  7351. var c = this.maskList[this.maskList.length - 1],
  7352. d,
  7353. k,
  7354. g;
  7355. c ? c.intersects(c) ? (d = Math.max(a.x + this.worldTransform.tx, c.x), k = Math.max(a.y + this.worldTransform.ty, c.y), g = Math.min(a.x + this.worldTransform.tx + a.width, c.x + c.width) - d, a = Math.min(a.y + this.worldTransform.ty + a.height, c.y + c.height) - k) : a = g = k = d = 0 : (d = a.x + this.worldTransform.tx, k = a.y + this.worldTransform.ty, g = a.width, a = a.height); (c = this.maskDataFreeList.pop()) ? (c.x = d, c.y = k, c.width = g, c.height = a) : c = new b.Rectangle(d, k, g, a);
  7356. return c
  7357. };
  7358. a.prototype.popMask = function() {
  7359. this._draw();
  7360. var a = this.gl,
  7361. b = this.maskList.pop();
  7362. this.maskDataFreeList.push(b);
  7363. b = this.maskList.length;
  7364. 0 != b ? (b = this.maskList[b - 1], (0 < b.width || 0 < b.height) && this.scissor(b.x, b.y, b.width, b.height)) : a.disable(a.SCISSOR_TEST)
  7365. };
  7366. a.prototype.scissor = function(a, c, d, k) {
  7367. var g = this.gl;
  7368. 0 > d && (d = 0);
  7369. 0 > k && (k = 0);
  7370. g.scissor(a, -c + b.MainContext.instance.stage.stageHeight - k, d, k)
  7371. };
  7372. a.prototype.setGlobalColorTransform = function(a) {
  7373. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  7374. a = a.concat();
  7375. var b = this.shaderManager.colorTransformShader;
  7376. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  7377. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  7378. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  7379. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  7380. b.uniforms.matrix.value = a
  7381. }
  7382. };
  7383. a.prototype.setGlobalFilter = function(a) {
  7384. this._draw();
  7385. this.setFilterProperties(a)
  7386. };
  7387. a.prototype.setFilterProperties = function(a) {
  7388. if (a) switch (this.filterType = a.type, a.type) {
  7389. case "blur":
  7390. var b = this.shaderManager.blurShader;
  7391. b.uniforms.blur.value.x = a.blurX;
  7392. b.uniforms.blur.value.y = a.blurY
  7393. } else this.filterType = null
  7394. };
  7395. a.prototype.setupFont = function(a, b) {
  7396. void 0 === b && (b = null);
  7397. this.canvasContext.setupFont(a, b)
  7398. };
  7399. a.prototype.measureText = function(a) {
  7400. return this.canvasContext.measureText(a)
  7401. };
  7402. a.prototype.renderGraphics = function(a) {
  7403. this._draw();
  7404. var b = this.gl,
  7405. c = this.shaderManager.primitiveShader;
  7406. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  7407. this.updateGraphics(a);
  7408. this.shaderManager.activateShader(c);
  7409. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  7410. b.uniformMatrix3fv(c.translationMatrix, !1, this.worldTransform.toArray(!0));
  7411. b.uniform2f(c.projectionVector, this.projectionX, -this.projectionY);
  7412. b.uniform2f(c.offsetVector, 0, 0);
  7413. b.uniform3fv(c.tintColor, [1, 1, 1]);
  7414. b.uniform1f(c.alpha, this.worldAlpha);
  7415. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7416. b.vertexAttribPointer(c.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  7417. b.vertexAttribPointer(c.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  7418. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7419. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  7420. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  7421. };
  7422. a.prototype.updateGraphics = function(a) {
  7423. var b = this.gl;
  7424. this.buildRectangle(a);
  7425. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  7426. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  7427. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  7428. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  7429. };
  7430. a.prototype.buildRectangle = function(a) {
  7431. var b = a.x,
  7432. c = a.y,
  7433. d = a.w;
  7434. a = a.h;
  7435. var g = this.graphicsStyle.a,
  7436. f = this.graphicsStyle.r * g,
  7437. h = this.graphicsStyle.g * g,
  7438. n = this.graphicsStyle.b * g,
  7439. p = this.graphicsPoints,
  7440. q = this.graphicsIndices,
  7441. r = p.length / 6;
  7442. p.push(b, c);
  7443. p.push(f, h, n, g);
  7444. p.push(b + d, c);
  7445. p.push(f, h, n, g);
  7446. p.push(b, c + a);
  7447. p.push(f, h, n, g);
  7448. p.push(b + d, c + a);
  7449. p.push(f, h, n, g);
  7450. q.push(r, r, r + 1, r + 2, r + 3, r + 3)
  7451. };
  7452. a.prototype.setGraphicsStyle = function(a, b, c, d) {
  7453. this.graphicsStyle.r = a;
  7454. this.graphicsStyle.g = b;
  7455. this.graphicsStyle.b = c;
  7456. this.graphicsStyle.a = d
  7457. };
  7458. a.glID = 0;
  7459. a.isInit = !1;
  7460. return a
  7461. } (b.RendererContext);
  7462. b.WebGLRenderer = d;
  7463. d.prototype.__class__ = "egret.WebGLRenderer"
  7464. })(egret || (egret = {}));
  7465. var egret_webgl_graphics; (function(b) {
  7466. b.beginFill = function(b, a) {
  7467. void 0 === a && (a = 1);
  7468. this._pushCommand(new d(this._setStyle, this, [(b >> 16) / 255, ((b & 65280) >> 8) / 255, (b & 255) / 255, a]))
  7469. };
  7470. b.drawRect = function(b, a, e, l) {
  7471. this._pushCommand(new d(function(a) {
  7472. this.renderContext.renderGraphics(a)
  7473. },
  7474. this, [{
  7475. x: b,
  7476. y: a,
  7477. w: e,
  7478. h: l
  7479. }]));
  7480. this.checkRect(b, a, e, l)
  7481. };
  7482. b.drawCircle = function(b, a, e) {};
  7483. b.drawRoundRect = function(b, a, e, d, m, k) {};
  7484. b.drawEllipse = function(b, a, e, d) {};
  7485. b.lineStyle = function(b, a, e, d, m, k, g, f) {};
  7486. b.lineTo = function(b, a) {};
  7487. b.curveTo = function(b, a, e, d) {};
  7488. b.moveTo = function(b, a) {};
  7489. b.clear = function() {
  7490. this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
  7491. };
  7492. b.endFill = function() {};
  7493. b._pushCommand = function(b) {
  7494. this.commandQueue.push(b)
  7495. };
  7496. b._draw = function(b) {
  7497. var a = this.commandQueue.length;
  7498. if (0 != a) for (this.renderContext = b, b = 0; b < a; b++) {
  7499. var e = this.commandQueue[b];
  7500. e.method.apply(e.thisObject, e.args)
  7501. }
  7502. };
  7503. var d = function() {
  7504. return function(b, a, e) {
  7505. this.method = b;
  7506. this.thisObject = a;
  7507. this.args = e
  7508. }
  7509. } ();
  7510. d.prototype.__class__ = "egret_webgl_graphics.Command";
  7511. b._setStyle = function(b, a, e, d) {
  7512. this.renderContext.setGraphicsStyle(b, a, e, d)
  7513. };
  7514. b.init = function() {
  7515. for (var c in b) egret.Graphics.prototype[c] = b[c]
  7516. }
  7517. })(egret_webgl_graphics || (egret_webgl_graphics = {})); (function(b) {
  7518. var d = function() {
  7519. function c() {}
  7520. c.compileProgram = function(a, e, d) {
  7521. d = c.compileFragmentShader(a, d);
  7522. e = c.compileVertexShader(a, e);
  7523. var m = a.createProgram();
  7524. a.attachShader(m, e);
  7525. a.attachShader(m, d);
  7526. a.linkProgram(m);
  7527. a.getProgramParameter(m, a.LINK_STATUS) || b.Logger.infoWithErrorId(1020);
  7528. return m
  7529. };
  7530. c.compileFragmentShader = function(a, b) {
  7531. return c._compileShader(a, b, a.FRAGMENT_SHADER)
  7532. };
  7533. c.compileVertexShader = function(a, b) {
  7534. return c._compileShader(a, b, a.VERTEX_SHADER)
  7535. };
  7536. c._compileShader = function(a, e, c) {
  7537. c = a.createShader(c);
  7538. a.shaderSource(c, e);
  7539. a.compileShader(c);
  7540. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (b.Logger.info(a.getShaderInfoLog(c)), null)
  7541. };
  7542. c.checkCanUseWebGL = function() {
  7543. if (void 0 == c.canUseWebGL) try {
  7544. var a = document.createElement("canvas");
  7545. c.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  7546. } catch(b) {
  7547. c.canUseWebGL = !1
  7548. }
  7549. return c.canUseWebGL
  7550. };
  7551. return c
  7552. } ();
  7553. b.WebGLUtils = d;
  7554. d.prototype.__class__ = "egret.WebGLUtils"
  7555. })(egret || (egret = {})); (function(b) {
  7556. var d = function() {
  7557. function c(a) {
  7558. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  7559. this.program = this.gl = null;
  7560. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  7561. this.uniforms = null;
  7562. this.gl = a;
  7563. this.init()
  7564. }
  7565. c.prototype.init = function() {
  7566. var a = this.gl,
  7567. e = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  7568. a.useProgram(e);
  7569. this.uSampler = a.getUniformLocation(e, "uSampler");
  7570. this.projectionVector = a.getUniformLocation(e, "projectionVector");
  7571. this.offsetVector = a.getUniformLocation(e, "offsetVector");
  7572. this.dimensions = a.getUniformLocation(e, "dimensions");
  7573. this.aVertexPosition = a.getAttribLocation(e, "aVertexPosition");
  7574. this.aTextureCoord = a.getAttribLocation(e, "aTextureCoord");
  7575. this.colorAttribute = a.getAttribLocation(e, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  7576. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  7577. for (var c in this.uniforms) this.uniforms[c].uniformLocation = a.getUniformLocation(e, c);
  7578. this.initUniforms();
  7579. this.program = e
  7580. };
  7581. c.prototype.initUniforms = function() {
  7582. if (this.uniforms) {
  7583. var a = this.gl,
  7584. b, c;
  7585. for (c in this.uniforms) {
  7586. b = this.uniforms[c];
  7587. var d = b.type;
  7588. "mat2" === d || "mat3" === d || "mat4" === d ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === d ? b.glFunc = a.uniformMatrix2fv: "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)
  7589. }
  7590. }
  7591. };
  7592. c.prototype.syncUniforms = function() {
  7593. if (this.uniforms) {
  7594. var a, b = this.gl,
  7595. c;
  7596. for (c in this.uniforms) a = this.uniforms[c],
  7597. 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  7598. }
  7599. };
  7600. return c
  7601. } ();
  7602. b.EgretShader = d;
  7603. d.prototype.__class__ = "egret.EgretShader"
  7604. })(egret || (egret = {}));
  7605. __extends = this.__extends ||
  7606. function(b, d) {
  7607. function c() {
  7608. this.constructor = b
  7609. }
  7610. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7611. c.prototype = d.prototype;
  7612. b.prototype = new c
  7613. }; (function(b) {
  7614. var d = function(b) {
  7615. function a(a) {
  7616. b.call(this, a);
  7617. 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}";
  7618. this.uniforms = {
  7619. matrix: {
  7620. type: "mat4",
  7621. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  7622. },
  7623. colorAdd: {
  7624. type: "4f",
  7625. value: {
  7626. x: 0,
  7627. y: 0,
  7628. z: 0,
  7629. w: 0
  7630. }
  7631. }
  7632. };
  7633. this.init()
  7634. }
  7635. __extends(a, b);
  7636. return a
  7637. } (b.EgretShader);
  7638. b.ColorTransformShader = d;
  7639. d.prototype.__class__ = "egret.ColorTransformShader"
  7640. })(egret || (egret = {}));
  7641. __extends = this.__extends ||
  7642. function(b, d) {
  7643. function c() {
  7644. this.constructor = b
  7645. }
  7646. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7647. c.prototype = d.prototype;
  7648. b.prototype = new c
  7649. }; (function(b) {
  7650. var d = function(b) {
  7651. function a(a) {
  7652. b.call(this, a);
  7653. this.fragmentSrc = "precision mediump float;uniform vec2 blur;uniform sampler2D uSampler;varying vec2 vTextureCoord;void main(){gl_FragColor = vec4(0.0);gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.028 * blur.x, -0.028 * blur.y))) * 0.0044299121055113265;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.024 * blur.x, -0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.020 * blur.x, -0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.016 * blur.x, -0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.012 * blur.x, -0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.008 * blur.x, -0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.004 * blur.x, -0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, vTextureCoord) * 0.159576912161;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.004 * blur.x, 0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.008 * blur.x, 0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.012 * blur.x, 0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.016 * blur.x, 0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.020 * blur.x, 0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.024 * blur.x, 0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.028 * blur.x, 0.028 * blur.y))) * 0.0044299121055113265;}";
  7654. this.uniforms = {
  7655. blur: {
  7656. type: "2f",
  7657. value: {
  7658. x: 2,
  7659. y: 2
  7660. }
  7661. }
  7662. };
  7663. this.init()
  7664. }
  7665. __extends(a, b);
  7666. return a
  7667. } (b.EgretShader);
  7668. b.BlurShader = d;
  7669. d.prototype.__class__ = "egret.BlurShader"
  7670. })(egret || (egret = {})); (function(b) {
  7671. var d = function() {
  7672. function c(a) {
  7673. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
  7674. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  7675. 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}";
  7676. this.gl = a;
  7677. this.init()
  7678. }
  7679. c.prototype.init = function() {
  7680. var a = this.gl,
  7681. e = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  7682. a.useProgram(e);
  7683. this.projectionVector = a.getUniformLocation(e, "projectionVector");
  7684. this.offsetVector = a.getUniformLocation(e, "offsetVector");
  7685. this.tintColor = a.getUniformLocation(e, "tint");
  7686. this.aVertexPosition = a.getAttribLocation(e, "aVertexPosition");
  7687. this.colorAttribute = a.getAttribLocation(e, "aColor");
  7688. this.attributes = [this.aVertexPosition, this.colorAttribute];
  7689. this.translationMatrix = a.getUniformLocation(e, "translationMatrix");
  7690. this.alpha = a.getUniformLocation(e, "alpha");
  7691. this.program = e
  7692. };
  7693. return c
  7694. } ();
  7695. b.PrimitiveShader = d;
  7696. d.prototype.__class__ = "egret.PrimitiveShader"
  7697. })(egret || (egret = {})); (function(b) {
  7698. var d = function() {
  7699. function c(a) {
  7700. this.gl = null;
  7701. this.maxAttibs = 10;
  7702. this.attribState = [];
  7703. this.tempAttribState = [];
  7704. this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
  7705. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  7706. this.setContext(a)
  7707. }
  7708. c.prototype.setContext = function(a) {
  7709. this.gl = a;
  7710. this.primitiveShader = new b.PrimitiveShader(a);
  7711. this.defaultShader = new b.EgretShader(a);
  7712. this.colorTransformShader = new b.ColorTransformShader(a);
  7713. this.blurShader = new b.BlurShader(a);
  7714. this.activateShader(this.defaultShader)
  7715. };
  7716. c.prototype.activateShader = function(a) {
  7717. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader = a)
  7718. };
  7719. c.prototype.setAttribs = function(a) {
  7720. var b, c;
  7721. c = this.tempAttribState.length;
  7722. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  7723. c = a.length;
  7724. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  7725. a = this.gl;
  7726. c = this.attribState.length;
  7727. 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))
  7728. };
  7729. return c
  7730. } ();
  7731. b.WebGLShaderManager = d;
  7732. d.prototype.__class__ = "egret.WebGLShaderManager"
  7733. })(egret || (egret = {}));
  7734. __extends = this.__extends ||
  7735. function(b, d) {
  7736. function c() {
  7737. this.constructor = b
  7738. }
  7739. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7740. c.prototype = d.prototype;
  7741. b.prototype = new c
  7742. }; (function(b) {
  7743. var d = function(c) {
  7744. function a() {
  7745. c.call(this)
  7746. }
  7747. __extends(a, c);
  7748. a.prototype.proceed = function(a) {
  7749. function c() {
  7750. if (4 == k.readyState) if (k.status != a._status && (a._status = k.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, k.status)), 400 <= k.status || 0 == k.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  7751. else {
  7752. switch (a.dataFormat) {
  7753. case b.URLLoaderDataFormat.TEXT:
  7754. a.data = k.responseText;
  7755. break;
  7756. case b.URLLoaderDataFormat.VARIABLES:
  7757. a.data = new b.URLVariables(k.responseText);
  7758. break;
  7759. case b.URLLoaderDataFormat.BINARY:
  7760. a.data = k.response;
  7761. break;
  7762. default:
  7763. a.data = k.responseText
  7764. }
  7765. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7766. }
  7767. }
  7768. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  7769. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  7770. else {
  7771. var d = a._request,
  7772. k = this.getXHR();
  7773. k.onreadystatechange = c;
  7774. var g = b.NetContext._getUrl(d);
  7775. k.open(d.method, g, !0);
  7776. this.setResponseType(k, a.dataFormat);
  7777. d.method != b.URLRequestMethod.GET && d.data ? d.data instanceof b.URLVariables ? (k.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), k.send(d.data.toString())) : (k.setRequestHeader("Content-Type", "multipart/form-data"), k.send(d.data)) : k.send()
  7778. }
  7779. };
  7780. a.prototype.loadSound = function(a) {
  7781. function c(g) {
  7782. b.clearTimeout(k.__timeoutId);
  7783. k.removeEventListener("canplaythrough", c, !1);
  7784. k.removeEventListener("error", d, !1);
  7785. g = new b.Sound;
  7786. g._setAudio(k);
  7787. a.data = g;
  7788. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7789. }
  7790. function d(g) {
  7791. b.clearTimeout(k.__timeoutId);
  7792. k.removeEventListener("canplaythrough", c, !1);
  7793. k.removeEventListener("error", d, !1);
  7794. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7795. }
  7796. var k = new Audio(a._request.url);
  7797. k.__timeoutId = b.setTimeout(c, this, 100);
  7798. k.addEventListener("canplaythrough", c, !1);
  7799. k.addEventListener("error", d, !1);
  7800. k.load()
  7801. };
  7802. a.prototype.getXHR = function() {
  7803. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  7804. };
  7805. a.prototype.setResponseType = function(a, c) {
  7806. switch (c) {
  7807. case b.URLLoaderDataFormat.TEXT:
  7808. case b.URLLoaderDataFormat.VARIABLES:
  7809. a.responseType = b.URLLoaderDataFormat.TEXT;
  7810. break;
  7811. case b.URLLoaderDataFormat.BINARY:
  7812. a.responseType = "arraybuffer";
  7813. break;
  7814. default:
  7815. a.responseType = c
  7816. }
  7817. };
  7818. a.prototype.loadTexture = function(a) {
  7819. var c = a._request,
  7820. d = new Image;
  7821. d.onload = function(c) {
  7822. d.onerror = null;
  7823. d.onload = null;
  7824. c = new b.Texture;
  7825. c._setBitmapData(d);
  7826. a.data = c;
  7827. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  7828. };
  7829. d.onerror = function(c) {
  7830. d.onerror = null;
  7831. d.onload = null;
  7832. b.IOErrorEvent.dispatchIOErrorEvent(a)
  7833. };
  7834. d.src = c.url
  7835. };
  7836. return a
  7837. } (b.NetContext);
  7838. b.HTML5NetContext = d;
  7839. d.prototype.__class__ = "egret.HTML5NetContext"
  7840. })(egret || (egret = {}));
  7841. __extends = this.__extends ||
  7842. function(b, d) {
  7843. function c() {
  7844. this.constructor = b
  7845. }
  7846. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7847. c.prototype = d.prototype;
  7848. b.prototype = new c
  7849. }; (function(b) {
  7850. var d = function(c) {
  7851. function a() {
  7852. c.call(this);
  7853. this._isTouchDown = !1;
  7854. this.rootDiv = null;
  7855. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  7856. }
  7857. __extends(a, c);
  7858. a.prototype.prevent = function(a) {
  7859. a.stopPropagation(); ! 0 != a.isScroll && a.preventDefault()
  7860. };
  7861. a.prototype.run = function() {
  7862. var a = this;
  7863. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown",
  7864. function(b) {
  7865. a._onTouchBegin(b);
  7866. a.prevent(b)
  7867. },
  7868. !1), this.rootDiv.addEventListener("MSPointerMove",
  7869. function(b) {
  7870. a._onTouchMove(b);
  7871. a.prevent(b)
  7872. },
  7873. !1), this.rootDiv.addEventListener("MSPointerUp",
  7874. function(b) {
  7875. a._onTouchEnd(b);
  7876. a.prevent(b)
  7877. },
  7878. !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  7879. window.addEventListener("mousedown",
  7880. function(b) {
  7881. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  7882. });
  7883. window.addEventListener("mouseup",
  7884. function(b) {
  7885. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  7886. a._isTouchDown = !1
  7887. })
  7888. };
  7889. a.prototype.addMouseListener = function() {
  7890. var a = this;
  7891. this.rootDiv.addEventListener("mousedown",
  7892. function(b) {
  7893. a._onTouchBegin(b)
  7894. });
  7895. this.rootDiv.addEventListener("mousemove",
  7896. function(b) {
  7897. a._onTouchMove(b)
  7898. });
  7899. this.rootDiv.addEventListener("mouseup",
  7900. function(b) {
  7901. a._onTouchEnd(b)
  7902. })
  7903. };
  7904. a.prototype.addTouchListener = function() {
  7905. var a = this;
  7906. this.rootDiv.addEventListener("touchstart",
  7907. function(b) {
  7908. for (var c = b.changedTouches.length,
  7909. d = 0; d < c; d++) a._onTouchBegin(b.changedTouches[d]);
  7910. a.prevent(b)
  7911. },
  7912. !1);
  7913. this.rootDiv.addEventListener("touchmove",
  7914. function(b) {
  7915. for (var c = b.changedTouches.length,
  7916. d = 0; d < c; d++) a._onTouchMove(b.changedTouches[d]);
  7917. a.prevent(b)
  7918. },
  7919. !1);
  7920. this.rootDiv.addEventListener("touchend",
  7921. function(b) {
  7922. for (var c = b.changedTouches.length,
  7923. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  7924. a.prevent(b)
  7925. },
  7926. !1);
  7927. this.rootDiv.addEventListener("touchcancel",
  7928. function(b) {
  7929. for (var c = b.changedTouches.length,
  7930. d = 0; d < c; d++) a._onTouchEnd(b.changedTouches[d]);
  7931. a.prevent(b)
  7932. },
  7933. !1)
  7934. };
  7935. a.prototype.inOutOfCanvas = function(a) {
  7936. var c = this.getLocation(this.rootDiv, a);
  7937. a = c.x;
  7938. var c = c.y,
  7939. d = b.MainContext.instance.stage;
  7940. return 0 > a || 0 > c || a > d.stageWidth || c > d.stageHeight ? !0 : !1
  7941. };
  7942. a.prototype.dispatchLeaveStageEvent = function() {
  7943. this.touchingIdentifiers.length = 0;
  7944. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  7945. };
  7946. a.prototype._onTouchBegin = function(a) {
  7947. var b = this.getLocation(this.rootDiv, a),
  7948. c = -1;
  7949. a.hasOwnProperty("identifier") && (c = a.identifier);
  7950. this.onTouchBegan(b.x, b.y, c)
  7951. };
  7952. a.prototype._onTouchMove = function(a) {
  7953. var b = this.getLocation(this.rootDiv, a),
  7954. c = -1;
  7955. a.hasOwnProperty("identifier") && (c = a.identifier);
  7956. this.onTouchMove(b.x, b.y, c)
  7957. };
  7958. a.prototype._onTouchEnd = function(a) {
  7959. var b = this.getLocation(this.rootDiv, a),
  7960. c = -1;
  7961. a.hasOwnProperty("identifier") && (c = a.identifier);
  7962. this.onTouchEnd(b.x, b.y, c)
  7963. };
  7964. a.prototype.getLocation = function(a, c) {
  7965. var d = document.documentElement,
  7966. k = window,
  7967. g, f;
  7968. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  7969. g += k.pageXOffset - d.clientLeft;
  7970. f += k.pageYOffset - d.clientTop;
  7971. null != c.pageX ? (d = c.pageX, k = c.pageY) : (g -= document.body.scrollLeft, f -= document.body.scrollTop, d = c.clientX, k = c.clientY);
  7972. var h = b.Point.identity;
  7973. h.x = (d - g) / b.StageDelegate.getInstance().getScaleX();
  7974. h.y = (k - f) / b.StageDelegate.getInstance().getScaleY();
  7975. return h
  7976. };
  7977. return a
  7978. } (b.TouchContext);
  7979. b.HTML5TouchContext = d;
  7980. d.prototype.__class__ = "egret.HTML5TouchContext"
  7981. })(egret || (egret = {}));
  7982. __extends = this.__extends ||
  7983. function(b, d) {
  7984. function c() {
  7985. this.constructor = b
  7986. }
  7987. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  7988. c.prototype = d.prototype;
  7989. b.prototype = new c
  7990. }; (function(b) {
  7991. var d = function(c) {
  7992. function a() {
  7993. c.call(this);
  7994. this.inputElement = this.div = null;
  7995. this._hasListeners = !1;
  7996. this._inputType = "";
  7997. this._isShow = !1;
  7998. this.textValue = "";
  7999. this._height = this._width = 0;
  8000. this._styleInfoes = {};
  8001. var e = b.StageDelegate.getInstance().getScaleX(),
  8002. d = b.StageDelegate.getInstance().getScaleY(),
  8003. m = b.Browser.getInstance().$new("div");
  8004. m.position.x = 0;
  8005. m.position.y = 0;
  8006. m.scale.x = e;
  8007. m.scale.y = d;
  8008. m.transforms();
  8009. m.style[a.getTrans("transformOrigin")] = "0% 0% 0px";
  8010. this.div = m;
  8011. d = b.MainContext.instance.stage;
  8012. e = d.stageWidth;
  8013. d = d.stageHeight;
  8014. m = new b.Shape;
  8015. m.width = e;
  8016. m.height = d;
  8017. m.touchEnabled = !0;
  8018. this._shape = m;
  8019. this.getStageDelegateDiv().appendChild(this.div)
  8020. }
  8021. __extends(a, c);
  8022. a.getTrans = function(b) {
  8023. "" == a.header && (a.header = a.getHeader());
  8024. return a.header + b.substring(1, b.length)
  8025. };
  8026. a.getHeader = function() {
  8027. for (var a = document.createElement("div").style, b = ["t", "webkitT", "msT", "MozT", "OT"], c = 0; c < b.length; c++) if (b[c] + "ransform" in a) return b[c];
  8028. return b[0]
  8029. };
  8030. a.prototype.getStageDelegateDiv = function() {
  8031. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8032. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8033. return a
  8034. };
  8035. a.prototype._setMultiline = function(a) {
  8036. c.prototype._setMultiline.call(this, a);
  8037. this.createInput()
  8038. };
  8039. a.prototype.callHandler = function(a) {
  8040. a.stopPropagation()
  8041. };
  8042. a.prototype._add = function() {
  8043. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8044. };
  8045. a.prototype._remove = function() {
  8046. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8047. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8048. };
  8049. a.prototype._addListeners = function() {
  8050. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart", this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8051. };
  8052. a.prototype._removeListeners = function() {
  8053. 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))
  8054. };
  8055. a.prototype.createInput = function() {
  8056. var a = this._multiline ? "textarea": "input";
  8057. this._inputType != a && (this._inputType = a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {},
  8058. a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8059. };
  8060. a.prototype._open = function(a, b, c, d) {};
  8061. a.prototype._setScale = function(a, d) {
  8062. c.prototype._setScale.call(this, a, d);
  8063. var m = b.StageDelegate.getInstance().getScaleX(),
  8064. k = b.StageDelegate.getInstance().getScaleY();
  8065. this.div.scale.x = m * a;
  8066. this.div.scale.y = k * d;
  8067. this.div.transforms()
  8068. };
  8069. a.prototype.changePosition = function(a, c) {
  8070. var d = b.StageDelegate.getInstance().getScaleX(),
  8071. k = b.StageDelegate.getInstance().getScaleY();
  8072. this.div.position.x = a * d;
  8073. this.div.position.y = c * k;
  8074. this.div.transforms()
  8075. };
  8076. a.prototype.setStyles = function() {
  8077. this.setElementStyle("fontStyle", this._italic ? "italic": "normal");
  8078. this.setElementStyle("fontWeight", this._bold ? "bold": "normal");
  8079. this.setElementStyle("textAlign", this._textAlign);
  8080. this.setElementStyle("fontSize", this._size + "px");
  8081. this.setElementStyle("color", "#000000");
  8082. this.setElementStyle("width", this._width + "px");
  8083. this.setElementStyle("height", this._height + "px");
  8084. this.setElementStyle("display", "block")
  8085. };
  8086. a.prototype._show = function() {
  8087. b.MainContext.instance.stage._changeSizeDispatchFlag = !1;
  8088. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8089. this._isShow = !0;
  8090. var a = this._getText();
  8091. this.inputElement.value = a;
  8092. var c = this;
  8093. this.inputElement.oninput = function() {
  8094. c.textValue = c.inputElement.value;
  8095. c.dispatchEvent(new b.Event("updateText"))
  8096. };
  8097. this.setStyles();
  8098. this.inputElement.focus();
  8099. this.inputElement.selectionStart = a.length;
  8100. this.inputElement.selectionEnd = a.length;
  8101. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  8102. };
  8103. a.prototype._hide = function() {
  8104. b.MainContext.instance.stage._changeSizeDispatchFlag = !0;
  8105. if (null != this.inputElement) {
  8106. this._isShow = !1;
  8107. this.inputElement.oninput = function() {};
  8108. this.setElementStyle("border", "none");
  8109. this.setElementStyle("display", "none");
  8110. this.inputElement.value = "";
  8111. this.setElementStyle("width", "0px");
  8112. window.scrollTo(0, 0);
  8113. var a = this;
  8114. b.setTimeout(function() {
  8115. a.inputElement.blur();
  8116. window.scrollTo(0, 0)
  8117. },
  8118. this, 50);
  8119. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8120. }
  8121. };
  8122. a.prototype._getText = function() {
  8123. this.textValue || (this.textValue = "");
  8124. return this.textValue
  8125. };
  8126. a.prototype._setText = function(a) {
  8127. this.textValue = a;
  8128. this.resetText()
  8129. };
  8130. a.prototype.resetText = function() {
  8131. this.inputElement && (this.inputElement.value = this.textValue)
  8132. };
  8133. a.prototype._setWidth = function(a) {
  8134. this._width = a
  8135. };
  8136. a.prototype._setHeight = function(a) {
  8137. this._height = a
  8138. };
  8139. a.prototype.setElementStyle = function(a, b) {
  8140. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  8141. };
  8142. a.header = "";
  8143. return a
  8144. } (b.StageText);
  8145. b.HTML5StageText = d;
  8146. d.prototype.__class__ = "egret.HTML5StageText"
  8147. })(egret || (egret = {}));
  8148. egret.StageText.create = function() {
  8149. return new egret.HTML5StageText
  8150. };
  8151. var __extends = this.__extends ||
  8152. function(b, d) {
  8153. function c() {
  8154. this.constructor = b
  8155. }
  8156. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8157. c.prototype = d.prototype;
  8158. b.prototype = new c
  8159. },
  8160. RES; (function(b) {
  8161. var d = function(b) {
  8162. function a(a, d, m) {
  8163. void 0 === d && (d = !1);
  8164. void 0 === m && (m = !1);
  8165. b.call(this, a, d, m);
  8166. this.itemsTotal = this.itemsLoaded = 0;
  8167. this.groupName = "";
  8168. this.resItem = null
  8169. }
  8170. __extends(a, b);
  8171. a.dispatchResourceEvent = function(b, c, d, k, g, f) {
  8172. void 0 === d && (d = "");
  8173. void 0 === k && (k = null);
  8174. void 0 === g && (g = 0);
  8175. void 0 === f && (f = 0);
  8176. var h = egret.Event._getPropertyData(a);
  8177. h.groupName = d;
  8178. h.resItem = k;
  8179. h.itemsLoaded = g;
  8180. h.itemsTotal = f;
  8181. egret.Event._dispatchByTarget(a, b, c, h)
  8182. };
  8183. a.ITEM_LOAD_ERROR = "itemLoadError";
  8184. a.CONFIG_COMPLETE = "configComplete";
  8185. a.CONFIG_LOAD_ERROR = "configLoadError";
  8186. a.GROUP_PROGRESS = "groupProgress";
  8187. a.GROUP_COMPLETE = "groupComplete";
  8188. a.GROUP_LOAD_ERROR = "groupLoadError";
  8189. return a
  8190. } (egret.Event);
  8191. b.ResourceEvent = d;
  8192. d.prototype.__class__ = "RES.ResourceEvent"
  8193. })(RES || (RES = {})); (function(b) {
  8194. var d = function() {
  8195. function b(a, c, d) {
  8196. this.groupName = "";
  8197. this.data = null;
  8198. this._loaded = !1;
  8199. this.name = a;
  8200. this.url = c;
  8201. this.type = d
  8202. }
  8203. Object.defineProperty(b.prototype, "loaded", {
  8204. get: function() {
  8205. return this.data ? this.data.loaded: this._loaded
  8206. },
  8207. set: function(a) {
  8208. this.data && (this.data.loaded = a);
  8209. this._loaded = a
  8210. },
  8211. enumerable: !0,
  8212. configurable: !0
  8213. });
  8214. b.prototype.toString = function() {
  8215. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  8216. };
  8217. b.TYPE_XML = "xml";
  8218. b.TYPE_IMAGE = "image";
  8219. b.TYPE_BIN = "bin";
  8220. b.TYPE_TEXT = "text";
  8221. b.TYPE_JSON = "json";
  8222. b.TYPE_SHEET = "sheet";
  8223. b.TYPE_FONT = "font";
  8224. b.TYPE_SOUND = "sound";
  8225. return b
  8226. } ();
  8227. b.ResourceItem = d;
  8228. d.prototype.__class__ = "RES.ResourceItem"
  8229. })(RES || (RES = {})); (function(b) {
  8230. var d = function() {
  8231. function c() {
  8232. this.keyMap = {};
  8233. this.groupDic = {};
  8234. b.configInstance = this
  8235. }
  8236. c.prototype.getGroupByName = function(a) {
  8237. var b = [];
  8238. if (!this.groupDic[a]) return b;
  8239. a = this.groupDic[a];
  8240. for (var c = a.length,
  8241. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  8242. return b
  8243. };
  8244. c.prototype.getRawGroupByName = function(a) {
  8245. return this.groupDic[a] ? this.groupDic[a] : []
  8246. };
  8247. c.prototype.createGroup = function(a, b, c) {
  8248. void 0 === c && (c = !1);
  8249. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  8250. c = this.groupDic;
  8251. for (var d = [], k = b.length, g = 0; g < k; g++) {
  8252. var f = b[g],
  8253. h = c[f];
  8254. if (h) for (var f = h.length,
  8255. n = 0; n < f; n++) {
  8256. var p = h[n]; - 1 == d.indexOf(p) && d.push(p)
  8257. } else(p = this.keyMap[f]) ? -1 == d.indexOf(p) && d.push(p) : egret.Logger.warningWithErrorId(2E3, f)
  8258. }
  8259. if (0 == d.length) return ! 1;
  8260. this.groupDic[a] = d;
  8261. return ! 0
  8262. };
  8263. c.prototype.parseConfig = function(a, b) {
  8264. if (a) {
  8265. var c = a.resources;
  8266. if (c) for (var d = c.length,
  8267. k = 0; k < d; k++) {
  8268. var g = c[k],
  8269. f = g.url;
  8270. f && -1 == f.indexOf("://") && (g.url = b + f);
  8271. this.addItemToKeyMap(g)
  8272. }
  8273. if (c = a.groups) for (d = c.length, k = 0; k < d; k++) {
  8274. for (var f = c[k], h = [], n = f.keys.split(","), p = n.length, q = 0; q < p; q++) g = n[q].trim(),
  8275. (g = this.keyMap[g]) && -1 == h.indexOf(g) && h.push(g);
  8276. this.groupDic[f.name] = h
  8277. }
  8278. }
  8279. };
  8280. c.prototype.addSubkey = function(a, b) {
  8281. var c = this.keyMap[b];
  8282. c && !this.keyMap[a] && (this.keyMap[a] = c)
  8283. };
  8284. c.prototype.addItemToKeyMap = function(a) {
  8285. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  8286. if (a.hasOwnProperty("subkeys")) {
  8287. var b = a.subkeys.split(",");
  8288. a.subkeys = b;
  8289. for (var c = b.length,
  8290. d = 0; d < c; d++) {
  8291. var k = b[d];
  8292. null == this.keyMap[k] && (this.keyMap[k] = a)
  8293. }
  8294. }
  8295. };
  8296. c.prototype.getName = function(a) {
  8297. return (a = this.keyMap[a]) ? a.name: ""
  8298. };
  8299. c.prototype.getType = function(a) {
  8300. return (a = this.keyMap[a]) ? a.type: ""
  8301. };
  8302. c.prototype.getRawResourceItem = function(a) {
  8303. return this.keyMap[a]
  8304. };
  8305. c.prototype.getResourceItem = function(a) {
  8306. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  8307. };
  8308. c.prototype.parseResourceItem = function(a) {
  8309. var c = new b.ResourceItem(a.name, a.url, a.type);
  8310. c.data = a;
  8311. return c
  8312. };
  8313. return c
  8314. } ();
  8315. b.ResourceConfig = d;
  8316. d.prototype.__class__ = "RES.ResourceConfig"
  8317. })(RES || (RES = {}));
  8318. __extends = this.__extends ||
  8319. function(b, d) {
  8320. function c() {
  8321. this.constructor = b
  8322. }
  8323. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8324. c.prototype = d.prototype;
  8325. b.prototype = new c
  8326. }; (function(b) {
  8327. var d = function(c) {
  8328. function a() {
  8329. c.call(this);
  8330. this.thread = 2;
  8331. this.loadingCount = 0;
  8332. this.resInstance = this.callBack = null;
  8333. this.groupTotalDic = {};
  8334. this.numLoadedDic = {};
  8335. this.itemListDic = {};
  8336. this.groupErrorDic = {};
  8337. this.retryTimesDic = {};
  8338. this.maxRetryTimes = 3;
  8339. this.failedList = [];
  8340. this.priorityQueue = {};
  8341. this.lazyLoadList = [];
  8342. this.analyzerDic = {};
  8343. this.queueIndex = 0
  8344. }
  8345. __extends(a, c);
  8346. a.prototype.isGroupInLoading = function(a) {
  8347. return void 0 !== this.itemListDic[a]
  8348. };
  8349. a.prototype.loadGroup = function(a, c, d) {
  8350. void 0 === d && (d = 0);
  8351. if (!this.itemListDic[c] && c) if (a && 0 != a.length) {
  8352. this.priorityQueue[d] ? this.priorityQueue[d].push(c) : this.priorityQueue[d] = [c];
  8353. this.itemListDic[c] = a;
  8354. d = a.length;
  8355. for (var k = 0; k < d; k++) a[k].groupName = c;
  8356. this.groupTotalDic[c] = a.length;
  8357. this.numLoadedDic[c] = 0;
  8358. this.next()
  8359. } else egret.Logger.warningWithErrorId(2001, c),
  8360. a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR),
  8361. a.groupName = c,
  8362. this.dispatchEvent(a)
  8363. };
  8364. a.prototype.loadItem = function(a) {
  8365. this.lazyLoadList.push(a);
  8366. a.groupName = "";
  8367. this.next()
  8368. };
  8369. a.prototype.next = function() {
  8370. for (; this.loadingCount < this.thread;) {
  8371. var a = this.getOneResourceItem();
  8372. if (!a) break;
  8373. this.loadingCount++;
  8374. if (a.loaded) this.onItemComplete(a);
  8375. else {
  8376. var c = this.analyzerDic[a.type];
  8377. c || (c = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  8378. c.loadFile(a, this.onItemComplete, this)
  8379. }
  8380. }
  8381. };
  8382. a.prototype.getOneResourceItem = function() {
  8383. if (0 < this.failedList.length) return this.failedList.shift();
  8384. var a = Number.NEGATIVE_INFINITY,
  8385. b;
  8386. for (b in this.priorityQueue) a = Math.max(a, b);
  8387. a = this.priorityQueue[a];
  8388. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  8389. b = a.length;
  8390. for (var c, d = 0; d < b; d++) {
  8391. this.queueIndex >= b && (this.queueIndex = 0);
  8392. c = this.itemListDic[a[this.queueIndex]];
  8393. if (0 < c.length) break;
  8394. this.queueIndex++
  8395. }
  8396. return 0 == c.length ? null: c.shift()
  8397. };
  8398. a.prototype.onItemComplete = function(a) {
  8399. this.loadingCount--;
  8400. var c = a.groupName;
  8401. if (!a.loaded) {
  8402. var d = this.retryTimesDic[a.name] || 1;
  8403. if (d > this.maxRetryTimes) delete this.retryTimesDic[a.name],
  8404. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, c, a);
  8405. else {
  8406. this.retryTimesDic[a.name] = d + 1;
  8407. this.failedList.push(a);
  8408. this.next();
  8409. return
  8410. }
  8411. }
  8412. if (c) {
  8413. this.numLoadedDic[c]++;
  8414. var d = this.numLoadedDic[c],
  8415. k = this.groupTotalDic[c];
  8416. a.loaded || (this.groupErrorDic[c] = !0);
  8417. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, c, a, d, k);
  8418. d == k && (a = this.groupErrorDic[c], this.removeGroupName(c), delete this.groupTotalDic[c], delete this.numLoadedDic[c], delete this.itemListDic[c], delete this.groupErrorDic[c], a ? b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_LOAD_ERROR, c) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, c))
  8419. } else this.callBack.call(this.resInstance, a);
  8420. this.next()
  8421. };
  8422. a.prototype.removeGroupName = function(a) {
  8423. for (var b in this.priorityQueue) {
  8424. for (var c = this.priorityQueue[b], d = c.length, g = 0, f = !1, d = c.length, h = 0; h < d; h++) {
  8425. if (c[h] == a) {
  8426. c.splice(g, 1);
  8427. f = !0;
  8428. break
  8429. }
  8430. g++
  8431. }
  8432. if (f) {
  8433. 0 == c.length && delete this.priorityQueue[b];
  8434. break
  8435. }
  8436. }
  8437. };
  8438. return a
  8439. } (egret.EventDispatcher);
  8440. b.ResourceLoader = d;
  8441. d.prototype.__class__ = "RES.ResourceLoader"
  8442. })(RES || (RES = {}));
  8443. __extends = this.__extends ||
  8444. function(b, d) {
  8445. function c() {
  8446. this.constructor = b
  8447. }
  8448. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8449. c.prototype = d.prototype;
  8450. b.prototype = new c
  8451. }; (function(b) {
  8452. var d = function(c) {
  8453. function a() {
  8454. c.call(this);
  8455. this.resourceConfig = null;
  8456. this.resourceConfig = b.configInstance
  8457. }
  8458. __extends(a, c);
  8459. a.prototype.addSubkey = function(a, b) {
  8460. this.resourceConfig.addSubkey(a, b)
  8461. };
  8462. a.prototype.loadFile = function(a, b, c) {};
  8463. a.prototype.getRes = function(a) {};
  8464. a.prototype.destroyRes = function(a) {
  8465. return ! 1
  8466. };
  8467. a.getStringPrefix = function(a) {
  8468. if (!a) return "";
  8469. var b = a.indexOf(".");
  8470. return - 1 != b ? a.substring(0, b) : ""
  8471. };
  8472. a.getStringTail = function(a) {
  8473. if (!a) return "";
  8474. var b = a.indexOf(".");
  8475. return - 1 != b ? a.substring(b + 1) : ""
  8476. };
  8477. return a
  8478. } (egret.HashObject);
  8479. b.AnalyzerBase = d;
  8480. d.prototype.__class__ = "RES.AnalyzerBase"
  8481. })(RES || (RES = {}));
  8482. __extends = this.__extends ||
  8483. function(b, d) {
  8484. function c() {
  8485. this.constructor = b
  8486. }
  8487. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8488. c.prototype = d.prototype;
  8489. b.prototype = new c
  8490. }; (function(b) {
  8491. var d = function(b) {
  8492. function a() {
  8493. b.call(this);
  8494. this.fileDic = {};
  8495. this.resItemDic = [];
  8496. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  8497. this.recycler = new egret.Recycler
  8498. }
  8499. __extends(a, b);
  8500. a.prototype.loadFile = function(a, b, c) {
  8501. if (this.fileDic[a.name]) b.call(c, a);
  8502. else {
  8503. var d = this.getLoader();
  8504. this.resItemDic[d.hashCode] = {
  8505. item: a,
  8506. func: b,
  8507. thisObject: c
  8508. };
  8509. d.load(new egret.URLRequest(a.url))
  8510. }
  8511. };
  8512. a.prototype.getLoader = function() {
  8513. var a = this.recycler.pop();
  8514. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  8515. a.dataFormat = this._dataFormat;
  8516. return a
  8517. };
  8518. a.prototype.onLoadFinish = function(a) {
  8519. var b = a.target,
  8520. c = this.resItemDic[b.hashCode];
  8521. delete this.resItemDic[b.hashCode];
  8522. var d = c.item,
  8523. g = c.func;
  8524. d.loaded = a.type == egret.Event.COMPLETE;
  8525. d.loaded && this.analyzeData(d, b.data);
  8526. this.recycler.push(b);
  8527. g.call(c.thisObject, d)
  8528. };
  8529. a.prototype.analyzeData = function(a, b) {
  8530. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b)
  8531. };
  8532. a.prototype.getRes = function(a) {
  8533. return this.fileDic[a]
  8534. };
  8535. a.prototype.hasRes = function(a) {
  8536. return null != this.getRes(a)
  8537. };
  8538. a.prototype.destroyRes = function(a) {
  8539. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8540. };
  8541. return a
  8542. } (b.AnalyzerBase);
  8543. b.BinAnalyzer = d;
  8544. d.prototype.__class__ = "RES.BinAnalyzer"
  8545. })(RES || (RES = {}));
  8546. __extends = this.__extends ||
  8547. function(b, d) {
  8548. function c() {
  8549. this.constructor = b
  8550. }
  8551. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8552. c.prototype = d.prototype;
  8553. b.prototype = new c
  8554. }; (function(b) {
  8555. var d = function(b) {
  8556. function a() {
  8557. b.call(this);
  8558. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  8559. }
  8560. __extends(a, b);
  8561. a.prototype.analyzeData = function(a, b) {
  8562. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.scale9grid && (c = c.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(c[0]), parseInt(c[1]), parseInt(c[2]), parseInt(c[3]))))
  8563. };
  8564. return a
  8565. } (b.BinAnalyzer);
  8566. b.ImageAnalyzer = d;
  8567. d.prototype.__class__ = "RES.ImageAnalyzer"
  8568. })(RES || (RES = {}));
  8569. __extends = this.__extends ||
  8570. function(b, d) {
  8571. function c() {
  8572. this.constructor = b
  8573. }
  8574. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8575. c.prototype = d.prototype;
  8576. b.prototype = new c
  8577. }; (function(b) {
  8578. var d = function(b) {
  8579. function a() {
  8580. b.call(this);
  8581. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8582. }
  8583. __extends(a, b);
  8584. a.prototype.analyzeData = function(a, b) {
  8585. var c = a.name;
  8586. if (!this.fileDic[c] && b) try {
  8587. this.fileDic[c] = JSON.parse(b)
  8588. } catch(d) {
  8589. egret.Logger.warningWithErrorId(1017, a.url, b)
  8590. }
  8591. };
  8592. return a
  8593. } (b.BinAnalyzer);
  8594. b.JsonAnalyzer = d;
  8595. d.prototype.__class__ = "RES.JsonAnalyzer"
  8596. })(RES || (RES = {}));
  8597. __extends = this.__extends ||
  8598. function(b, d) {
  8599. function c() {
  8600. this.constructor = b
  8601. }
  8602. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8603. c.prototype = d.prototype;
  8604. b.prototype = new c
  8605. }; (function(b) {
  8606. var d = function(b) {
  8607. function a() {
  8608. b.call(this);
  8609. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8610. }
  8611. __extends(a, b);
  8612. return a
  8613. } (b.BinAnalyzer);
  8614. b.TextAnalyzer = d;
  8615. d.prototype.__class__ = "RES.TextAnalyzer"
  8616. })(RES || (RES = {}));
  8617. __extends = this.__extends ||
  8618. function(b, d) {
  8619. function c() {
  8620. this.constructor = b
  8621. }
  8622. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8623. c.prototype = d.prototype;
  8624. b.prototype = new c
  8625. }; (function(b) {
  8626. var d = function(c) {
  8627. function a() {
  8628. c.call(this);
  8629. this.sheetMap = {};
  8630. this.textureMap = {};
  8631. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8632. }
  8633. __extends(a, c);
  8634. a.prototype.getRes = function(a) {
  8635. var c = this.fileDic[a];
  8636. c || (c = this.textureMap[a]); ! c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.fileDic[c]) && (a = b.AnalyzerBase.getStringTail(a), c = c.getTexture(a));
  8637. return c
  8638. };
  8639. a.prototype.onLoadFinish = function(a) {
  8640. var b = a.target,
  8641. c = this.resItemDic[b.hashCode];
  8642. delete this.resItemDic[b.hashCode];
  8643. var d = c.item,
  8644. g = c.func;
  8645. d.loaded = a.type == egret.Event.COMPLETE;
  8646. if (d.loaded) if ("string" == typeof b.data) {
  8647. if (d.loaded = !1, a = this.analyzeConfig(d, b.data)) {
  8648. d.url = a;
  8649. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  8650. this.loadFile(d, g, c.thisObject);
  8651. this._dataFormat = egret.URLLoaderDataFormat.TEXT;
  8652. return
  8653. }
  8654. } else this.analyzeBitmap(d, b.data);
  8655. d.url = d.data.url;
  8656. this.recycler.push(b);
  8657. g.call(c.thisObject, d)
  8658. };
  8659. a.prototype.analyzeConfig = function(a, b) {
  8660. var c = a.name,
  8661. d, g = "";
  8662. try {
  8663. d = JSON.parse(b)
  8664. } catch(f) {
  8665. egret.Logger.warningWithErrorId(1017, a.url, b)
  8666. }
  8667. d && (this.sheetMap[c] = d, g = this.getRelativePath(a.url, d.file));
  8668. return g
  8669. };
  8670. a.prototype.analyzeBitmap = function(a, b) {
  8671. var c = a.name;
  8672. if (!this.fileDic[c] && b) {
  8673. var d = this.sheetMap[c];
  8674. delete this.sheetMap[c];
  8675. d = this.parseSpriteSheet(b, d, a.data && a.data.subkeys ? "": c);
  8676. this.fileDic[c] = d
  8677. }
  8678. };
  8679. a.prototype.getRelativePath = function(a, b) {
  8680. a = a.split("\\").join("/");
  8681. var c = a.lastIndexOf("/");
  8682. return a = -1 != c ? a.substring(0, c + 1) + b: b
  8683. };
  8684. a.prototype.parseSpriteSheet = function(a, b, c) {
  8685. b = b.frames;
  8686. if (!b) return null;
  8687. var d = new egret.SpriteSheet(a),
  8688. g = this.textureMap,
  8689. f;
  8690. for (f in b) {
  8691. var h = b[f];
  8692. a = d.createTexture(f, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH);
  8693. h.scale9grid && (h = h.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(h[0]), parseInt(h[1]), parseInt(h[2]), parseInt(h[3])));
  8694. null == g[f] && (g[f] = a, c && this.addSubkey(f, c))
  8695. }
  8696. return d
  8697. };
  8698. a.prototype.destroyRes = function(a) {
  8699. var b = this.fileDic[a];
  8700. if (b) {
  8701. delete this.fileDic[a];
  8702. for (var c in b._textureMap) this.textureMap[c] && delete this.textureMap[c];
  8703. return ! 0
  8704. }
  8705. return ! 1
  8706. };
  8707. return a
  8708. } (b.BinAnalyzer);
  8709. b.SheetAnalyzer = d;
  8710. d.prototype.__class__ = "RES.SheetAnalyzer"
  8711. })(RES || (RES = {}));
  8712. __extends = this.__extends ||
  8713. function(b, d) {
  8714. function c() {
  8715. this.constructor = b
  8716. }
  8717. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8718. c.prototype = d.prototype;
  8719. b.prototype = new c
  8720. }; (function(b) {
  8721. var d = function(b) {
  8722. function a() {
  8723. b.call(this)
  8724. }
  8725. __extends(a, b);
  8726. a.prototype.analyzeConfig = function(a, b) {
  8727. var c = a.name,
  8728. d, g = "";
  8729. try {
  8730. d = JSON.parse(b)
  8731. } catch(f) {}
  8732. d ? g = this.getRelativePath(a.url, d.file) : (d = b, g = this.getTexturePath(a.url, d));
  8733. this.sheetMap[c] = d;
  8734. return g
  8735. };
  8736. a.prototype.analyzeBitmap = function(a, b) {
  8737. var c = a.name;
  8738. if (!this.fileDic[c] && b) {
  8739. var d = this.sheetMap[c];
  8740. delete this.sheetMap[c];
  8741. d = new egret.BitmapFont(b, d);
  8742. this.fileDic[c] = d
  8743. }
  8744. };
  8745. a.prototype.getTexturePath = function(a, b) {
  8746. var c = "",
  8747. d = b.split("\n")[2],
  8748. g = d.indexOf('file="'); - 1 != g && (d = d.substring(g + 6), g = d.indexOf('"'), c = d.substring(0, g));
  8749. a = a.split("\\").join("/");
  8750. g = a.lastIndexOf("/");
  8751. return a = -1 != g ? a.substring(0, g + 1) + c: c
  8752. };
  8753. a.prototype.destroyRes = function(a) {
  8754. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  8755. };
  8756. return a
  8757. } (b.SheetAnalyzer);
  8758. b.FontAnalyzer = d;
  8759. d.prototype.__class__ = "RES.FontAnalyzer"
  8760. })(RES || (RES = {}));
  8761. __extends = this.__extends ||
  8762. function(b, d) {
  8763. function c() {
  8764. this.constructor = b
  8765. }
  8766. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8767. c.prototype = d.prototype;
  8768. b.prototype = new c
  8769. }; (function(b) {
  8770. var d = function(b) {
  8771. function a() {
  8772. b.call(this);
  8773. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  8774. }
  8775. __extends(a, b);
  8776. a.prototype.analyzeData = function(a, b) {
  8777. var c = a.name; ! this.fileDic[c] && b && (this.fileDic[c] = b, (c = a.data) && c.soundType ? b.preload(c.soundType) : b.preload(egret.Sound.EFFECT))
  8778. };
  8779. return a
  8780. } (b.BinAnalyzer);
  8781. b.SoundAnalyzer = d;
  8782. d.prototype.__class__ = "RES.SoundAnalyzer"
  8783. })(RES || (RES = {}));
  8784. __extends = this.__extends ||
  8785. function(b, d) {
  8786. function c() {
  8787. this.constructor = b
  8788. }
  8789. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8790. c.prototype = d.prototype;
  8791. b.prototype = new c
  8792. }; (function(b) {
  8793. var d = function(b) {
  8794. function a() {
  8795. b.call(this);
  8796. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  8797. }
  8798. __extends(a, b);
  8799. a.prototype.analyzeData = function(a, b) {
  8800. var c = a.name;
  8801. if (!this.fileDic[c] && b) try {
  8802. var d = egret.XML.parse(b);
  8803. this.fileDic[c] = d
  8804. } catch(g) {}
  8805. };
  8806. return a
  8807. } (b.BinAnalyzer);
  8808. b.XMLAnalyzer = d;
  8809. d.prototype.__class__ = "RES.XMLAnalyzer"
  8810. })(RES || (RES = {}));
  8811. __extends = this.__extends ||
  8812. function(b, d) {
  8813. function c() {
  8814. this.constructor = b
  8815. }
  8816. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  8817. c.prototype = d.prototype;
  8818. b.prototype = new c
  8819. }; (function(b) {
  8820. b.loadConfig = function(a, b, d) {
  8821. void 0 === b && (b = "");
  8822. void 0 === d && (d = "json");
  8823. c.loadConfig(a, b, d)
  8824. };
  8825. b.loadGroup = function(a, b) {
  8826. void 0 === b && (b = 0);
  8827. c.loadGroup(a, b)
  8828. };
  8829. b.isGroupLoaded = function(a) {
  8830. return c.isGroupLoaded(a)
  8831. };
  8832. b.getGroupByName = function(a) {
  8833. return c.getGroupByName(a)
  8834. };
  8835. b.createGroup = function(a, b, d) {
  8836. void 0 === d && (d = !1);
  8837. return c.createGroup(a, b, d)
  8838. };
  8839. b.hasRes = function(a) {
  8840. return c.hasRes(a)
  8841. };
  8842. b.parseConfig = function(a, b) {
  8843. void 0 === b && (b = "");
  8844. c.parseConfig(a, b)
  8845. };
  8846. b.getRes = function(a) {
  8847. return c.getRes(a)
  8848. };
  8849. b.getResAsync = function(a, b, d) {
  8850. c.getResAsync(a, b, d)
  8851. };
  8852. b.getResByUrl = function(a, b, d, m) {
  8853. void 0 === m && (m = "");
  8854. c.getResByUrl(a, b, d, m)
  8855. };
  8856. b.destroyRes = function(a) {
  8857. return c.destroyRes(a)
  8858. };
  8859. b.setMaxLoadingThread = function(a) {
  8860. c.setMaxLoadingThread(a)
  8861. };
  8862. b.setMaxRetryTimes = function(a) {
  8863. c.setMaxRetryTimes(a)
  8864. };
  8865. b.addEventListener = function(a, b, d, m, k) {
  8866. void 0 === m && (m = !1);
  8867. void 0 === k && (k = 0);
  8868. c.addEventListener(a, b, d, m, k)
  8869. };
  8870. b.removeEventListener = function(a, b, d, m) {
  8871. void 0 === m && (m = !1);
  8872. c.removeEventListener(a, b, d, m)
  8873. };
  8874. var d = function(a) {
  8875. function c() {
  8876. a.call(this);
  8877. this.analyzerDic = {};
  8878. this.configItemList = [];
  8879. this.configComplete = this.callLaterFlag = !1;
  8880. this.loadedGroups = [];
  8881. this.groupNameList = [];
  8882. this.asyncDic = {};
  8883. this.init()
  8884. }
  8885. __extends(c, a);
  8886. c.prototype.getAnalyzerByType = function(a) {
  8887. var c = this.analyzerDic[a];
  8888. c || (c = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  8889. return c
  8890. };
  8891. c.prototype.init = function() {
  8892. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  8893. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  8894. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  8895. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  8896. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  8897. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  8898. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  8899. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  8900. this.resConfig = new b.ResourceConfig;
  8901. this.resLoader = new b.ResourceLoader;
  8902. this.resLoader.callBack = this.onResourceItemComp;
  8903. this.resLoader.resInstance = this;
  8904. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  8905. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  8906. };
  8907. c.prototype.loadConfig = function(a, b, c) {
  8908. void 0 === c && (c = "json");
  8909. this.configItemList.push({
  8910. url: a,
  8911. resourceRoot: b,
  8912. type: c
  8913. });
  8914. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  8915. };
  8916. c.prototype.startLoadConfig = function() {
  8917. this.callLaterFlag = !1;
  8918. var a = this.configItemList;
  8919. this.configItemList = [];
  8920. this.loadingConfigList = a;
  8921. for (var d = a.length,
  8922. k = [], g = 0; g < d; g++) {
  8923. var f = a[g],
  8924. f = new b.ResourceItem(f.url, f.url, f.type);
  8925. k.push(f)
  8926. }
  8927. this.resLoader.loadGroup(k, c.GROUP_CONFIG, Number.MAX_VALUE)
  8928. };
  8929. c.prototype.isGroupLoaded = function(a) {
  8930. return - 1 != this.loadedGroups.indexOf(a)
  8931. };
  8932. c.prototype.getGroupByName = function(a) {
  8933. return this.resConfig.getGroupByName(a)
  8934. };
  8935. c.prototype.loadGroup = function(a, c) {
  8936. void 0 === c && (c = 0);
  8937. if ( - 1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, a);
  8938. else if (!this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  8939. var d = this.resConfig.getGroupByName(a);
  8940. this.resLoader.loadGroup(d, a, c)
  8941. } else this.groupNameList.push({
  8942. name: a,
  8943. priority: c
  8944. })
  8945. };
  8946. c.prototype.createGroup = function(a, b, c) {
  8947. void 0 === c && (c = !1);
  8948. if (c) {
  8949. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  8950. }
  8951. return this.resConfig.createGroup(a, b, c)
  8952. };
  8953. c.prototype.onGroupComp = function(a) {
  8954. if (a.groupName == c.GROUP_CONFIG) {
  8955. a = this.loadingConfigList.length;
  8956. for (var d = 0; d < a; d++) {
  8957. var k = this.loadingConfigList[d],
  8958. g = this.getAnalyzerByType(k.type),
  8959. f = g.getRes(k.url);
  8960. g.destroyRes(k.url);
  8961. this.resConfig.parseConfig(f, k.resourceRoot)
  8962. }
  8963. this.configComplete = !0;
  8964. this.loadingConfigList = null;
  8965. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  8966. this.loadDelayGroups()
  8967. } else this.loadedGroups.push(a.groupName),
  8968. this.dispatchEvent(a)
  8969. };
  8970. c.prototype.loadDelayGroups = function() {
  8971. var a = this.groupNameList;
  8972. this.groupNameList = [];
  8973. for (var b = a.length,
  8974. c = 0; c < b; c++) {
  8975. var d = a[c];
  8976. this.loadGroup(d.name, d.priority)
  8977. }
  8978. };
  8979. c.prototype.onGroupError = function(a) {
  8980. a.groupName == c.GROUP_CONFIG ? (this.loadingConfigList = null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  8981. };
  8982. c.prototype.hasRes = function(a) {
  8983. var c = this.resConfig.getType(a);
  8984. return "" == c && (a = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(a), "" == c) ? !1 : !0
  8985. };
  8986. c.prototype.parseConfig = function(a, b) {
  8987. this.resConfig.parseConfig(a, b);
  8988. this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
  8989. };
  8990. c.prototype.getRes = function(a) {
  8991. var c = this.resConfig.getType(a);
  8992. return "" == c && (c = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(c), "" == c) ? null: this.getAnalyzerByType(c).getRes(a)
  8993. };
  8994. c.prototype.getResAsync = function(a, c, d) {
  8995. var e = this.resConfig.getType(a),
  8996. f = this.resConfig.getName(a);
  8997. if ("" == e && (f = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(f), "" == e)) {
  8998. c.call(d, null);
  8999. return
  9000. } (e = this.getAnalyzerByType(e).getRes(a)) ? c.call(d, e) : (a = {
  9001. key: a,
  9002. compFunc: c,
  9003. thisObject: d
  9004. },
  9005. this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  9006. };
  9007. c.prototype.getResByUrl = function(a, c, d, e) {
  9008. void 0 === e && (e = "");
  9009. if (a) {
  9010. e || (e = this.getTypeByUrl(a));
  9011. var f = this.getAnalyzerByType(e).getRes(a);
  9012. f ? c.call(d, f) : (c = {
  9013. key: a,
  9014. compFunc: c,
  9015. thisObject: d
  9016. },
  9017. this.asyncDic[a] ? this.asyncDic[a].push(c) : (this.asyncDic[a] = [c], a = new b.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  9018. } else c.call(d, null)
  9019. };
  9020. c.prototype.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  9021. switch (a) {
  9022. case b.ResourceItem.TYPE_XML:
  9023. case b.ResourceItem.TYPE_JSON:
  9024. case b.ResourceItem.TYPE_SHEET:
  9025. break;
  9026. case "png":
  9027. case "jpg":
  9028. case "gif":
  9029. case "jpeg":
  9030. case "bmp":
  9031. a = b.ResourceItem.TYPE_IMAGE;
  9032. break;
  9033. case "fnt":
  9034. a = b.ResourceItem.TYPE_FONT;
  9035. break;
  9036. case "txt":
  9037. a = b.ResourceItem.TYPE_TEXT;
  9038. break;
  9039. case "mp3":
  9040. case "ogg":
  9041. case "mpeg":
  9042. case "wav":
  9043. case "m4a":
  9044. case "mp4":
  9045. case "aiff":
  9046. case "wma":
  9047. case "mid":
  9048. a = b.ResourceItem.TYPE_SOUND;
  9049. break;
  9050. default:
  9051. a = b.ResourceItem.TYPE_BIN
  9052. }
  9053. return a
  9054. };
  9055. c.prototype.onResourceItemComp = function(a) {
  9056. var b = this.asyncDic[a.name];
  9057. delete this.asyncDic[a.name];
  9058. a = this.getAnalyzerByType(a.type);
  9059. for (var c = b.length,
  9060. d = 0; d < c; d++) {
  9061. var e = b[d],
  9062. h = a.getRes(e.key);
  9063. e.compFunc.call(e.thisObject, h, e.key)
  9064. }
  9065. };
  9066. c.prototype.destroyRes = function(a) {
  9067. var b = this.resConfig.getRawGroupByName(a);
  9068. if (b) {
  9069. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  9070. a = b.length;
  9071. for (var d = 0; d < a; d++) {
  9072. c = b[d];
  9073. c.loaded = !1;
  9074. var e = this.getAnalyzerByType(c.type);
  9075. e.destroyRes(c.name)
  9076. }
  9077. return ! 0
  9078. }
  9079. b = this.resConfig.getType(a);
  9080. if ("" == b) return ! 1;
  9081. c = this.resConfig.getRawResourceItem(a);
  9082. c.loaded = !1;
  9083. e = this.getAnalyzerByType(b);
  9084. return e.destroyRes(a)
  9085. };
  9086. c.prototype.setMaxLoadingThread = function(a) {
  9087. 1 > a && (a = 1);
  9088. this.resLoader.thread = a
  9089. };
  9090. c.prototype.setMaxRetryTimes = function(a) {
  9091. a = Math.max(a, 0);
  9092. this.resLoader.maxRetryTimes = a
  9093. };
  9094. c.GROUP_CONFIG = "RES__CONFIG";
  9095. return c
  9096. } (egret.EventDispatcher);
  9097. d.prototype.__class__ = "RES.Resource";
  9098. var c = new d
  9099. })(RES || (RES = {})); !
  9100. function(b, d) {
  9101. "function" == typeof define && (define.amd || define.cmd) ? define(function() {
  9102. return d(b)
  9103. }) : d(b, !0)
  9104. } (this,
  9105. function(b, d) {
  9106. function c(a, c, d) {
  9107. b.WeixinJSBridge ? WeixinJSBridge.invoke(a, e(c),
  9108. function(b) {
  9109. l(a, b, d)
  9110. }) : g(a, d)
  9111. }
  9112. function a(a, c, d) {
  9113. b.WeixinJSBridge ? WeixinJSBridge.on(a,
  9114. function(b) {
  9115. d && d.trigger && d.trigger(b);
  9116. l(a, b, c)
  9117. }) : d ? g(a, d) : g(a, c)
  9118. }
  9119. function e(a) {
  9120. return a = a || {},
  9121. a.appId = z.appId,
  9122. a.verifyAppId = z.appId,
  9123. a.verifySignType = "sha1",
  9124. a.verifyTimestamp = z.timestamp + "",
  9125. a.verifyNonceStr = z.nonceStr,
  9126. a.verifySignature = z.signature,
  9127. a
  9128. }
  9129. function l(a, b, c) {
  9130. var d, e;
  9131. switch (delete b.err_code, delete b.err_desc, delete b.err_detail, d = b.errMsg, d || (d = b.err_msg, delete b.err_msg, d = m(a, d, c), b.errMsg = d), c = c || {},
  9132. c._complete && (c._complete(b), delete c._complete), d = b.errMsg || "", z.debug && !c.isInnerInvoke && alert(JSON.stringify(b)), e = d.indexOf(":"), d.substring(e + 1)) {
  9133. case "ok":
  9134. c.success && c.success(b);
  9135. break;
  9136. case "cancel":
  9137. c.cancel && c.cancel(b);
  9138. break;
  9139. default:
  9140. c.fail && c.fail(b)
  9141. }
  9142. c.complete && c.complete(b)
  9143. }
  9144. function m(a, b) {
  9145. var c, d, e;
  9146. if (b) {
  9147. switch (c = b.indexOf(":"), a) {
  9148. case p.config:
  9149. d = "config";
  9150. break;
  9151. case p.openProductSpecificView:
  9152. d = "openProductSpecificView";
  9153. break;
  9154. default:
  9155. d = b.substring(0, c),
  9156. d = d.replace(/_/g, " "),
  9157. d = d.replace(/\b\w+\b/g,
  9158. function(a) {
  9159. return a.substring(0, 1).toUpperCase() + a.substring(1)
  9160. }),
  9161. d = d.substring(0, 1).toLowerCase() + d.substring(1),
  9162. d = d.replace(/ /g, ""),
  9163. -1 != d.indexOf("Wcpay") && (d = d.replace("Wcpay", "WCPay")),
  9164. (e = q[d]) && (d = e)
  9165. }
  9166. c = b.substring(c + 1);
  9167. "confirm" == c && (c = "ok");
  9168. "failed" == c && (c = "fail"); - 1 != c.indexOf("failed_") && (c = c.substring(7)); - 1 != c.indexOf("fail_") && (c = c.substring(5));
  9169. c = c.replace(/_/g, " ");
  9170. c = c.toLowerCase();
  9171. "access denied" != c && "no permission to execute" != c || (c = "permission denied");
  9172. "config" == d && "function not exist" == c && (c = "ok");
  9173. b = d + ":" + c
  9174. }
  9175. return b
  9176. }
  9177. function k(a) {
  9178. var b, c, d;
  9179. if (a) {
  9180. b = 0;
  9181. for (c = a.length; c > b; ++b) d = a[b],
  9182. (d = p[d]) && (a[b] = d);
  9183. return a
  9184. }
  9185. }
  9186. function g(a, b) {
  9187. if (z.debug && !b.isInnerInvoke) {
  9188. var c = q[a];
  9189. c && (a = c);
  9190. b && b._complete && delete b._complete;
  9191. // console.log('"' + a + '",', b || "")
  9192. }
  9193. }
  9194. function f() {
  9195. if (! ("6.0.2" > A || 0 > y.systemType)) {
  9196. var a = new Image;
  9197. y.appId = z.appId;
  9198. y.initTime = x.initEndTime - x.initStartTime;
  9199. y.preVerifyTime = x.preVerifyEndTime - x.preVerifyStartTime;
  9200. D.getNetworkType({
  9201. isInnerInvoke: !0,
  9202. success: function(b) {
  9203. y.networkType = b.networkType;
  9204. a.src = "https://open.weixin.qq.com/sdk/report?v=" + y.version + "&o=" + y.isPreVerifyOk + "&s=" + y.systemType + "&c=" + y.clientVersion + "&a=" + y.appId + "&n=" + y.networkType + "&i=" + y.initTime + "&p=" + y.preVerifyTime + "&u=" + y.url
  9205. }
  9206. })
  9207. }
  9208. }
  9209. function h(a) {
  9210. u && (b.WeixinJSBridge ? a() : r.addEventListener && r.addEventListener("WeixinJSBridgeReady", a, !1))
  9211. }
  9212. function n() {
  9213. D.invoke || (D.invoke = function(a, c, d) {
  9214. b.WeixinJSBridge && WeixinJSBridge.invoke(a, e(c), d)
  9215. },
  9216. D.on = function(a, c) {
  9217. b.WeixinJSBridge && WeixinJSBridge.on(a, c)
  9218. })
  9219. }
  9220. var p, q, r, t, s, u, v, w, A, x, y, z, B, C, D;
  9221. if (!b.jWeixin) return p = {
  9222. config: "preVerifyJSAPI",
  9223. onMenuShareTimeline: "menu:share:timeline",
  9224. onMenuShareAppMessage: "menu:share:appmessage",
  9225. onMenuShareQQ: "menu:share:qq",
  9226. onMenuShareWeibo: "menu:share:weiboApp",
  9227. previewImage: "imagePreview",
  9228. getLocation: "geoLocation",
  9229. openProductSpecificView: "openProductViewWithPid",
  9230. addCard: "batchAddCard",
  9231. openCard: "batchViewCard",
  9232. chooseWXPay: "getBrandWCPayRequest"
  9233. },
  9234. q = function() {
  9235. var a, b = {};
  9236. for (a in p) b[p[a]] = a;
  9237. return b
  9238. } (),
  9239. r = b.document,
  9240. t = r.title,
  9241. s = navigator.userAgent.toLowerCase(),
  9242. u = -1 != s.indexOf("micromessenger"),
  9243. v = -1 != s.indexOf("android"),
  9244. w = -1 != s.indexOf("iphone") || -1 != s.indexOf("ipad"),
  9245. A = function() {
  9246. var a = s.match(/micromessenger\/(\d+\.\d+\.\d+)/) || s.match(/micromessenger\/(\d+\.\d+)/);
  9247. return a ? a[1] : ""
  9248. } (),
  9249. x = {
  9250. initStartTime: (new Date).getTime(),
  9251. initEndTime: 0,
  9252. preVerifyStartTime: 0,
  9253. preVerifyEndTime: 0
  9254. },
  9255. y = {
  9256. version: 1,
  9257. appId: "",
  9258. initTime: 0,
  9259. preVerifyTime: 0,
  9260. networkType: "",
  9261. isPreVerifyOk: 1,
  9262. systemType: w ? 1 : v ? 2 : -1,
  9263. clientVersion: A,
  9264. url: encodeURIComponent(location.href)
  9265. },
  9266. z = {},
  9267. B = {
  9268. _completes: []
  9269. },
  9270. C = {
  9271. state: 0,
  9272. res: {}
  9273. },
  9274. h(function() {
  9275. x.initEndTime = (new Date).getTime()
  9276. }),
  9277. D = {
  9278. config: function(a) {
  9279. z = a;
  9280. g("config", a);
  9281. h(function() {
  9282. c(p.config, {
  9283. verifyJsApiList: k(z.jsApiList)
  9284. },
  9285. function() {
  9286. B._complete = function(a) {
  9287. x.preVerifyEndTime = (new Date).getTime();
  9288. C.state = 1;
  9289. C.res = a
  9290. };
  9291. B.success = function() {
  9292. y.isPreVerifyOk = 0
  9293. };
  9294. B.fail = function(a) {
  9295. B._fail ? B._fail(a) : C.state = -1
  9296. };
  9297. var a = B._completes;
  9298. return a.push(function() {
  9299. z.debug || f()
  9300. }),
  9301. B.complete = function(b) {
  9302. for (var c = 0,
  9303. d = a.length; d > c; ++c) a[c](b);
  9304. B._completes = []
  9305. },
  9306. B
  9307. } ());
  9308. x.preVerifyStartTime = (new Date).getTime()
  9309. });
  9310. z.beta && n()
  9311. },
  9312. ready: function(a) {
  9313. 0 != C.state ? a() : (B._completes.push(a), !u && z.debug && a())
  9314. },
  9315. error: function(a) {
  9316. "6.0.2" > A || ( - 1 == C.state ? a(C.res) : B._fail = a)
  9317. },
  9318. checkJsApi: function(a) {
  9319. c("checkJsApi", {
  9320. jsApiList: k(a.jsApiList)
  9321. },
  9322. function() {
  9323. return a._complete = function(a) {
  9324. if (v) {
  9325. var b = a.checkResult;
  9326. b && (a.checkResult = JSON.parse(b))
  9327. }
  9328. var c, b = a.checkResult;
  9329. for (c in b)(a = q[c]) && (b[a] = b[c], delete b[c])
  9330. },
  9331. a
  9332. } ())
  9333. },
  9334. onMenuShareTimeline: function(b) {
  9335. a(p.onMenuShareTimeline, {
  9336. complete: function() {
  9337. c("shareTimeline", {
  9338. title: b.title || t,
  9339. desc: b.title || t,
  9340. img_url: b.imgUrl,
  9341. link: b.link || location.href
  9342. },
  9343. b)
  9344. }
  9345. },
  9346. b)
  9347. },
  9348. onMenuShareAppMessage: function(b) {
  9349. a(p.onMenuShareAppMessage, {
  9350. complete: function() {
  9351. c("sendAppMessage", {
  9352. title: b.title || t,
  9353. desc: b.desc || "",
  9354. link: b.link || location.href,
  9355. img_url: b.imgUrl,
  9356. type: b.type || "link",
  9357. data_url: b.dataUrl || ""
  9358. },
  9359. b)
  9360. }
  9361. },
  9362. b)
  9363. },
  9364. onMenuShareQQ: function(b) {
  9365. a(p.onMenuShareQQ, {
  9366. complete: function() {
  9367. c("shareQQ", {
  9368. title: b.title || t,
  9369. desc: b.desc || "",
  9370. img_url: b.imgUrl,
  9371. link: b.link || location.href
  9372. },
  9373. b)
  9374. }
  9375. },
  9376. b)
  9377. },
  9378. onMenuShareWeibo: function(b) {
  9379. a(p.onMenuShareWeibo, {
  9380. complete: function() {
  9381. c("shareWeiboApp", {
  9382. title: b.title || t,
  9383. desc: b.desc || "",
  9384. img_url: b.imgUrl,
  9385. link: b.link || location.href
  9386. },
  9387. b)
  9388. }
  9389. },
  9390. b)
  9391. },
  9392. startRecord: function(a) {
  9393. c("startRecord", {},
  9394. a)
  9395. },
  9396. stopRecord: function(a) {
  9397. c("stopRecord", {},
  9398. a)
  9399. },
  9400. onVoiceRecordEnd: function(b) {
  9401. a("onVoiceRecordEnd", b)
  9402. },
  9403. playVoice: function(a) {
  9404. c("playVoice", {
  9405. localId: a.localId
  9406. },
  9407. a)
  9408. },
  9409. pauseVoice: function(a) {
  9410. c("pauseVoice", {
  9411. localId: a.localId
  9412. },
  9413. a)
  9414. },
  9415. stopVoice: function(a) {
  9416. c("stopVoice", {
  9417. localId: a.localId
  9418. },
  9419. a)
  9420. },
  9421. onVoicePlayEnd: function(b) {
  9422. a("onVoicePlayEnd", b)
  9423. },
  9424. uploadVoice: function(a) {
  9425. c("uploadVoice", {
  9426. localId: a.localId,
  9427. isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
  9428. },
  9429. a)
  9430. },
  9431. downloadVoice: function(a) {
  9432. c("downloadVoice", {
  9433. serverId: a.serverId,
  9434. isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
  9435. },
  9436. a)
  9437. },
  9438. translateVoice: function(a) {
  9439. c("translateVoice", {
  9440. localId: a.localId,
  9441. isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
  9442. },
  9443. a)
  9444. },
  9445. chooseImage: function(a) {
  9446. c("chooseImage", {
  9447. scene: "1|2",
  9448. count: a.count || 9,
  9449. sizeType: a.sizeType || ["original", "compressed"]
  9450. },
  9451. function() {
  9452. return a._complete = function(a) {
  9453. if (v) {
  9454. var b = a.localIds;
  9455. b && (a.localIds = JSON.parse(b))
  9456. }
  9457. },
  9458. a
  9459. } ())
  9460. },
  9461. previewImage: function(a) {
  9462. c(p.previewImage, {
  9463. current: a.current,
  9464. urls: a.urls
  9465. },
  9466. a)
  9467. },
  9468. uploadImage: function(a) {
  9469. c("uploadImage", {
  9470. localId: a.localId,
  9471. isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
  9472. },
  9473. a)
  9474. },
  9475. downloadImage: function(a) {
  9476. c("downloadImage", {
  9477. serverId: a.serverId,
  9478. isShowProgressTips: 0 == a.isShowProgressTips ? 0 : 1
  9479. },
  9480. a)
  9481. },
  9482. getNetworkType: function(a) {
  9483. c("getNetworkType", {},
  9484. function() {
  9485. return a._complete = function(a) {
  9486. var b, c, d = a.errMsg;
  9487. if (a.errMsg = "getNetworkType:ok", b = a.subtype, delete a.subtype, b) a.networkType = b;
  9488. else switch (c = d.indexOf(":"), b = d.substring(c + 1)) {
  9489. case "wifi":
  9490. case "edge":
  9491. case "wwan":
  9492. a.networkType = b;
  9493. break;
  9494. default:
  9495. a.errMsg = "getNetworkType:fail"
  9496. }
  9497. },
  9498. a
  9499. } ())
  9500. },
  9501. openLocation: function(a) {
  9502. c("openLocation", {
  9503. latitude: a.latitude,
  9504. longitude: a.longitude,
  9505. name: a.name || "",
  9506. address: a.address || "",
  9507. scale: a.scale || 28,
  9508. infoUrl: a.infoUrl || ""
  9509. },
  9510. a)
  9511. },
  9512. getLocation: function(a) {
  9513. a = a || {};
  9514. c(p.getLocation, {
  9515. type: a.type || "wgs84"
  9516. },
  9517. function() {
  9518. return a._complete = function(a) {
  9519. delete a.type
  9520. },
  9521. a
  9522. } ())
  9523. },
  9524. hideOptionMenu: function(a) {
  9525. c("hideOptionMenu", {},
  9526. a)
  9527. },
  9528. showOptionMenu: function(a) {
  9529. c("showOptionMenu", {},
  9530. a)
  9531. },
  9532. closeWindow: function(a) {
  9533. a = a || {};
  9534. c("closeWindow", {
  9535. immediate_close: a.immediateClose || 0
  9536. },
  9537. a)
  9538. },
  9539. hideMenuItems: function(a) {
  9540. c("hideMenuItems", {
  9541. menuList: a.menuList
  9542. },
  9543. a)
  9544. },
  9545. showMenuItems: function(a) {
  9546. c("showMenuItems", {
  9547. menuList: a.menuList
  9548. },
  9549. a)
  9550. },
  9551. hideAllNonBaseMenuItem: function(a) {
  9552. c("hideAllNonBaseMenuItem", {},
  9553. a)
  9554. },
  9555. showAllNonBaseMenuItem: function(a) {
  9556. c("showAllNonBaseMenuItem", {},
  9557. a)
  9558. },
  9559. scanQRCode: function(a) {
  9560. a = a || {};
  9561. c("scanQRCode", {
  9562. needResult: a.needResult || 0,
  9563. scanType: a.scanType || ["qrCode", "barCode"]
  9564. },
  9565. function() {
  9566. return a._complete = function(a) {
  9567. var b, c;
  9568. w && (b = a.resultStr, b && (c = JSON.parse(b), a.resultStr = c && c.scan_code && c.scan_code.scan_result))
  9569. },
  9570. a
  9571. } ())
  9572. },
  9573. openProductSpecificView: function(a) {
  9574. c(p.openProductSpecificView, {
  9575. pid: a.productId,
  9576. view_type: a.viewType || 0
  9577. },
  9578. a)
  9579. },
  9580. addCard: function(a) {
  9581. var b, d, e, f = a.cardList,
  9582. g = [];
  9583. b = 0;
  9584. for (d = f.length; d > b; ++b) e = f[b],
  9585. e = {
  9586. card_id: e.cardId,
  9587. card_ext: e.cardExt
  9588. },
  9589. g.push(e);
  9590. c(p.addCard, {
  9591. card_list: g
  9592. },
  9593. function() {
  9594. return a._complete = function(a) {
  9595. var b, c, d, e = a.card_list;
  9596. if (e) {
  9597. e = JSON.parse(e);
  9598. b = 0;
  9599. for (c = e.length; c > b; ++b) d = e[b],
  9600. d.cardId = d.card_id,
  9601. d.cardExt = d.card_ext,
  9602. d.isSuccess = d.is_succ ? !0 : !1,
  9603. delete d.card_id,
  9604. delete d.card_ext,
  9605. delete d.is_succ;
  9606. a.cardList = e;
  9607. delete a.card_list
  9608. }
  9609. },
  9610. a
  9611. } ())
  9612. },
  9613. chooseCard: function(a) {
  9614. c("chooseCard", {
  9615. app_id: z.appId,
  9616. location_id: a.shopId || "",
  9617. sign_type: a.signType || "SHA1",
  9618. card_id: a.cardId || "",
  9619. card_type: a.cardType || "",
  9620. card_sign: a.cardSign,
  9621. time_stamp: a.timestamp + "",
  9622. nonce_str: a.nonceStr
  9623. },
  9624. function() {
  9625. return a._complete = function(a) {
  9626. a.cardList = a.choose_card_info;
  9627. delete a.choose_card_info
  9628. },
  9629. a
  9630. } ())
  9631. },
  9632. openCard: function(a) {
  9633. var b, d, e, f = a.cardList,
  9634. g = [];
  9635. b = 0;
  9636. for (d = f.length; d > b; ++b) e = f[b],
  9637. e = {
  9638. card_id: e.cardId,
  9639. code: e.code
  9640. },
  9641. g.push(e);
  9642. c(p.openCard, {
  9643. card_list: g
  9644. },
  9645. a)
  9646. },
  9647. chooseWXPay: function(a) {
  9648. c(p.chooseWXPay, {
  9649. timeStamp: a.timestamp + "",
  9650. nonceStr: a.nonceStr,
  9651. "package": a.package,
  9652. paySign: a.paySign,
  9653. signType: a.signType || "SHA1"
  9654. },
  9655. a)
  9656. }
  9657. },
  9658. d && (b.wx = b.jWeixin = D),
  9659. D
  9660. });
  9661. var BodyConfig = function() {},
  9662. BodyCheckJsAPISupport = function() {},
  9663. BodyMenuShareTimeline = function() {},
  9664. BodyMenuShareAppMessage = function() {},
  9665. BodyMenuShareQQ = function() {},
  9666. BodyMenuShareWeibo = function() {},
  9667. egret_4399_h5api = function() {
  9668. return {
  9669. initGame: function(b, d, c, a) {
  9670. },
  9671. progress: function(b) {
  9672. },
  9673. isWeixinBrowser: function() {
  9674. },
  9675. share: function(b) {
  9676. },
  9677. moreGame: function() {
  9678. },
  9679. submitScore: function(b, d, c) {
  9680. },
  9681. getRank: function(b, d) {
  9682. }
  9683. }
  9684. } (),
  9685. __extends = this.__extends ||
  9686. function(b, d) {
  9687. function c() {
  9688. this.constructor = b
  9689. }
  9690. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9691. c.prototype = d.prototype;
  9692. b.prototype = new c
  9693. },
  9694. MoveObject = function(b) {
  9695. function d() {
  9696. b.apply(this, arguments);
  9697. this.currentFramesTotal = this.speedY = this.speedX = 0;
  9698. this.frameData = {}
  9699. }
  9700. __extends(d, b);
  9701. d.prototype.initMe = function(b, a) {
  9702. this._setAnchorX(0.5);
  9703. this._setAnchorY(0.5);
  9704. this.x = b;
  9705. this.y = a;
  9706. this.createBm()
  9707. };
  9708. d.prototype.getFrameData = function() {
  9709. for (var b = this.myMc._frameLabels,
  9710. a = 0; a < b.length; a++) this.frameData[b[a]._name] = a == b.length - 1 ? this.myMc.totalFrames: b[a + 1]._frame,
  9711. console.log("mcData[i]._name", this.frameData)
  9712. };
  9713. d.prototype.changeFrame = function(b) {
  9714. this.currentStatus = b;
  9715. this.myMc.gotoAndPlay(b);
  9716. this.currentFramesTotal = this.frameData[b]
  9717. };
  9718. d.prototype.frameAction = function() {
  9719. this.myMc.currentFrame >= this.currentFramesTotal - 2 && this.frameOver()
  9720. };
  9721. d.prototype.frameOver = function() {};
  9722. d.prototype.createMovieClip = function(b, a) {
  9723. var d = GameTools.createMovieClip(b, a);
  9724. this.addChild(d);
  9725. return d
  9726. };
  9727. d.prototype.createAndPlayAni = function(b, a, d, l) {
  9728. void 0 === d && (d = 0);
  9729. void 0 === l && (l = 0);
  9730. GameTools.addArmatureToFactory(b);
  9731. b = GameTools.createArmature(b);
  9732. var m = b.getDisplay();
  9733. this.addChild(m);
  9734. m.x = d;
  9735. m.y = l;
  9736. b.animation.gotoAndPlay(a);
  9737. return b
  9738. };
  9739. d.prototype.createBm = function() {
  9740. // console.log("this", this.bmName);
  9741. "" != this.bmName && (this.bm = GameTools.createBitmapByName(this.bmName), this.addChild(this.bm))
  9742. };
  9743. d.prototype.setScale = function(b) {
  9744. this.scaleX = this.scaleY = b
  9745. };
  9746. d.prototype.updateEvent = function() {
  9747. this.controlMe();
  9748. this.myMc && this.frameAction();
  9749. this.changeData();
  9750. this.checkBound()
  9751. };
  9752. d.prototype.controlMe = function() {};
  9753. d.prototype.changeData = function() {
  9754. this.x += this.speedX;
  9755. this.y += this.speedY
  9756. };
  9757. d.prototype.checkBound = function() {};
  9758. d.prototype.addTouchLisnter = function() {
  9759. this.touchEnabled = !0;
  9760. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this);
  9761. this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this);
  9762. this.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this)
  9763. };
  9764. d.prototype.touchBegin = function(b) {};
  9765. d.prototype.touchMove = function(b) {};
  9766. d.prototype.touchEnd = function(b) {};
  9767. d.prototype.setSpeed = function(b, a) {
  9768. this.speedX = b;
  9769. this.speedY = a
  9770. };
  9771. d.prototype.removeMe = function() {
  9772. this.parent && this.parent.removeChild(this);
  9773. GameTools.removeObject(GameData.gameSys.actionArr, this)
  9774. };
  9775. return d
  9776. } (egret.Sprite);
  9777. MoveObject.prototype.__class__ = "MoveObject";
  9778. var __extends = this.__extends ||
  9779. function(b, d) {
  9780. function c() {
  9781. this.constructor = b
  9782. }
  9783. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9784. c.prototype = d.prototype;
  9785. b.prototype = new c
  9786. },
  9787. BaseUI = function(b) {
  9788. function d() {
  9789. b.call(this);
  9790. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9791. // console.log("\u521b\u5efaUI,,,,,")
  9792. }
  9793. __extends(d, b);
  9794. d.prototype.onAddToStage = function(b) {};
  9795. d.prototype.centerXBm = function(b) {
  9796. b.x = (GameData.gameStage.stage.stageWidth - b.width) / 2
  9797. };
  9798. d.prototype.rightBm = function(b) {
  9799. b.x = GameData.gameStage.stage.stageWidth - b.width
  9800. };
  9801. d.prototype.bottomBm = function(b) {
  9802. b.y = GameData.gameStage.stage.stageHeight - b.height
  9803. };
  9804. d.prototype.createCenterXBm = function(b, a) {
  9805. var d = GameTools.addBitmap(this, b, 50, a);
  9806. d.x = (GameData.gameStage.stage.stageWidth - d.width) / 2;
  9807. return d
  9808. };
  9809. d.prototype.removeMe = function() {
  9810. this.parent && this.parent.removeChild(this)
  9811. };
  9812. return d
  9813. } (egret.Sprite);
  9814. BaseUI.prototype.__class__ = "BaseUI";
  9815. var __extends = this.__extends ||
  9816. function(b, d) {
  9817. function c() {
  9818. this.constructor = b
  9819. }
  9820. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9821. c.prototype = d.prototype;
  9822. b.prototype = new c
  9823. },
  9824. GameUI = function(b) {
  9825. function d() {
  9826. b.apply(this, arguments)
  9827. }
  9828. __extends(d, b);
  9829. return d
  9830. } (BaseUI);
  9831. GameUI.prototype.__class__ = "GameUI";
  9832. var GameData = function() {
  9833. function b() {}
  9834. b.currentLevel = 1;
  9835. b.levelData = [{
  9836. enemyCount: 5,
  9837. enemySpeed: 3
  9838. },
  9839. {
  9840. enemyCount: 7,
  9841. enemySpeed: 4
  9842. },
  9843. {
  9844. enemyCount: 9,
  9845. enemySpeed: 5
  9846. },
  9847. {
  9848. enemyCount: 11,
  9849. enemySpeed: 6
  9850. },
  9851. {
  9852. enemyCount: 13,
  9853. enemySpeed: 7
  9854. },
  9855. {
  9856. enemyCount: 15,
  9857. enemySpeed: 8
  9858. },
  9859. {
  9860. enemyCount: 17,
  9861. enemySpeed: 9
  9862. },
  9863. {
  9864. enemyCount: 19,
  9865. enemySpeed: 10
  9866. },
  9867. {
  9868. enemyCount: 21,
  9869. enemySpeed: 11
  9870. },
  9871. {
  9872. enemyCount: 23,
  9873. enemySpeed: 12
  9874. },
  9875. {
  9876. enemyCount: 25,
  9877. enemySpeed: 13
  9878. }];
  9879. return b
  9880. } ();
  9881. GameData.prototype.__class__ = "GameData";
  9882. var __extends = this.__extends ||
  9883. function(b, d) {
  9884. function c() {
  9885. this.constructor = b
  9886. }
  9887. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  9888. c.prototype = d.prototype;
  9889. b.prototype = new c
  9890. },
  9891. GameScene = function(b) {
  9892. function d() {
  9893. b.apply(this, arguments)
  9894. }
  9895. __extends(d, b);
  9896. d.prototype.onAddToStage = function(b) {
  9897. this.initGame()
  9898. };
  9899. d.prototype.initGame = function() {
  9900. document.getElementById("toolbar").style.display="none";
  9901. this.initData();
  9902. this.createContainers();
  9903. this.createMap();
  9904. this.createMajor();
  9905. this.createEnemys(this.enemyCount);
  9906. this.createUI();
  9907. this.addEventListener(egret.Event.ENTER_FRAME, this.updateEvent, this)
  9908. };
  9909. d.prototype.initData = function() {
  9910. GameData.gameSys = this;
  9911. this.enemyCount = this.screenScale = 1;
  9912. this.enemySpeed = 3 / this.screenScale;
  9913. this.actionArr = [];
  9914. this.enemyArr = [];
  9915. this.isMouseDown = !1;
  9916. this.gameType = "playing";
  9917. this.scaleMode = "normal";
  9918. this.frameCount = this.scaleCount = 0;
  9919. this.frameRate = 1;
  9920. this.timeInter = 100;
  9921. this.timeCount = 0;
  9922. this.enemyAddNum = 1
  9923. };
  9924. d.prototype.createContainers = function() {
  9925. this.bottomContainer = new egret.Sprite;
  9926. this.addChild(this.bottomContainer);
  9927. this.objectContainer = new egret.Sprite;
  9928. this.addChild(this.objectContainer);
  9929. this.uiContainer = new egret.Sprite;
  9930. this.addChild(this.uiContainer)
  9931. };
  9932. d.prototype.createMap = function() {};
  9933. d.prototype.createMajor = function() {
  9934. // console.log("\u521b\u5efa\u4e3b\u89d2");
  9935. GameData.major = new Major;
  9936. GameData.major.initMe(300, 50);
  9937. this.objectContainer.addChild(GameData.major);
  9938. GameTools.addObject(this.actionArr, GameData.major)
  9939. };
  9940. d.prototype.createEnemys = function(b) {
  9941. for (var a = 0; a < b; a++) {
  9942. for (var d, l, m, k = 0; ! d;) {
  9943. d = !0;
  9944. l = Math.random() * GameData.gameStage.stage.stageWidth;
  9945. m = Math.random() * (GameData.gameStage.stage.stageHeight - 50) + 25;
  9946. // console.log("this.enemyArr.length", this.enemyArr.length);
  9947. a = 0;
  9948. a: for (; a < this.enemyArr.length; a++) if (100 > GameTools.getDistance(this.enemyArr[a].x, this.enemyArr[a].y, l, m)) {
  9949. // console.log("\u8ddd\u79bb\u76ee\u6807\u8fc7\u8fd1");
  9950. d = !1;
  9951. break a
  9952. }
  9953. 250 > GameTools.getDistance(GameData.major.x, GameData.major.y, l, m) && (console.log("\u8ddd\u79bb\u4e3b\u89d2\u8fc7\u8fd1========="), d = !1);
  9954. // console.log("\u627e\u4e86\u51e0\u6b21?", k);
  9955. if (50 <= ++k) break
  9956. }
  9957. d && (console.log(Math.round(l), Math.round(m)), this.createEnemy(l, m))
  9958. }
  9959. };
  9960. d.prototype.createEnemys2 = function(b) {
  9961. for (var a = 0; a < b; a++) {
  9962. var d = 4 * Math.random(),
  9963. l,
  9964. m;
  9965. 1 > d ? (l = Math.random() * GameData.gameStage.stage.stageWidth, m = Math.random() * (GameData.gameStage.stage.stageHeight - 100) + 50) : 2 > d && (l = Math.random() * GameData.gameStage.stage.stageWidth, m = Math.random() * (GameData.gameStage.stage.stageHeight - 100) + 50);
  9966. this.createEnemy(l, m)
  9967. }
  9968. };
  9969. d.prototype.createEnemy = function(b, a) {
  9970. var d = new Enemy;
  9971. d.speedAll = this.enemySpeed;
  9972. d.initMe(b, a);
  9973. this.objectContainer.addChild(d);
  9974. GameTools.addObject(this.enemyArr, d);
  9975. GameTools.addObject(this.actionArr, d)
  9976. };
  9977. d.prototype.createDoor = function() {
  9978. GameData.door = new Door;
  9979. GameData.door.initMe(Math.random() * (GameData.gameStage.stage.stageWidth - 200) + 50, GameData.gameStage.stage.stageHeight - 200);
  9980. this.objectContainer.addChild(GameData.door)
  9981. };
  9982. d.prototype.createUI = function() {
  9983. GameData.gameStage.touchEnabled = !0;
  9984. GameData.gameStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this);
  9985. GameData.gameStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this);
  9986. GameData.gameStage.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this)
  9987. };
  9988. d.prototype.pressSkill = function(b) {
  9989. b.skill2();
  9990. b.uiBtn && (b.uiBtn.removeMe(), b.uiBtn = null)
  9991. };
  9992. d.prototype.skill1 = function() {
  9993. this.changeScale("scaleup");
  9994. this.changeFrameRate(5)
  9995. };
  9996. d.prototype.skill2 = function() {
  9997. for (var b = 0; b < this.enemyArr.length; b++) if (300 > GameTools.getDistance(this.enemyArr[b].x, this.enemyArr[b].y, GameData.major.x, GameData.major.y)) {
  9998. var a = GameTools.getAngel(this.enemyArr[b].x, this.enemyArr[b].y, GameData.major.x, GameData.major.y);
  9999. this.enemyArr[b].setSpeed(8 * -Math.cos(a), 8 * -Math.sin(a));
  10000. this.enemyArr[b].below = !0
  10001. }
  10002. };
  10003. d.prototype.changeScale = function(b) {
  10004. this.scaleMode = b;
  10005. this.scaleCount = 30
  10006. };
  10007. d.prototype.touchBegin = function(b) {
  10008. this.isMouseDown = !0;
  10009. this.oldX = b.localX;
  10010. this.oldY = b.localY
  10011. };
  10012. d.prototype.touchMove = function(b) {
  10013. if (this.isMouseDown) {
  10014. var a = b.localY - this.oldY;
  10015. GameData.major.x += b.localX - this.oldX;
  10016. GameData.major.y += a;
  10017. this.oldX = b.localX;
  10018. this.oldY = b.localY
  10019. }
  10020. };
  10021. d.prototype.touchEnd = function(b) {
  10022. this.isMouseDown = !1
  10023. };
  10024. d.prototype.changeFrameRate = function(b) {
  10025. this.frameRate = b;
  10026. this.frameCount = 0
  10027. };
  10028. d.prototype.setAllEnemySpeed = function() {};
  10029. d.prototype.updateEvent = function() {
  10030. if (0 == ++this.frameCount % this.frameRate) {
  10031. if (0 == ++this.timeCount % this.timeInter) {
  10032. this.setAllEnemySpeed();
  10033. this.enemySpeed += 0.3;
  10034. this.createEnemys(this.enemyAddNum);
  10035. this.enemyAddNum++;
  10036. this.screenScale += 0.03;
  10037. 6 == this.enemyAddNum ? GameData.major.changeFrame("status2") : 12 == this.enemyAddNum && GameData.major.changeFrame("status3");
  10038. for (var b = 0; b < this.actionArr.length; b++) this.actionArr[b].setScale(1 / GameData.gameSys.screenScale)
  10039. }
  10040. this.isMouseDown && this.mouseIsDown();
  10041. this.scaleFunc();
  10042. for (b = this.actionArr.length - 1; 0 <= b; b--) this.actionArr[b].updateEvent();
  10043. "lose" == this.gameType ? (this.removeSystem(), SceneManager.changeScene("lose")) : "win" == this.gameType && (this.removeSystem(), SceneManager.changeScene("win"))
  10044. }
  10045. };
  10046. d.prototype.scaleFunc = function() {
  10047. "normal" != this.scaleMode && ("scaleup" == this.scaleMode ? (this.scaleCount--, 0 < this.scaleCount || -50 != this.scaleCount || (this.changeScale("scaledown"), this.changeFrameRate(1))) : (this.scaleMode = "scaledown", console.log("\u7f29\u5c0f"), 0 < this.scaleCount || 0 == this.scaleCount && this.changeScale("normal"), this.scaleCount--))
  10048. };
  10049. d.prototype.mouseIsDown = function() {};
  10050. d.prototype.removeSystem = function() {
  10051. this.uiBtn && this.uiBtn.removeMe();
  10052. this.parent && this.parent.removeChild(this);
  10053. this.removeEventListener(egret.Event.ENTER_FRAME, this.updateEvent, this);
  10054. GameData.gameStage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this);
  10055. GameData.gameStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this);
  10056. GameData.gameStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this)
  10057. };
  10058. return d
  10059. } (BaseUI);
  10060. GameScene.prototype.__class__ = "GameScene";
  10061. var __extends = this.__extends ||
  10062. function(b, d) {
  10063. function c() {
  10064. this.constructor = b
  10065. }
  10066. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10067. c.prototype = d.prototype;
  10068. b.prototype = new c
  10069. },
  10070. LosePage = function(b) {
  10071. function d() {
  10072. b.apply(this, arguments)
  10073. }
  10074. __extends(d, b);
  10075. d.prototype.onAddToStage = function(b) {
  10076. var a = RES.getRes("nameJson"),
  10077. d = RES.getRes("uiJson");
  10078. b = Math.round(GameData.gameSys.timeCount / 60 * 100) / 100;
  10079. dp_submitScore(b);
  10080. window.score=b;
  10081. //updateShare(window.score);
  10082. //Play68.setRankingScoreDesc(window.score);
  10083. document.getElementById("toolbar").style.display="block";
  10084. var l = GameTools.addPicFromSheet(d, "ui1", this, 0, 50);
  10085. this.centerXBm(l);
  10086. this.centerXBm(GameTools.addPicFromSheet(d, "ui5", this, 0, 250));
  10087. this.centerXBm(GameTools.addPicFromSheet(d, "ui6", this, 0, 350));
  10088. this.centerXBm(GameTools.addPicFromSheet(d, "ui7", this, 0, 410));
  10089. var m = this.getTitle(b);
  10090. console.log("title", m);
  10091. this.centerXBm(GameTools.addPicFromSheet(a, m, this, 0, 460));
  10092. a = GameTools.addPicFromSheet(d, "ui2", this, 250, 550);
  10093. a.touchEnabled = !0;
  10094. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchHd, this);
  10095. a = GameTools.addPicFromSheet(d, "share", this, 50, 528);
  10096. a.touchEnabled = !0;
  10097. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.share, this);
  10098. this.centerXBm(GameTools.addPicFromSheet(d, "die", this, 0, 650));
  10099. d = GameTools.addNumberPic(this, b.toString(), "num1Json", l.x + 255, 102);
  10100. b = GameTools.addNumberPic(this, (Math.round(100 * (75 + Math.pow(b, 0.9))) / 100).toString() + "%", "num2Json", 200, 300);
  10101. d.x -= d.width / 2;
  10102. b.x = (GameData.gameStage.stage.stageWidth - b.width) / 2 - 25;
  10103. RES.destroyRes("nameJson");
  10104. RES.destroyRes("uiJson")
  10105. };
  10106. d.prototype.submitScore = function() {
  10107. egret_4399_h5api.submitScore(2123, this.submitSuccess, this)
  10108. };
  10109. d.prototype.submitSuccess = function(b) {
  10110. };
  10111. d.prototype.share = function() {
  10112. dp_share();
  10113. };
  10114. d.prototype.getTitle = function(b) {
  10115. var a = "name0";
  10116. 28 <= b ? a = "name7": 26 <= b ? a = "name7": 24 <= b ? a = "name6": 21 <= b ? a = "name5": 18 <= b ? a = "name4": 14 <= b ? a = "name3": 10 <= b ? a = "name2": 5 <= b && (a = "name1");
  10117. return a
  10118. };
  10119. d.prototype.touchHd = function() {
  10120. // console.log("\u70b9\u51fb>");
  10121. SceneManager.changeScene("game")
  10122. };
  10123. d.prototype.removeMe = function() {
  10124. b.prototype.removeMe.call(this)
  10125. };
  10126. return d
  10127. } (BaseUI);
  10128. LosePage.prototype.__class__ = "LosePage";
  10129. var __extends = this.__extends ||
  10130. function(b, d) {
  10131. function c() {
  10132. this.constructor = b
  10133. }
  10134. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10135. c.prototype = d.prototype;
  10136. b.prototype = new c
  10137. },
  10138. TitlePage = function(b) {
  10139. function d() {
  10140. b.apply(this, arguments)
  10141. }
  10142. __extends(d, b);
  10143. d.prototype.onAddToStage = function(b) {
  10144. b = RES.getRes("uiJson");
  10145. this.centerXBm(GameTools.addPicFromSheet(b, "title", this, 0, 100));
  10146. this.centerXBm(GameTools.addPicFromSheet(b, "start", this, 0, 600));
  10147. this.touchEnabled = !0;
  10148. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchHd, this);
  10149. RES.destroyRes("uiJson")
  10150. };
  10151. d.prototype.touchHd = function(b) {
  10152. // console.log("\u70b9\u51fb>");
  10153. SceneManager.changeScene("game")
  10154. };
  10155. d.prototype.removeMe = function() {
  10156. RES.destroyRes("titleBg");
  10157. b.prototype.removeMe.call(this);
  10158. this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchHd, this)
  10159. };
  10160. return d
  10161. } (BaseUI);
  10162. TitlePage.prototype.__class__ = "TitlePage";
  10163. var __extends = this.__extends ||
  10164. function(b, d) {
  10165. function c() {
  10166. this.constructor = b
  10167. }
  10168. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10169. c.prototype = d.prototype;
  10170. b.prototype = new c
  10171. },
  10172. WinPage = function(b) {
  10173. function d() {
  10174. b.apply(this, arguments)
  10175. }
  10176. __extends(d, b);
  10177. d.prototype.onAddToStage = function(b) {
  10178. GameTools.createBtn(this, "\u4f60\u8d62\u4e86\uff01", null, 200, 100);
  10179. GameTools.createBtn(this, "\u7ee7\u7eed->", this.touchHd, 200, 400);
  10180. GameData.currentLevel++
  10181. };
  10182. d.prototype.touchHd = function() {
  10183. // console.log("\u70b9\u51fb>");
  10184. this.removeMe();
  10185. SceneManager.changeScene("game");
  10186. };
  10187. d.prototype.removeMe = function() {
  10188. b.prototype.removeMe.call(this)
  10189. };
  10190. return d
  10191. } (BaseUI);
  10192. WinPage.prototype.__class__ = "WinPage";
  10193. var __extends = this.__extends ||
  10194. function(b, d) {
  10195. function c() {
  10196. this.constructor = b
  10197. }
  10198. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10199. c.prototype = d.prototype;
  10200. b.prototype = new c
  10201. },
  10202. BlackScreen = function(b) {
  10203. function d() {
  10204. b.apply(this, arguments)
  10205. }
  10206. __extends(d, b);
  10207. d.prototype.initData = function(b) { (this.isAction = b) && this.addEventListener(egret.Event.ENTER_FRAME, this.updateEvent, this);
  10208. this.graphics.beginFill(16711680);
  10209. this.graphics.drawRect(0, 0, GameData.gameStage.stage.stageWidth, GameData.gameStage.stage.stageHeight);
  10210. this.graphics.endFill()
  10211. };
  10212. d.prototype.updateEvent = function(b) {
  10213. this.alpha -= 0.1;
  10214. 0 >= this.alpha && this.removeMe()
  10215. };
  10216. d.prototype.removeMe = function() {
  10217. this.parent && this.parent.removeChild(this);
  10218. this.removeEventListener(egret.Event.ENTER_FRAME, this.updateEvent, this)
  10219. };
  10220. return d
  10221. } (egret.Sprite);
  10222. BlackScreen.prototype.__class__ = "BlackScreen";
  10223. var __extends = this.__extends ||
  10224. function(b, d) {
  10225. function c() {
  10226. this.constructor = b
  10227. }
  10228. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10229. c.prototype = d.prototype;
  10230. b.prototype = new c
  10231. },
  10232. Btn = function(b) {
  10233. function d() {
  10234. b.call(this);
  10235. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  10236. }
  10237. __extends(d, b);
  10238. d.prototype.onAddToStage = function(b) {};
  10239. d.prototype.initMe = function(b, a, d) {
  10240. void 0 === d && (d = null);
  10241. this.target = d;
  10242. this.callBack = a;
  10243. // console.log("callBack", this.callBack);
  10244. this.myTxt = new egret.TextField;
  10245. this.myTxt.text = b;
  10246. this.myTxt.textWidth = 900;
  10247. this.addChild(this.myTxt);
  10248. this.drawShape(this.myTxt.width, this.myTxt.height);
  10249. null != this.callBack && (this.touchEnabled = !0, this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this))
  10250. };
  10251. d.prototype.drawShape = function(b, a) {
  10252. this.myShape = new egret.Shape;
  10253. this.graphics.beginFill(7829367);
  10254. this.graphics.drawRect( - 10, -5, b + 20, a + 10);
  10255. this.graphics.endFill();
  10256. this.addChildAt(this.myShape, 0)
  10257. };
  10258. d.prototype.onTouchBegin = function(b) {
  10259. this.target ? this.callBack(this.target) : this.callBack()
  10260. };
  10261. d.prototype.removeMe = function() {
  10262. this.parent && this.parent.removeChild(this);
  10263. null != this.callBack && this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this)
  10264. };
  10265. return d
  10266. } (egret.Sprite);
  10267. Btn.prototype.__class__ = "Btn";
  10268. var __extends = this.__extends ||
  10269. function(b, d) {
  10270. function c() {
  10271. this.constructor = b
  10272. }
  10273. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10274. c.prototype = d.prototype;
  10275. b.prototype = new c
  10276. },
  10277. NumberPic = function(b) {
  10278. function d() {
  10279. b.apply(this, arguments)
  10280. }
  10281. __extends(d, b);
  10282. d.prototype.initNum = function(b, a) {
  10283. for (var d = GameTools.getNum(b), l = RES.getRes(a), m = 0; m < d.length; m++) {
  10284. var k = GameTools.createPicFromSheet(l, "." == d[m] ? "dot": "%" == d[m] ? "per": d[m]);
  10285. this.addChild(k);
  10286. k.x = this.width
  10287. }
  10288. RES.destroyRes(a)
  10289. };
  10290. return d
  10291. } (egret.Sprite);
  10292. NumberPic.prototype.__class__ = "NumberPic";
  10293. var __extends = this.__extends ||
  10294. function(b, d) {
  10295. function c() {
  10296. this.constructor = b
  10297. }
  10298. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10299. c.prototype = d.prototype;
  10300. b.prototype = new c
  10301. },
  10302. LoadingUI = function(b) {
  10303. function d() {
  10304. b.call(this);
  10305. this.createView()
  10306. }
  10307. __extends(d, b);
  10308. d.prototype.createView = function() {
  10309. this.textField = new egret.TextField;
  10310. this.addChild(this.textField);
  10311. this.textField.y = 300;
  10312. this.textField.width = 480;
  10313. this.textField.height = 100;
  10314. this.textField.textAlign = "center"
  10315. };
  10316. d.prototype.setProgress = function(b, a) {
  10317. this.textField.text = "Loading..." + b + "/" + a
  10318. };
  10319. return d
  10320. } (egret.Sprite);
  10321. LoadingUI.prototype.__class__ = "LoadingUI";
  10322. var SceneManager = function() {
  10323. function b() {}
  10324. b.changeScene = function(b) {
  10325. null != this.currentPage && this.currentPage.removeMe();
  10326. "title" == b ? (this.currentPage = new TitlePage, GameData.gameStage.addChild(this.currentPage)) : "game" == b ? (this.currentPage = new GameScene, GameData.gameStage.addChild(this.currentPage)) : "lose" == b ? (this.currentPage = new LosePage, GameData.gameStage.addChild(this.currentPage)) : "win" == b && (this.currentPage = new WinPage, GameData.gameStage.addChild(this.currentPage))
  10327. };
  10328. return b
  10329. } ();
  10330. SceneManager.prototype.__class__ = "SceneManager";
  10331. var GameTools = function() {
  10332. function b() {}
  10333. b.createBitmapByName = function(b) {
  10334. var c = new egret.Bitmap;
  10335. b = RES.getRes(b);
  10336. c.texture = b;
  10337. return c
  10338. };
  10339. b.addBitmap = function(d, c, a, e) {
  10340. c = b.createBitmapByName(c);
  10341. d.addChild(c);
  10342. c.x = a;
  10343. c.y = e;
  10344. return c
  10345. };
  10346. b.getNum = function(b) {
  10347. for (var c = b.length,
  10348. a = [], e = 0; e < c; e++) a.push(b.charAt(e));
  10349. return a
  10350. };
  10351. b.addNumberPic = function(b, c, a, e, l) {
  10352. var m = new NumberPic;
  10353. m.initNum(c, a);
  10354. b.addChild(m);
  10355. m.x = e;
  10356. m.y = l;
  10357. return m
  10358. };
  10359. b.addBlackScreen = function() {
  10360. var b = new BlackScreen;
  10361. b.initData(!0);
  10362. GameData.gameStage.addChild(b)
  10363. };
  10364. b.addObject = function(b, c) { - 1 == b.indexOf(c) && b.push(c)
  10365. };
  10366. b.removeObject = function(b, c) { - 1 != b.indexOf(c) && b.splice(b.indexOf(c), 1)
  10367. };
  10368. b.getDistance = function(b, c, a, e) {
  10369. return Math.sqrt(Math.pow(a - b, 2) + Math.pow(e - c, 2))
  10370. };
  10371. b.getAngel = function(b, c, a, e) {
  10372. return Math.atan2(e - c, a - b)
  10373. };
  10374. b.createBtn = function(b, c, a, e, l, m) {
  10375. void 0 === m && (m = null);
  10376. var k = new Btn;
  10377. b.addChild(k);
  10378. k.x = e;
  10379. k.y = l;
  10380. k.initMe(c, a, m);
  10381. return k
  10382. };
  10383. b.createMovieClip = function(b, c) {
  10384. var a = RES.getRes(b + ".json"),
  10385. e = RES.getRes(b + ".png"),
  10386. a = new egret.MovieClipDataFactory(a, e),
  10387. a = new egret.MovieClip(a.generateMovieClipData(c));
  10388. // console.log("mc", a);
  10389. // console.log("width", a.width);
  10390. return a
  10391. };
  10392. b.addArmatureToFactory = function(b) {
  10393. RES.getRes(b + "/skeleton.json");
  10394. RES.getRes(b + "/texture.json");
  10395. RES.getRes(b + "/texture.png")
  10396. };
  10397. b.createArmature = function(b) {};
  10398. b.createPicFromSheet = function(b, c) {
  10399. return new egret.Bitmap(b.getTexture(c))
  10400. };
  10401. b.addPicFromSheet = function(d, c, a, e, l) {
  10402. d = b.createPicFromSheet(d, c);
  10403. d.x = e;
  10404. d.y = l;
  10405. a.addChild(d);
  10406. return d
  10407. };
  10408. return b
  10409. } ();
  10410. GameTools.prototype.__class__ = "GameTools";
  10411. var __extends = this.__extends ||
  10412. function(b, d) {
  10413. function c() {
  10414. this.constructor = b
  10415. }
  10416. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10417. c.prototype = d.prototype;
  10418. b.prototype = new c
  10419. },
  10420. Main = function(b) {
  10421. function d() {
  10422. b.call(this);
  10423. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  10424. }
  10425. __extends(d, b);
  10426. d.prototype.onAddToStage = function(b) {
  10427. this.loadingView = new LoadingUI;
  10428. this.stage.addChild(this.loadingView);
  10429. GameData.gameStage = this;
  10430. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  10431. RES.loadConfig("resource/resource.json", "resource/");
  10432. egret_4399_h5api.initGame(100038589, "PM2.5\u6765\u4e86", this.stage.stageWidth, this.stage.stageHeight)
  10433. };
  10434. d.prototype.onConfigComplete = function(b) {
  10435. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  10436. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  10437. RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
  10438. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  10439. RES.loadGroup("loading")
  10440. };
  10441. d.prototype.onResourceLoadComplete = function(b) {
  10442. // console.log("\u8c01\u5148\u52a0\u8f7d\u5b8c\u6210?", b.groupName);
  10443. "preload" == b.groupName ? (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene()) : "loading" == b.groupName && (b = GameTools.createBitmapByName("bgImage"), this.addChild(b), b.scaleX = b.scaleY = 2, setTimeout(function() {
  10444. RES.loadGroup("num1");
  10445. RES.loadGroup("num2");
  10446. RES.loadGroup("preload")
  10447. },
  10448. 500), console.log("\u52a0\u4e00\u4e2a\u80cc\u666f"))
  10449. };
  10450. d.prototype.onResourceLoadError = function(b) {
  10451. console.warn("Group:" + b.groupName + " has failed to load");
  10452. this.onResourceLoadComplete(b)
  10453. };
  10454. d.prototype.onResourceProgress = function(b) {
  10455. // console.log("event.groupName", b.groupName, b.resItem);
  10456. //"preload" == b.groupName && egret_4399_h5api.progress(b.itemsLoaded / b.itemsTotal * 100)
  10457. };
  10458. d.prototype.createGameScene = function() {
  10459. SceneManager.changeScene("title")
  10460. };
  10461. return d
  10462. } (egret.DisplayObjectContainer);
  10463. Main.prototype.__class__ = "Main";
  10464. var __extends = this.__extends ||
  10465. function(b, d) {
  10466. function c() {
  10467. this.constructor = b
  10468. }
  10469. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10470. c.prototype = d.prototype;
  10471. b.prototype = new c
  10472. },
  10473. Door = function(b) {
  10474. function d() {
  10475. b.call(this);
  10476. this.bmName = "doorPixel"
  10477. }
  10478. __extends(d, b);
  10479. return d
  10480. } (MoveObject);
  10481. Door.prototype.__class__ = "Door";
  10482. var __extends = this.__extends ||
  10483. function(b, d) {
  10484. function c() {
  10485. this.constructor = b
  10486. }
  10487. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10488. c.prototype = d.prototype;
  10489. b.prototype = new c
  10490. },
  10491. Enemy = function(b) {
  10492. function d() {
  10493. b.call(this);
  10494. this.bmName = "enemy" + (Math.floor(6 * Math.random()) + 1).toString() + "Pixel";
  10495. // console.log("this.bmName", this.bmName)
  10496. }
  10497. __extends(d, b);
  10498. d.prototype.initMe = function(c, a) {
  10499. b.prototype.initMe.call(this, c, a);
  10500. this.moveAngle = 3.14 * Math.random();
  10501. this.speedX = Math.cos(this.moveAngle) * this.speedAll;
  10502. this.speedY = Math.sin(this.moveAngle) * this.speedAll
  10503. };
  10504. d.prototype.controlMe = function() {
  10505. this.rotation += this.speedAll / 2;
  10506. GameTools.getDistance(this.x, this.y, GameData.major.x, GameData.major.y) < 35 / GameData.gameSys.screenScale && (GameData.gameSys.gameType = "lose")
  10507. };
  10508. d.prototype.checkBound = function() {
  10509. 0 > this.x ? (this.x = 0, this.speedX *= -1, this.below && this.removeMe()) : this.x > GameData.gameStage.stage.stageWidth - 40 && (this.x = GameData.gameStage.stage.stageWidth - 40, this.speedX *= -1, this.below && this.removeMe());
  10510. 0 > this.y ? (this.y = 0, this.speedY *= -1, this.below && this.removeMe()) : this.y > GameData.gameStage.stage.stageHeight - 40 && (this.y = GameData.gameStage.stage.stageHeight - 40, this.speedY *= -1, this.below && this.removeMe())
  10511. };
  10512. return d
  10513. } (MoveObject);
  10514. Enemy.prototype.__class__ = "Enemy";
  10515. var __extends = this.__extends ||
  10516. function(b, d) {
  10517. function c() {
  10518. this.constructor = b
  10519. }
  10520. for (var a in d) d.hasOwnProperty(a) && (b[a] = d[a]);
  10521. c.prototype = d.prototype;
  10522. b.prototype = new c
  10523. },
  10524. Major = function(b) {
  10525. function d() {
  10526. b.call(this);
  10527. this.bmName = ""
  10528. }
  10529. __extends(d, b);
  10530. d.prototype.initMe = function(c, a) {
  10531. b.prototype.initMe.call(this, c, a);
  10532. this._setAnchorX(0);
  10533. this._setAnchorY(0);
  10534. this.myMc = this.createMovieClip("major", "major");
  10535. this.getFrameData();
  10536. this.changeFrame("status1")
  10537. };
  10538. d.prototype.controlMe = function() {};
  10539. d.prototype.frameOver = function() {
  10540. "status1" != this.currentStatus && "status2" != this.currentStatus && "status3" != this.currentStatus || this.myMc.gotoAndPlay(this.currentStatus)
  10541. };
  10542. d.prototype.checkBound = function() {
  10543. 0 > this.x ? this.x = 0 : this.x > GameData.gameStage.stage.stageWidth - 40 && (this.x = GameData.gameStage.stage.stageWidth - 40);
  10544. 0 > this.y ? this.y = 0 : this.y > GameData.gameStage.stage.stageHeight - 40 && (this.y = GameData.gameStage.stage.stageHeight - 40)
  10545. };
  10546. return d
  10547. } (MoveObject);
  10548. Major.prototype.__class__ = "Major";